blob: 61c99874f761c168cb8f561698fda8645be5a844 [file] [log] [blame] [view]
A. Cody Schuffelend5d3c1f2020-08-11 18:54:14 -07001# Cuttlefish Getting Started
Alistair Delva6ff7b062019-10-14 16:50:30 -07002
A. Cody Schuffelend5d3c1f2020-08-11 18:54:14 -07003## Try Cuttlefish
Cody Schuffelenbabc8bb2019-10-22 18:47:40 -07004
A. Cody Schuffelend5d3c1f2020-08-11 18:54:14 -070051. Make sure virtualization with KVM is available.
Cody Schuffelenbabc8bb2019-10-22 18:47:40 -07006
A. Cody Schuffelend5d3c1f2020-08-11 18:54:14 -07007 ```bash
Roger Ellis652db672022-01-26 13:09:58 -08008 grep -c -w "vmx\|svm" /proc/cpuinfo
9 ```
A. Cody Schuffelend5d3c1f2020-08-11 18:54:14 -070010
11 This should return a non-zero value. If running on a cloud machine, this may
12 take cloud-vendor-specific steps to enable. For Google Compute Engine
13 specifically, see the [GCE guide].
14
Guang Zhu70f14082021-09-24 12:28:50 -070015 [GCE guide]: https://cloud.google.com/compute/docs/instances/enable-nested-virtualization-vm-instances
A. Cody Schuffelend5d3c1f2020-08-11 18:54:14 -070016
Guang Zhu70f14082021-09-24 12:28:50 -070017*** promo
18 ARM specific steps:
19 - When running on an ARM machine, the most direct way is to check
20 for the existence of `/dev/kvm`. Note that this method can also be used to
21 confirm support of KVM on any environment.
22 - Before proceeding to the next step, please first follow
23 [the guide](multiarch-howto.md) to adjust APT sources.
24***
25
Guang Zhu6cb62942021-09-27 23:59:58 +0000262. Download, build, and install the host debian package:
A. Cody Schuffelend5d3c1f2020-08-11 18:54:14 -070027
28 ```bash
Jorge E. Moreiraca3d1722022-01-06 12:10:37 -080029 sudo apt install -y git devscripts config-package-dev debhelper-compat golang
A. Cody Schuffelend5d3c1f2020-08-11 18:54:14 -070030 git clone https://github.com/google/android-cuttlefish
31 cd android-cuttlefish
Alistair Delva85cd7d62022-03-07 12:15:53 -080032 debuild -i -us -uc -b -d
Guang Zhu6cb62942021-09-27 23:59:58 +000033 sudo dpkg -i ../cuttlefish-common_*_*64.deb || sudo apt-get install -f
Roger Ellis652db672022-01-26 13:09:58 -080034 sudo usermod -aG kvm,cvdnetwork,render $USER
A. Cody Schuffelend5d3c1f2020-08-11 18:54:14 -070035 sudo reboot
36 ```
37
38 The reboot will trigger installing additional kernel modules and applying
39 udev rules.
40
413. Go to http://ci.android.com/
424. Enter a branch name. Start with `aosp-master` if you don't know what you're
Alistair Delva6ff7b062019-10-14 16:50:30 -070043 looking for
Ram Muthiahd3816a32021-04-19 10:49:01 -0700445. Navigate to `aosp_cf_x86_64_phone` and click on `userdebug` for the latest build
Roger Ellis652db672022-01-26 13:09:58 -080045
Guang Zhu0fc44e22022-01-26 00:22:48 +000046*** promo
47 For ARM, use branch `aosp-master-throttled-copped` and device target `aosp_cf_arm64_only_phone-userdebug`
48***
49
A. Cody Schuffelend5d3c1f2020-08-11 18:54:14 -0700506. Click on `Artifacts`
517. Scroll down to the OTA images. These packages look like
Ram Muthiahd3816a32021-04-19 10:49:01 -070052 `aosp_cf_x86_64_phone-img-xxxxxx.zip` -- it will always have `img` in the name.
Alistair Delva6ff7b062019-10-14 16:50:30 -070053 Download this file
A. Cody Schuffelend5d3c1f2020-08-11 18:54:14 -0700548. Scroll down to `cvd-host_package.tar.gz`. You should always download a host
Alistair Delva6ff7b062019-10-14 16:50:30 -070055 package from the same build as your images.
A. Cody Schuffelend5d3c1f2020-08-11 18:54:14 -0700569. On your local system, combine the packages:
Alistair Delva6ff7b062019-10-14 16:50:30 -070057
A. Cody Schuffelend5d3c1f2020-08-11 18:54:14 -070058 ```bash
59 mkdir cf
60 cd cf
61 tar xvf /path/to/cvd-host_package.tar.gz
Ram Muthiahd3816a32021-04-19 10:49:01 -070062 unzip /path/to/aosp_cf_x86_64_phone-img-xxxxxx.zip
A. Cody Schuffelend5d3c1f2020-08-11 18:54:14 -070063 ```
Alistair Delva6ff7b062019-10-14 16:50:30 -070064
A. Cody Schuffelend5d3c1f2020-08-11 18:54:14 -07006510. Launch cuttlefish with:
Alistair Delva6ff7b062019-10-14 16:50:30 -070066
67 `$ HOME=$PWD ./bin/launch_cvd`
68
A. Cody Schuffelend5d3c1f2020-08-11 18:54:14 -070069## Debug Cuttlefish
Alistair Delva6ff7b062019-10-14 16:50:30 -070070
71You can use `adb` to debug it, just like a physical device:
72
73 `$ ./bin/adb -e shell`
74
A. Cody Schuffelen80b58462021-05-12 15:52:24 -070075## Launch Viewer (WebRTC)
Alistair Delva6ff7b062019-10-14 16:50:30 -070076
A. Cody Schuffelen80b58462021-05-12 15:52:24 -070077When launching with `---start_webrtc` (the default), you can see a list of all
78available devices at `https://localhost:8443` . For more information, see the
79WebRTC on Cuttlefish
80[documentation](https://source.android.com/setup/create/cuttlefish-ref-webrtc).
81
Roger Ellis652db672022-01-26 13:09:58 -080082## Stop Cuttlefish
83
84You will need to stop the virtual device within the same directory as you used
85to launch the device.
86
87 `$ HOME=$PWD ./bin/stop_cvd`
88