自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
附錄 A:使用 RRO
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
執行階段資源覆蓋層 (RRO) 可以推送至 /vendor/overlays
資料夾 (會在啟動期間自動讀取),也可以透過執行 adb install
進行安裝。後者可加快疊代速度。不過,這可能會導致相同的 RRO 位於兩個位置 (/vendor/overlays
和 /data/app
)。
如要推送及重新啟動,請執行:
$ 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 和/或其關係企業的商標或註冊商標。
上次更新時間: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"]],["上次更新時間: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`"]]