Android 7.0 cts gts Command - flymobile/CTS GitHub Wiki

Android 7.1 cts Command


help: show this message.(进入./cts-tradefed后输入help即可以查看以下全部命令)

  • help all: show the complete tradefed help.

  • version: show the version.

  • exit: gracefully exit the compatibiltiy console, waiting until all invocations have completed.

Run:

  • run --module/-m : run a test module.(单独运行某个模块)

  • run --module/-m --test/-t <test_name>: run a specific test from the module. Test name can be ., .# or <native_name>.(运行一个特定的测试模块)

  • run --retry <session_id>: run all failed tests from a previous session.(测试上一个结果的所有失败项)

  • run --help/--help-all: get help for Compatibility Test Suite.

Options:

  • --serial/-s <device_id>: The device to run the test on.(当pc端插入多台设备时,可以指定在某个设备上运行测试,device_id指的是设备号)

  • --abi/-a : The ABI to run the test against.

  • --shards : Shards a run into the given number of independent chunks, to run on multiple devices in parallel.(此命令可以将测试包分为多部分,然后在多台设备上进行测试。比如我在pc端插入两台设备,则可以在进入./cts-tradefed后输入: run cts --plan CTS --shards 2 命令)

  • --logcat-on-failure: Capture logcat when a test fails.(抓取测试失败时的logcat)

  • --bugreport-on-failure: Capture a bugreport when a test fails.(抓取测试失败时的bugreport)

  • --screenshot-on-failure: Capture a screenshot when a test fails.(对测试时的失败项进行截屏)

List:

  • l/list d/devices: list connected devices and their state(列出所连接的设备和状态)

  • l/list m/modules: list test modules (列出测试模块)

  • l/list i/invocations: list invocations aka test runs currently in progress(列出正在运行的设备,及其所调用测试模块)

  • l/list c/commands: list commands aka test run commands currently in the queue waiting to be allocated devices(列出正在等待分配任务的设备)

  • l/list r/results: list results currently in the repository(列出已经产生的结果)

Dump:

  • d/dump l/logs: dump the tradefed logs for all running invocations 转储所有正在运行的调用的tradefed日志

Add:

  • a/add s/subplan: create a subplan from a previous session

Options:

  • --session/-s <session_id>: The session used to create a subplan. 从上一个会话创建子计划

  • --name/-n <subplan_name>: The name of the new subplan. 新子计划的名称.

  • --result-type/-r : Which results to include in the subplan. One of passed, failed, not_executed. Repeatable.


* 运行CTS 命令如下

run cts -s DEVICE_ID

注: andoird 6.0 以下为

run cts --plan CTS -s DEVICE_ID

* 测试某一条用例

例:screen

run cts -m android.media -t android.media.cts.EncodeVirtualDisplayWithCompositionTest#testRendering800x480Locally

注: andoird 6.0 以下为

run cts -c android.media.cts.EncodeVirtualDisplayWithCompositionTest#testRendering800x480Locally

* 测试FAIL

run cts --retry <session_id> -s DEVICE_ID

注: andoird 6.0 以下为

1. 对所有Fail添加为一个plan

命令: add derivedplan --plan PLANNAME -s <session_id> -r [fail/pass/...]

2.再执行生成的PLAN

命令:run cts --plan PLANNAME -s DEVICE_ID

⚠️ **GitHub.com Fallback** ⚠️