This page describes how to launch an AOSP build using Cuttlefish.
Verify KVM availability
Cuttlefish is a virtual device and is dependent on virtualization being available on the host machine.
In a terminal on your host machine, make sure that virtualization with a Kernel-based Virtual Machine (KVM) is available:
grep -c -w "vmx\|svm" /proc/cpuinfo
This command should return a nonzero value.
When running on an ARM machine, the most direct way is to check for
find /dev -name kvm
In a terminal window, download, build, and install the host Debian packages:
sudo apt install -y git devscripts config-package-dev debhelper-compat golang curl
git clone https://github.com/google/android-cuttlefish
for dir in base frontend; do cd $dir debuild -i -us -uc -b -d cd .. done
sudo dpkg -i ./cuttlefish-base_*_*64.deb || sudo apt-get install -f
sudo dpkg -i ./cuttlefish-user_*_*64.deb || sudo apt-get install -f
sudo usermod -aG kvm,cvdnetwork,render $USER
The reboot triggers installing additional kernel modules and applies
Cuttlefish is part of the Android Open-Source Platform (AOSP). Builds of the virtual device are found at the Android Continuous Integration site. To find an index of all Android builds, navigate to the Android Continuous Integration site at http://ci.android.com/.
Enter a branch name. Use the default
aosp-masterbranch or use a generic system image (GSI) branch such as
Navigate to the aosp_cf_x86_64_phone build target and click userdebug for the latest build.
Click the green box below userdebug to select this build. A Details panel appears with more information specific to this build. In this panel, click Artifacts to see a list of all the artifacts attached to this build.
In the Artifacts panel, download the artifacts for Cuttlefish.
aosp_cf_x86_64_phone-img-xxxxxx.zipartifact, which contains the device images. In the filename, "xxxxxx" is the build ID for this device.
Scroll down in the panel and download
cvd-host_package.tar.gz. Always download the host package from the same build as your images.
On your local system, create a container folder and extract the packages:
tar -xvf /path/to/cvd-host_package.tar.gz
HOME=$PWD ./bin/launch_cvd --daemon
Verify that Cuttlefish is visible through adb
Similar to a physical device, Cuttlefish is visible through the Android Debug Bridge (adb).
In the same folder where you launched Cuttlefish, run the following command to see a list of all the Android devices available through adb on your host machine:
View and interact with the virtual device in the web
By default, Cuttlefish launches with
--start_webrtc, which enables a webview
through port 8443 on the host machine.
To view and interact with your virtual devices, navigate to https://localhost:8443 in your web browser.
For more information, see Cuttlefish: WebRTC Streaming.
Stop the virtual device within the same directory as you used to launch the device: