自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
开发 Tradefed
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本部分面向 Tradefed 开发者。如果您有兴趣扩展 TF 或添加新的测试支持,那么本部分很适合您。
开源
如果您计划使用 Trade Federation 的开源变体,请使用以下命令签出并构建 Trade Federation 的 AOSP main
分支:
cd <sourceroot>
mkdir main
cd main
repo init -u https://android.googlesource.com/platform/manifest -b main
repo sync -c -j8
source build/envsetup.sh
lunch aosp_cf_x86_64_phone-userdebug # or any other device target
m -j tradefed-all
如需了解详情,请参阅开发环境。
所有可开源的 Trade Federation 代码都存储在 AOSP 的 tools/tradefederation/ git 项目中。在编写代码和提交更改时,请记住开放源代码准则。
或者,如果您正在创建使用 Trade Federation 但不在框架本身上运行的测试/实用程序,不妨考虑将您的代码放在某个 Trade Federation contrib 项目中,以加快审批速度。
编码样式
Trade Federation 遵循 Android 编码样式准则,并做出以下说明:接口名称带有“I”前缀,例如 ITestDevice。
使用 Eclipse 开发
如果您有兴趣使用 Eclipse 来开发 Tradefed,请参阅设置 Eclipse IDE,以查看有关设置环境的提示。
运行 Tradefed 的测试
您对 Trade Federation 做出了更改,并且正在测试如何进行测试?请参阅运行 Trade Federation 的测试。
架构
如果您希望更深入地了解 Tradefed 的内部工作原理,请参阅架构部分。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-26。
[null,null,["最后更新时间 (UTC):2025-03-26。"],[],[],null,["# Develop Tradefed\n\nThis section is aimed at Tradefed developers. If you are interested in extending\nTF or adding new test support, this is the section for you.\n\nOpen source\n-----------\n\nIf you plan to use the open source variant of Trade Federation, use these\ncommands to check out and build the AOSP `android-latest-release` branch of\nTrade Federation: \n\n cd \u003csourceroot\u003e\n mkdir android-latest-release\n cd android-latest-release\n repo init -u https://android.googlesource.com/platform/manifest -b android-latest-release\n repo sync -c -j8\n source build/envsetup.sh\n lunch aosp_cf_arm64_only_phone-userdebug # or any other device target\n m -j tradefed-all\n\nSee [Development Environment](/docs/core/tests/tradefed/fundamentals/machine_setup)\nfor more details.\n\nAll open-sourceable Trade Federation code is stored in the\n[tools/tradefederation/](https://android.googlesource.com/platform/tools/tradefederation/)\ngit project of AOSP. Please keep the\n[open source guidelines](/docs/setup/contribute/code-style)\nin mind when writing code and submitting changes.\n\nAlternatively, if you are creating tests/utilities that use Trade Federation but\naren't working on the framework itself, consider placing your work inside one of\nthe [Trade Federation contrib projects](/docs/core/tests/tradefed/development/contribute-noncore) to speed approvals.\n\nCoding style\n------------\n\nTrade Federation follows the\n[Android coding style guidelines](/source/code-style),\nwith the following clarifications: interface names are prefixed with 'I' e.g.\nITestDevice.\n\nDevelop using Eclipse\n---------------------\n\nIf you are interested in using Eclipse in developing Tradefed, refer to\n[Set up Eclipse IDE](/docs/core/tests/tradefed/development/eclipse) for tips on\nsetting up your environment.\n\nRun Tradefed's tests\n--------------------\n\nYou made a change to Trade Federation and you are searching how to test it? see\n[Running Trade Federation's tests](/docs/core/tests/tradefed/development/tf-tests).\n\nArchitecture\n------------\n\nIf you seek a deeper understanding of the innerworkings of Tradefed, see the\n[Architecture](/docs/core/tests/tradefed/architecture) section."]]