ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
เรียกใช้การทดสอบอัตโนมัติของ CTS (AOSP 10 หรือต่ำกว่า)
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
หน้านี้มีวิธีการเรียกใช้การทดสอบอัตโนมัติของ CTS ใน Android 10 หรือต่ำกว่า
เรียกใช้เซสชันการลองอีกครั้ง
หากนี่เป็นการทดสอบครั้งแรก การทดสอบอาจล้มเหลวเนื่องจากปัญหาที่อยู่นอกเหนือการควบคุมของคุณ เช่น การเชื่อมต่อเครือข่ายอาจช้าหรือสัญญาณ GPS อาจอ่อน ดังนั้น ให้เรียกใช้การทดสอบซ้ำ (ลองอีกครั้ง) จนกว่าโมดูลการทดสอบทั้งหมดจะเสร็จสมบูรณ์ และจำนวนการทดสอบที่ไม่ผ่านเหมือนกันในเซสชันการลองอีกครั้ง 2 รายการล่าสุด วิธีเรียกใช้เซสชันการลองอีกครั้งสำหรับ Android 9 และ 10
run retry --retry session_number`
วิธีเรียกใช้เซสชันการลองอีกครั้งสำหรับ Android 8.1 หรือต่ำกว่า
run cts --retry session_number
เรียกใช้เซสชันการลองอีกครั้งในการทดสอบที่มีพารามิเตอร์ซึ่งไม่สําเร็จ
ระบบจะไม่ลองทดสอบที่มีพารามิเตอร์ที่ผ่านแล้วอีกครั้ง วิธีเรียกใช้เซสชันการลองอีกครั้งในการทดสอบที่มีพารามิเตอร์ซึ่งไม่สําเร็จเท่านั้น
run retry --retry session_number --new-parameterized-handling
เรียกใช้แผนการทดสอบแต่ละรายการ
คุณเรียกใช้แผนทดสอบแต่ละรายการแทนการเรียกใช้แผนทดสอบทั้งหมดพร้อมกันได้วิธีเรียกใช้แผนทดสอบแต่ละรายการ
ระบุชื่อแผนทดสอบที่ต้องการเรียกใช้
สำหรับ Android 7 ขึ้นไป ให้ทำดังนี้
list modules
สำหรับ Android 6 หรือต่ำกว่า ให้ทำดังนี้
list plans
เรียกใช้แผนทดสอบ
run cts --plan test_module_or_plan_name
ปรับปรุงเวลาในการเรียกใช้การทดสอบ
หากต้องการปรับปรุงเวลาในการเรียกใช้การทดสอบ คุณสามารถแบ่งการทดสอบในอุปกรณ์หลายเครื่อง การแยกข้อมูลกำหนดให้โฮสต์ต้องเชื่อมต่ออุปกรณ์อย่างน้อย 2 เครื่อง แต่เราขอแนะนำให้ใช้อุปกรณ์อย่างน้อย 6 เครื่องเพื่อให้มีประสิทธิภาพ
หากต้องการแบ่งกลุ่มการทดสอบใน Android 9 หรือ 10 ให้เรียกใช้คำสั่งต่อไปนี้
run cts --shard-count number_of_shards
หากต้องการแบ่งกลุ่มการทดสอบใน Android 8.1 หรือต่ำกว่า ให้เรียกใช้คำสั่งต่อไปนี้
run cts --shards number_of_shards
เรียกใช้ CTS สำหรับอุปกรณ์หลายหน้าจอ
หากอุปกรณ์ใช้ Android 10 และมีหน้าจอหลายหน้าจอ คุณต้องเรียกใช้แผนการทดสอบ cts-foldable
แยกกัน ดังนี้
run cts-foldable
เทสเคสที่ผ่านหรือไม่ผ่านสําหรับโหมดหน้าจออื่นจะเพิ่มค่าจาก display_mode
ต่อท้าย เช่น testcase1[display_mode=0]
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[[["เข้าใจง่าย","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 UTC"],[],[],null,["# Run CTS automated tests (AOSP 10 or lower)\n\nThis page contains instructions for running CTS automated tests on Android 10\nor lower.\n\nRun a retry session\n-------------------\n\nIf this is your first test run, there might be tests that fail due to issues\nbeyond your control. For example, a network connection might be slow or a GPS\nsignal might be weak. So, rerun (retry) the tests until all test modules are\ncompleted and the test failure numbers are the same in the last two retry\nsessions. To run a retry session for Android 9 and 10: \n\n run retry --retry \u003cvar translate=\"no\"\u003esession_number\u003c/var\u003e`\n\nTo run a retry session for Android 8.1 or lower: \n\n run cts --retry \u003cvar translate=\"no\"\u003esession_number\u003c/var\u003e\n\n| **Note:** For implementation details for CTS retry, see [Use suite retry](/docs/core/tests/tradefed/testing/through-suite/suite-retry).\n\nRun a retry session on failed parameterized tests\n-------------------------------------------------\n\nPassed parameterized tests aren't retried. To run a retry session on failed\nparameterized tests only: \n\n run retry --retry \u003cvar translate=\"no\"\u003esession_number\u003c/var\u003e --new-parameterized-handling\n\nRun individual test plans\n-------------------------\n\nInstead of running all test plans at once, you can run individual test plans.\nTo run an individual test plan:\n\n1. Identify the name of the test plan you want to run.\n\n For Android 7 and higher: \n\n list modules\n\n For Android 6 or lower: \n\n list plans\n\n2. Run the test plan:\n\n run cts --plan \u003cvar translate=\"no\"\u003etest_module_or_plan_name\u003c/var\u003e\n\n| **Note:** For a list of all CTS console commands for Android 7 and higher, see [CTS v2 command console](/compatibility/cts/command-console-v2). For a list of all CTS console commands for Android 6 or lower, see [CTS v1 command console](/compatibility/cts/command_console).\n\nImprove test execution time\n---------------------------\n\nIf you want to improve test execution time, you can shard tests across multiple\ndevices. Sharding requires the host to connect at least two devices, but six or\nmore devices are recommended for efficiency.\n\nTo shard tests on Android 9 or 10, run: \n\n run cts --shard-count \u003cvar translate=\"no\"\u003enumber_of_shards\u003c/var\u003e\n\nTo shard tests on Android 8.1 or lower, run: \n\n run cts --shards \u003cvar translate=\"no\"\u003enumber_of_shards\u003c/var\u003e\n\nRun CTS for multiscreen devices\n-------------------------------\n\nIf your device is running Android 10, and your device has multiple\nscreens, you must run the `cts-foldable` test plan separately: \n\n run cts-foldable\n\nPassed or failed test cases for alternate screen mode are appended with the\nvalue from `display_mode`, for example, `testcase1[display_mode=0]`."]]