Preface
I've done build AOSP on local, and my laptop fan was super loud for three hours, lol. and I think three hours is worth it if you have a bunch of patches that need to be applied to AOSP that prebuilt don't provide. Otherwise, if you just want to play around with the Android system for whatever reason, I recommend using the prebuilt version.
Download required files
First, you need to download two files from ci.android.com, choose the aosp_cf_x86_64_phone
and click the latest and available one. the file name is aosp_cf_x86_64_phone-apps-*.zip
and cvd-host_package.tar.gz
.
Arch linux specific instruction
On Arch linux system, you need to install cuttlefish-base-git
package form AUR, and start a systemd service: sudo systemctl start cuttlefish-host-resources.service
make sure it already started before execute launch_cvd
.
Extract and run it
the visual representation of structure directory for the following command:
[user@host aosp-prebuilt]$ tree -L 2
.
├── android-info.txt
├── boot.img
├── boot.img.lock
├── bootloader
├── cvd-host
│ ├── bin
│ ├── com.android.i18n
│ ├── cuttlefish
│ ├── cuttlefish_assembly -> /home/reyuki/experiments/aosp-prebuilt/cvd-host/cuttlefish/assembly
│ ├── cuttlefish_runtime -> /home/reyuki/experiments/aosp-prebuilt/cvd-host/cuttlefish/instances/cvd-1
│ ├── cuttlefish_runtime.1 -> /home/reyuki/experiments/aosp-prebuilt/cvd-host/cuttlefish/instances/cvd-1
│ ├── etc
│ ├── framework
│ ├── lib64
│ ├── nativetest64
│ └── usr
├── downloaded
│ ├── aosp_cf_x86_64_phone-img-12597754.zip
│ └── cvd-host_package.tar.gz
├── fastboot-info.txt
├── init_boot.img
├── init_boot.img.lock
├── super.img
├── super.img.lock
├── userdata.img
├── userdata.img.lock
├── vbmeta.img
├── vbmeta.img.lock
├── vbmeta_system_dlkm.img
├── vbmeta_system_dlkm.img.lock
├── vbmeta_system.img
├── vbmeta_system.img.lock
├── vbmeta_vendor_dlkm.img
├── vbmeta_vendor_dlkm.img.lock
├── vendor_boot.img
└── vendor_boot.img.lock
14 directories, 23 files
the command below will setup crossvm, WebRTC connection and other stuff:
HOME=${PWD} ./bin/launch_cvd --daemon -system_image_dir `realpath ..`
it will run in the background, so you need to stop the virtual device if didn't used anymore with stop_cvd
.
Reference
- www.2net.co.uk good material for seeking further information
- for build locally, it's recommended to use ccache.