This page contains instructions for running CTS automated tests on Android 10 or lower.
Run a retry session
If this is your first test run, there might be tests that fail due to issues beyond your control. For example, a network connection might be slow or a GPS signal might be weak. So, rerun (retry) the tests until all test modules are completed and the test failure numbers are the same in the last two retry sessions. To run a retry session for Android 9 and 10:
run retry --retry session_number`
To run a retry session for Android 8.1 or lower:
run cts --retry session_number
Run a retry session on failed parameterized tests
Passed parameterized tests aren't retried. To run a retry session on failed parameterized tests only:
run retry --retry session_number --new-parameterized-handling
Run individual test plans
Instead of running all test plans at once, you can run individual test plans. To run an individual test plan:
Identify the name of the test plan you want to run.
For Android 7 and higher:
list modules
For Android 6 or lower:
list plans
Run the test plan:
run cts --plan test_module_or_plan_name
Improve test execution time
If you want to improve test execution time, you can shard tests across multiple devices. Sharding requires the host to connect at least two devices, but six or more devices are recommended for efficiency.
To shard tests on Android 9 or 10, run:
run cts --shard-count number_of_shards
To shard tests on Android 8.1 or lower, run:
run cts --shards number_of_shards
Run CTS for multiscreen devices
If your device is running Android 10, and your device has multiple
screens, you must run the cts-foldable
test plan separately:
run cts-foldable
Passed or failed test cases for alternate screen mode are appended with the
value from display_mode
, for example, testcase1[display_mode=0]
.