自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
适用于免安装应用的 CTS 验证程序
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
适用于免安装应用的 CTS 验证程序,可使用 CTS 验证程序测试因 OEM 特定界面(例如系统界面)而无法完全实现自动化测试的功能,从而提高了 Android 兼容性测试对于免安装应用的覆盖率。
要求
在运行适用于免安装应用的 CTS 验证程序之前,请确保您已准备以下设备:
- 一台已验证 Android API 兼容性(即已成功通过 CTS 测试)的 Android 设备。该设备将作为被测设备 (DUT)。
- 一台具有 USB 2.0 兼容端口的 Linux 计算机。对 DUT 的所有连接都将通过此端口。
在 DUT 上安装免安装应用
CtsVerifierInstantApp.apk
和 CTS 验证程序包含在 android-cts-verifier.zip
中,只需登录 Q-EAP 信息中心即可找到该文件。
图 1. 在 DUT 上安装免安装应用
合作伙伴可以手动构建 CTS 验证程序,构建 CTS 来合并或测试新的修复。如需手动构建 CtsVerifierInstantApp.apk
,请在主机上发出以下命令:
make CtsVerifierInstantApp
如需安装 CtsVerifierInstantApp.apk
,请在主机上发出以下命令:
adb install -r --instant CtsVerifierInstantApp.apk
adb install -r --instant /path/to/CtsVerifierInstantApp.apk
运行测试
三个系统界面测试显示在主屏幕中的免安装应用测试类别下。
图 2. 主屏幕
当您点按免安装应用测试类别下的某个测试时,即会打开该测试的测试屏幕。测试屏幕中包含以下内容:
- 说明
- Start Test 按钮
- 三个标准 CTS 验证程序按钮
点按 Start Test 按钮会启动示例免安装应用。
图 3. 测试屏幕
当您第一次点按 Start Test 时,系统会打开一个提醒对话框,其中会显示有关安装示例免安装应用的说明(图 4)。如果已经安装了示例免安装应用,系统将不会针对其他免安装应用测试显示此对话框。
图 4. 安装说明对话框
点按 Help 按钮会打开一个弹出式对话框,其中会显示测试说明。
图 5. “Help”弹出式对话框
本页面上的内容和代码示例受内容许可部分所述许可的限制。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,["# 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"]]