Run prebuilt AOSP

24年 11月 4日 Monday
283 words
2 minutes

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.

screenshot of the artifacts

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:

text
[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:

bash
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.

Title:Run prebuilt AOSP

Author:ReYuki

Link:https://www.reyuki.site/posts/run-prebuilt-aosp [copy]

Last updated:


This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. You are free to share and adapt it, as long as you give appropriate credit, don’t use it for commercial purposes, and distribute your contributions under the same license. Provided under license CC BY-NC-SA 4.0