./out/host/linux-x86/bin/apksignerplatform.pk8 在
./build/make/target/product/security/platform.pk8 ./build/make/target/product/security/platform.x509.pemAOSP 中 OTA 相關的 generate key 說明:Sign build for release。
./out/host/linux-x86/bin/apksignerplatform.pk8 在
./build/make/target/product/security/platform.pk8 ./build/make/target/product/security/platform.x509.pemAOSP 中 OTA 相關的 generate key 說明:Sign build for release。
tools/buildutils/build_packages.sh
sudo usermod -aG kvm,cvdnetwork,render $USER然後因為會產生 /dev/ 下的node,所以要 reboot.
launch_avd .... ailed to connect:No such device [2025-06-19T10:09:00.523729147+00:00 ERROR crosvm] exiting with error 1: the architecture failed to build the vm Caused by: failed to create a PCI root hub: failed to create proxy device: Failed to configure tube: failed to receive packet: Connection reset by peer (os error 104) Detected unexpected exit of monitored subprocess /home/charles-chang/aosp/out/host/linux-x86/bin/process_restarter Subprocess /home/charles-chang/aosp/out/host/linux-x86/bin/process_restarter (16314) has exited with exit code 1 Failed to connect:No such device Client closed the connection Client closed the connection Client closed the connection [2025-06-19T10:09:01.549915546+00:00 ERROR crosvm] exiting with error 1: the architecture failed to build the vm Caused by: failed to create a PCI root hub: failed to create proxy device: Failed to configure tube: failed to receive packet: Connection reset by peer (os error 104) ....不知道是什麼原因,但是加上 gpumode 之後就可以開起來..
launch_cvd --gpu_mode=gfxstream ... VIRTUAL_DEVICE_BOOT_STARTED VIRTUAL_DEVICE_NETWORK_MOBILE_CONNECTED VIRTUAL_DEVICE_BOOT_COMPLETED Virtual device booted successfully依照 google cuttlefish 的說明,這樣啟動的 emulator 是沒有螢幕的,所以用 adb 可以連線。
launch_cvd --gpu_mode=gfxstream --daemon ... Virtual device booted successfully VIRTUAL_DEVICE_BOOT_COMPLETED這樣會跑在background,用 browser 開啟 http://localhost:8443 就會看到 cvd-1
launch_cvd --gpu_mode=gfxstream -start_webrtc --daemon停止要用 cvd reset 或 stop_cvd
mkdir aosp && cd aosp repo init -u https://android.googlesource.com/platform/manifest -b android-14.0.0_r75 --depth=1 repo sync -c --no-tags --no-clone-bundle -j3超過 3 就會有 resource limiit error,其實最後還是用1。
source buile/envsetup.sh lunch出現一堆,但是都沒有類似說明的 x86_64,ref:how do I build android emulator from source 的說明。
lunch sdk_phone64_x86_64-trunk_staging-user竟然 OK 了。-- 嘗試 userdebug, eng 也都 OK
============================================ PLATFORM_VERSION_CODENAME=VanillaIceCream PLATFORM_VERSION=VanillaIceCream PRODUCT_INCLUDE_TAGS=com.android.mainline mainline_module_prebuilt_nightly TARGET_PRODUCT=sdk_phone64_x86_64 TARGET_BUILD_VARIANT=user TARGET_ARCH=x86_64 TARGET_ARCH_VARIANT=x86_64 TARGET_2ND_ARCH_VARIANT=x86_64 HOST_OS=linux HOST_OS_EXTRA=Linux-6.8.0-60-generic-x86_64-Ubuntu-24.04.2-LTS HOST_CROSS_OS=windows BUILD_ID=AP2A.240805.005.S4 OUT_DIR=out ============================================如果依照 ref 的說明
lunch aosp_cf_x86_64_only_phone-aosp_current-userdebug ... build/make/core/release_config.mk:145: error: No release config found for TARGET_RELEASE: aosp_current. Available releases are: ap2a next staging trunk trunk_food trunk_staging.依照error 說明把 aosp_current 改掉
lunch aosp_cf_x86_64_only_phone-trunk-user就可以了 (順便測試 user build 也 OK)
============================================ PLATFORM_VERSION_CODENAME=VanillaIceCream PLATFORM_VERSION=VanillaIceCream PRODUCT_INCLUDE_TAGS=com.android.mainline mainline_module_prebuilt_nightly TARGET_PRODUCT=aosp_cf_x86_64_only_phone TARGET_BUILD_VARIANT=user TARGET_ARCH=x86_64 TARGET_ARCH_VARIANT=silvermont HOST_OS=linux HOST_OS_EXTRA=Linux-6.8.0-60-generic-x86_64-Ubuntu-24.04.2-LTS HOST_CROSS_OS=windows BUILD_ID=AP2A.240805.005.S4 OUT_DIR=out ============================================cf 就是給 cuttlefish (android emulator name) 用的。
repo init --partial-clone --no-use-superproject -b android-latest-release -u https://android.googlesource.com/platform/manifest repo sync -c -j3依照googlesource 說明
lunch aosp_cf_x86_64_only_phone-aosp_current-userdebug因為現在 lunch 都不會出現target 讓你選了。
sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0 sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0或是增加這個檔案到系統,免得每次開機都要重新設:
$ cat /etc/sysctl.d/99-apparmor-unconfined.conf kernel.apparmor_restrict_unprivileged_unconfined=0 kernel.apparmor_restrict_unprivileged_userns=0 $sudo sysctl --system