自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
附录 A:使用 RRO
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
可以将运行时资源叠加层 (RRO) 推送到 /vendor/overlays
文件夹(在启动过程中自动读取),也可以通过运行 adb install
进行安装。后者可加快迭代速度,但可能会导致两个位置(/vendor/overlays
和 /data/app
)的 RRO 重复。
如需推送和重新启动,请运行以下命令:
$ adb root
$ adb remount
$ adb shell mkdir /vendor/overlay/<overlay-name>
$ adb push <path-to-overlay.apk-file> /vendor/overlay/<overlay-name>
$ adb reboot
如需安装,请运行以下命令:
$ adb install <path-to-overlay.apk-file>
如需确认 RRO 是否可用,请运行以下命令:
$ adb shell cmd overlay list --user current
android
[ ] com.android.sample_rro
com.android.sample.targetapp
[ ] com.android.sample.targetapp_rro
如果新安装的 RRO 旁边显示了 ---
,则表示未找到目标 APK(请核对您的 AndroidManifest.xml
上的 targetPackage
声明)或 RRO 中定义的某些资源与目标中的资源都不匹配。
启用和停用 RRO
如需启用或停用 RRO,请分别运行相应命令:
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Appendix A, work with RROs\n\nRuntime resource overlays (RROs) can either be pushed to the `/vendor/overlays`\nfolder (which is automatically read during boot) or can be installed by running\n`adb install`.\nThe latter allows faster iteration. However, this can cause the same RRO to reside in two\nlocations (`/vendor/overlays` and `/data/app`).\n\nFor pushing and rebooting, run: \n\n```bash\n$ adb root\n$ adb remount\n$ adb shell mkdir /vendor/overlay/\u003coverlay-name\u003e\n$ adb push \u003cpath-to-overlay.apk-file\u003e /vendor/overlay/\u003coverlay-name\u003e\n$ adb reboot\n```\n\n\nFor installation, run: \n\n```bash\n$ adb install \u003cpath-to-overlay.apk-file\u003e\n```\n\n\nTo confirm the RRO is available, run: \n\n```bash\n$ adb shell cmd overlay list --user current\n android\n [ ] com.android.sample_rro\n com.android.sample.targetapp\n [ ] com.android.sample.targetapp_rro\n```\n\n\nWhen `---` is displayed next to the newly installed RRO, this indicates that the\ntarget APK was either not found (double-check the `targetPackage` declaration on your\n`AndroidManifest.xml`) or some of the resources defined in the RRO don't match any\nresources in the target.\n\nEnable and disable RROs\n-----------------------\n\n\nTo enable or disable a RRO, respectively, run the desired command:\n\n- Enable: \n\n `adb shell cmd overlay enable --user current \u003crro-package-name\u003e`\n\n- Disable: \n\n `adb shell cmd overlay disable --user current \u003crro-package-name\u003e`"]]