Updated: March 11, 2025 |
sudo apt-get install git-core gnupg flex bison build-essential zip curl zlib1g-dev libc6-dev-i386 x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig libncurses5Then install Repo by following Google's instructions: https://source.android.com/docs/setup/start/requirements#install-software
mkdir a14_r2 && cd a14_r2 export WORKSPACE=$PWD
mkdir $WORKSPACE/android-kernel && cd $WORKSPACE/android-kernel repo init -u https://android.googlesource.com/kernel/manifest -b trout-android12-5.10 repo sync -c -j8
cd common git fetch aosp git checkout deprecated/android12-5.10-2023-03 cd ..
mkdir $WORKSPACE/aosp && cd $WORKSPACE/aosp repo init -u https://android.googlesource.com/platform/manifest -b android-14.0.0_r2 repo sync -c -j8
cd $WORKSPACE/android-kernel/common curl https://gitlab.com/qnx/hypervisor/aosp/kernel_common/-/raw/android12-5.10- 2023-03-qnx/common_changes_d0782c9411db46ff9fc9120ff5fc5e173088bcd2.diff | git apply cd $WORKSPACE/android-kernel/common-modules/virtual-device curl https://gitlab.com/qnx/hypervisor/aosp/kernel_common-modules_virtual-devic e/-/raw/trout-android12-5.10-qnx/virtual-device_changes.diff | git apply cd $WORKSPACE/aosp/device/google/cuttlefish curl https://gitlab.com/qnx/hypervisor/aosp/device_google_cuttlefish/-/raw/andr oid-14.0.0_r2-qnx/device_google_cuttlefish.diff | git apply cd $WORKSPACE/aosp/external/v4l2_codec2 curl https://gitlab.com/qnx/hypervisor/aosp/platform_external_v4l2_codec2/-/raw /android-14.0.0_r2-qnx/v4l2_codec2_changes.diff | git apply cd $WORKSPACE/aosp/frameworks/av curl https://gitlab.com/qnx/hypervisor/aosp/platform_frameworks_av/-/raw/androi d-14.0.0_r2-qnx/platform_frameworks_av.diff | git apply cd $WORKSPACE/aosp/packages/services/Car curl https://gitlab.com/qnx/hypervisor/aosp/platform_packages_services_car/-/ra w/android-14.0.0_r2-qnx/packages_services_Car.diff | git apply cd $WORKSPACE/aosp/system/sepolicy curl https://gitlab.com/qnx/hypervisor/aosp/platform_system_sepolicy/-/raw/andr oid-14.0.0_r2-qnx/platform_system_sepolicy.diff | git apply
After setting up your host workplace with the Android components, you need to clone the Android guest repository to your host and then build the guest.
mkdir -p $WORKSPACE/aosp/device/qnx && cd $WORKSPACE/aosp/device/qnx git clone https://gitlab.com/qnx/hypervisor/aosp/device_qnx_warbler.git warbler
cd $WORKSPACE export ANDROID_SOURCE=aosp export ANDROID_KERNEL_SOURCE=android-kernel export ANDROID_VARIANT=aosp_warbler_arm64-userdebug export ANDROID_DEVICE=warbler_arm64 . ./aosp/device/qnx/warbler/tools/a14_disk_image_build.sh
After building the Android guest for the first time, you may want to configure it. Every time you configure the Android guest files, you'll need to rebuild the Android guest to apply the changes. If you're rebuilding the guest frequently, you can skip the rebuild step.
export ANDROID_CLOBBER=false
export BUILD_KERNEL_LOCALLY=false
After building your Android guest, you install the built guest to your cloud target and run it.
qvm @/guests/android/Android14-auto/a14-aarch64-auto.conf
adb connect 10.0.0.123