使用可設定的模擬器進行測試
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
為了模擬原始設備製造商 (OEM) 使用的部分設定,某些硬體設定檔支援執行階段設定功能。
這些設定是使用執行階段資源覆蓋層 (RRO) 實作,並可使用 adb shell cmd overlay
指令進行管理。
使用下列指令啟用或停用 RRO:
adb shell cmd overlay enable NAME
adb shell cmd overlay disable NAME
修改系統列位置
根據預設,可設定的模擬器有兩個系統列,分別是畫面頂端的狀態列和畫面底部的導覽列。雖然許多車輛都採用這個版面配置,但有些車輛並非如此。特別值得注意的是,部分車輛的系統資訊列位於螢幕的水平邊緣,而非垂直邊緣,這可能會破壞開發行動裝置板型規格的應用程式時所做的假設。如需更多詳細資訊和技術指南,請參閱「系統列、沉浸模式和邊到邊算繪」。
您可以使用下列 RRO 修改系統列:
com.android.systemui.rro.bottom
com.android.systemui.rro.bottom.rounded
com.android.systemui.rro.left
com.android.systemui.rro.right
模擬螢幕凹口
部分車輛的螢幕有螢幕凹口,與行動裝置上的螢幕截然不同。部分 Android Automotive OS 車輛的螢幕並非有凹槽或針孔相機凹口,而是使用非矩形的弧形螢幕。詳情請參閱「因應不規則形狀螢幕」一文,瞭解相關技術指南。
您可以使用下列 RRO 模擬螢幕缺口:
com.android.internal.display.cutout.emulation.top_and_right
com.android.internal.display.cutout.emulation.free_form
com.android.internal.emulation.automotive_ultrawide_cutout
建議的測試設定
由於結合這些 RRO 可建立的設定總數相當龐大,建議您使用下列 硬體設定檔和 RRO 組合測試應用程式,這些組合與目前路上行駛的部分車輛相似。
- 使用
com.android.systemui.rro.left
或 com.android.systemui.rro.right
的Automotive (1080p 橫向)
- Automotive Ultrawide 搭配
com.android.systemui.rro.left
和 com.android.internal.emulation.automotive_ultrawide_cutout
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。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,["# Test using the configurable emulator\n\nTo help emulate some of the configurations seen across OEMs, certain [hardware\nprofiles](/training/cars/testing/emulator#bundled-profiles) support runtime\nconfigurability.\n\nThese configurations are implemented using [Runtime Resource\nOverlays](https://source.android.com/docs/core/runtime/rros) (RROs)\nand can be managed using the `adb shell cmd overlay` command.\n\nUse the following commands to enable or disable a RRO: \n\n adb shell cmd overlay enable \u003cvar translate=\"no\"\u003eNAME\u003c/var\u003e\n adb shell cmd overlay disable \u003cvar translate=\"no\"\u003eNAME\u003c/var\u003e\n\nModify system bar position\n--------------------------\n\nBy default, the configurable emulator has two system bars -- a status bar on the\ntop of the screen and a navigation bar at the bottom of the screen. Though many\ncars share this layout, some don't. Of particular note is that some cars have\ntheir system bar(s) on the horizontal sides of the screen and not the vertical\nsides, which may break assumptions made when developing apps for mobile form\nfactors. See [System bars, immersive mode, and\nedge-to-edge rendering](/training/cars/parked/automotive-os#bars-immersive-edge)\nfor more details and technical guidance.\n\nThe following RROs can be used to modify the system bars:\n\n- `com.android.systemui.rro.bottom`\n- `com.android.systemui.rro.bottom.rounded`\n- `com.android.systemui.rro.left`\n- `com.android.systemui.rro.right`\n\nEmulate display cutouts\n-----------------------\n\nSome cars have screens with display cutouts that are very different when\ncompared to those seen on mobile devices. Instead of the notches or pinhole\ncamera cutouts, some Android Automotive OS vehicles have curved screens that\nmake the screen non-rectangular. See [Adapt to irregularly shaped displays](/training/cars/parked/automotive-os#irregular-displays)\nfor more details and technical guidance.\n\nThe following RROs can be used to emulate display cutouts:\n\n- `com.android.internal.display.cutout.emulation.top_and_right`\n- `com.android.internal.display.cutout.emulation.free_form`\n- `com.android.internal.emulation.automotive_ultrawide_cutout`\n\nRecommended testing configurations\n----------------------------------\n\nSince the total number of configurations that can be created by combining these\nRROs is quite large, we recommend testing your app using the following\ncombinations of [hardware profiles](/training/cars/testing/emulator#bundled-profiles)\nand RROs, which are similar to some vehicles on the road today.\n\n- *Automotive (1080p landscape)* with `com.android.systemui.rro.left` or `com.android.systemui.rro.right`\n- *Automotive Ultrawide* with `com.android.systemui.rro.left` and `com.android.internal.emulation.automotive_ultrawide_cutout`"]]