自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
適用於免安裝應用程式的 CTS 驗證器
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
針對即時應用程式提供的 CTS Verifier 可使用 CTS Verifier 測試因 OEM 專屬 UI (例如系統 UI) 而無法完全自動化的功能,藉此提升即時應用程式的 Android 相容性測試涵蓋範圍。
需求條件
為即時應用程式執行 CTS Verifier 前,請確認您具備下列設備:
- 已通過 CTS 測試,並通過 Android API 相容性驗證的 Android 裝置。這是測試裝置 (DUT)。
- 搭載 USB 2.0 相容連接埠的 Linux 電腦。所有與 DUT 的連線都會透過這個通訊埠。
在 DUT 上安裝免安裝應用程式
CtsVerifierInstantApp.apk
和 CTS 驗證工具已納入 android-cts-verifier.zip
,您可以登入
Q-EAP 資訊主頁查看。
圖 1. 在 DUT 上安裝 Instant App
合作夥伴可以手動建構 CTS 驗證器,以建構 CTS,並整合或測試新的修正項目。如何手動建構 CtsVerifierInstantApp.apk
。在主機上發出以下指令:
make CtsVerifierInstantApp
如要安裝 CtsVerifierInstantApp.apk
,請在主機上發出下列指令。
adb install -r --instant CtsVerifierInstantApp.apk
adb install -r --instant /path/to/CtsVerifierInstantApp.apk
執行測試
三項系統 UI 測試會顯示在主畫面的「免安裝應用程式」測試類別下方。
圖 2. 主畫面
輕觸「Instant Apps」測試類別下的測試項目後,系統會為該測試開啟測試畫面。測試畫面包含下列項目:
- 操作說明
- 「開始測試」按鈕
- 三個標準 CTS Verifier 按鈕
輕觸「Start Test」按鈕即可啟動範例免安裝應用程式。
圖 3. 測試畫面
第一次輕觸「Start Test」時,系統會開啟警告對話方塊,提供安裝免安裝應用程式範例的操作說明 (圖 4)。如果已安裝免安裝應用程式範例,系統就不會針對其他免安裝應用程式測試顯示這個對話方塊。
圖 4. 安裝操作說明對話方塊
輕觸「Help」按鈕,即可開啟彈出式對話方塊,並查看測試說明。
圖 5. 說明彈出式對話方塊
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。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,["# CTS Verifier for Instant Apps increases Android Compatibility test coverage for Instant\nApps by using CTS Verifier to test features that can't be fully automated due to OEM-\nspecific UIs, such as system UIs.\n\n### Requirements\n\n\nBefore running CTS Verifier for Instant Apps, ensure that you have the following equipment:\n\n- Android device that has verified Android API compatibility by successfully passing the CTS. This is the device-under-test (DUT).\n- Linux computer with USB 2.0 compatible port. All connections to the DUT are through this port.\n\n### Install Instant Apps on DUT\n\n\n`CtsVerifierInstantApp.apk` and the CTS verifier are included in\n`android-cts-verifier.zip`, which can be found by logging in to the [Q-EAP dashboard](https://partner.android.com/build/builds;branch=git_qt-release;product=aosp_arm?a=1016313942).\n\n\n**Figure 1.** Installing Instant App on DUT\n\n\nThe partners can manually build the CTS Verifier to\n[build CTS](/docs/compatibility/cts/development) to incorporate or test out\nnew fixes. To manually build `CtsVerifierInstantApp.apk`. issue the following command on\nthe host: \n\n```\nmake CtsVerifierInstantApp\n```\n\n\nTo install `CtsVerifierInstantApp.apk`, issue the following commands on host. \n\n```\nadb install -r --instant CtsVerifierInstantApp.apk\n``` \n\n```\nadb install -r --instant /path/to/CtsVerifierInstantApp.apk\n```\n\n### Run tests\n\n\nThe three system UI tests are displayed in the home screen under the Instant Apps test category.\n\n\n**Figure 2.** Home screen\n\n\nWhen you tap a test under the Instant Apps test category, a test screen opens for the test.\nThe test screen contains the following:\n\n- Instructions\n- **Start Test** button\n- Three standard CTS Verifier buttons\n - Pass\n - Help\n - Fail\n\n\nTapping the **Start Test** button launches the sample Instant App.\n\n\n**Figure 3.** Test screen\n\n\nThe first time you tap the **Start Test**, an alert\ndialog opens with instructions for installing the sample Instant App (Figure 4).\nIf the sample Instant App is already installed, this dialog isn't shown\nfor other instant app tests.\n\n\n**Figure 4.** Install instruction dialog\n\n\nTapping the **Help** button opens a pop-up dialog with description of the test.\n\n\n**Figure 5.** Help pop-up dialog"]]