Android 14下如何构建支持多屏与Concurrent multi-user的AAOS模拟器镜像
构建支持多屏与多用户的Android 14 AAOS模拟器镜像
环境准备
- 同步Android 14(U版本)的AAOS完整源码,确保构建环境变量(如
ANDROID_BUILD_TOP)配置正常
多屏与多用户核心配置调整
- 修改设备清单文件
device/manifest.xml,添加额外显示屏声明示例:<display android:name="cluster" android:physicalId="1" android:logicalId="1" android:orientation="landscape" android:width="720" android:height="1280" /> <display android:name="passenger" android:physicalId="2" android:logicalId="2" android:orientation="landscape" android:width="1920" android:height="1080" /> - 编辑
frameworks/base/core/res/res/values/config.xml,启用并发多用户支持:<bool name="config_enableConcurrentMultiUser">true</bool> <integer name="config_maxConcurrentUsers">3</integer> <!-- 可按需调整最大并发用户数 -->
模拟器AVD配置修改
- 找到目标AVD的
config.ini文件(通常路径为~/.android/avd/[AVD_NAME].avd/),添加多屏参数:hw.display.count=3 hw.display.width=1920 hw.display.height=1080 hw.display.1.width=720 hw.display.1.height=1280 hw.display.1.density=320 hw.display.2.width=1920 hw.display.2.height=1080 hw.display.2.density=240 hw.multiscreen=yes
编译与功能验证
- 执行编译命令:
source build/envsetup.sh lunch aosp_car_x86_64-userdebug make -j$(nproc) - 启动模拟器后验证:
- 执行
adb shell dumpsys display,确认输出包含多个显示屏的识别信息 - 执行
adb shell am start-user --user-id 1创建新用户,验证多用户并发切换功能正常
- 执行
注:Android 14 AAOS对多屏、多用户的配置逻辑相比Android R有更新,旧版本的配置项(如多用户开关)已调整,这是此前方法失效的核心原因。
内容的提问来源于stack exchange,提问作者93537231
相关产品推荐
相关产品推荐

