自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
编写并运行 Tradefed 测试
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本部分面向开发者或测试编写者,提供有关测试执行以及编写测试的指导。在说明中,我们将测试分为两大类:
我们详细介绍了适用于套件和非套件测试的一些功能,例如:
我们还提供了一些关于如何运行部分较为常见的测试类型的通用端到端示例,例如:
上述端到端示例不需要对 Android 进行本地检测。您只需下载 Tradefed 并直接使用即可。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-26。
[null,null,["最后更新时间 (UTC):2025-03-26。"],[],[],null,["# Write and run Tradefed tests\n\nThis section is aimed at developers, or test writers, providing guidance on test\nexecution, as well as writing tests. The instructions are split into two broad\ncategories of tests:\n\n- Tests executing [directly through Tradefed](/docs/core/tests/tradefed/testing/through-tf).\n- Tests executing in the [context of a suite](/docs/core/tests/tradefed/testing/through-suite), for example the [Android Compatibility Test Suite (CTS)](/docs/compatibility/cts).\n\nWe detail some features that are applicable to both suite and non-suite tests,\nfor example:\n\n- [Automatic Retries](/docs/core/tests/tradefed/testing/through-tf/auto-retry) for tests.\n- [Retry Isolation](/docs/core/tests/tradefed/testing/through-tf/retry-isolation) for tests.\n\nWe also provide some generic end-to-end examples about how to run some of the\nmore common test types, such as:\n\n- Execute the [instrumentation tests from an existing APK](/docs/core/tests/tradefed/testing/through-tf/instrumentation).\n\nThe end-to-end examples above do not require a local checkout of Android. You\ncan simply\n[download Tradefed](/docs/core/tests/tradefed/fundamentals/machine_setup#download-tradefed)\nand use them directly."]]