Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release
thay vì aosp-main
để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
Phát triển Tradefed
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Phần này dành cho các nhà phát triển Tradefed. Nếu bạn muốn mở rộng TF hoặc thêm tính năng hỗ trợ kiểm thử mới, thì đây là phần dành cho bạn.
Nguồn mở
Nếu bạn dự định sử dụng biến thể nguồn mở của Trade Federation, hãy sử dụng các lệnh sau để kiểm tra và tạo nhánh AOSP android-latest-release
của Trade Federation:
cd <sourceroot>
mkdir android-latest-release
cd android-latest-release
repo init -u https://android.googlesource.com/platform/manifest -b android-latest-release
repo sync -c -j8
source build/envsetup.sh
lunch aosp_cf_arm64_only_phone-userdebug # or any other device target
m -j tradefed-all
Hãy xem phần Môi trường phát triển để biết thêm thông tin chi tiết.
Tất cả mã nguồn mở của Trade Federation đều được lưu trữ trong dự án git tools/tradefederation/ của AOSP. Vui lòng lưu ý nguyên tắc về nguồn mở khi viết mã và gửi nội dung thay đổi.
Ngoài ra, nếu bạn đang tạo các chương trình kiểm thử/tiện ích sử dụng Trade Federation nhưng không hoạt động trên chính khung này, hãy cân nhắc đặt công việc của bạn vào một trong các dự án đóng góp của Trade Federation để đẩy nhanh quá trình phê duyệt.
Kiểu lập trình
Trade Federation tuân theo nguyên tắc về quy tắc lập trình Android, với những điểm giải thích sau: tên giao diện có tiền tố là "I", ví dụ: ITestDevice.
Phát triển bằng Eclipse
Nếu bạn muốn sử dụng Eclipse trong quá trình phát triển Tradefed, hãy tham khảo phần Thiết lập Eclipse IDE để biết các mẹo thiết lập môi trường.
Chạy các chương trình kiểm thử của Tradefed
Bạn đã thay đổi Trade Federation và đang tìm cách kiểm thử? Hãy xem phần Chạy kiểm thử của Trade Federation.
Kiến trúc
Nếu bạn muốn tìm hiểu sâu hơn về cách hoạt động bên trong của Tradefed, hãy xem phần Cấu trúc.
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],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."]]