Android12编译x86模拟器报找不到userdata-qemu.img

qemu-system-x86_64: Could not open 'out/target/product/generic_x86_64/userdata-qemu.img': No such file or directory

选择编译aosp_x86-eng时没有生成模拟器,报

c 复制代码
qemu-system-x86_64: Could not open 'out/target/product/generic_x86_64/userdata-qemu.img': No such file or directory

这是因为编译"aosp_x86_64-eng"不会生成qemu所需镜像,需编译SDK版的。但在执行lunch时,只有car版的:

bash 复制代码
     64. sdk_car_arm-userdebug
     65. sdk_car_arm64-userdebug
     66. sdk_car_x86-userdebug
     67. sdk_car_x86_64-userdebug

需要自己添加phone版的选项,在build/make/target/product/AndroidProducts.mk中添加:

bash 复制代码
COMMON_LUNCH_CHOICES := \
    aosp_arm64-eng \
    aosp_arm-eng \
    aosp_x86_64-eng \
    aosp_x86-eng \
    sdk_x86_64-eng \
    sdk_phone_x86_64-eng \
    sdk_x86_64-userdebug \
    sdk_phone_x86_64-userdebug

再source build/envsetup.sh,再执行lunch就有了:

bash 复制代码
     64. sdk_car_arm-userdebug
     65. sdk_car_arm64-userdebug
     66. sdk_car_x86-userdebug
     67. sdk_car_x86_64-userdebug
     68. sdk_phone_x86_64-eng
     69. sdk_phone_x86_64-userdebug
     70. sdk_x86_64-eng
     71. sdk_x86_64-userdebug

选择70,编译完成,执行:

bash 复制代码
emulator

模拟器正常启动。

相关推荐
不会Android的潘潘1 天前
受限系统环境下的 WebView 能力演进:车载平台 Web 渲染异常的根因分析与优化实践
android·java·前端·aosp
奔跑吧 android2 天前
【车载audio开发】【Qualcomm PAL 详解 6】【PAL 总体架构与模块交互指南】
audio·aosp·pal·高通音频框架·8155·8295
奔跑吧 android2 天前
【车载audio开发】【Qualcomm PAL 详解 4】【Session 模块 介绍】
audio·aosp·高通·车载音频
不会Android的潘潘4 天前
adb指令扩展方案
android·adb·aosp
千里马学框架5 天前
敏感权限如何自动授权?pkms的permission部分常用命令汇总
android·车载系统·framework·perfetto·权限·系统开发·pkms
千里马学框架6 天前
疑难ANR面试题:crash导致ANR深入剖析
android·智能手机·framework·perfetto·性能·anr·小米汽车
似霰7 天前
AIDL Hal 开发笔记4----驱动开发
android·驱动开发·framework·hal
似霰7 天前
AIDL Hal 开发笔记2----AIDL HAL 实例分析light hal
android·framework·hal
似霰8 天前
AIDL Hal 开发笔记1----AIDL HAL 整体架构
android·framework·hal
似霰9 天前
HIDL Hal 开发笔记10----添加硬件访问服务(Java 层调用 HIDL)
android·framework·hal