您的位置:首页 > 移动开发 > Android开发

Android N(7.0)CTS测试注意事项

2017-03-26 01:21 531 查看
一、PC端CTS测试的相关命令:

Compatibility Test Suite

CTS is the test harness for running the

Android Compatibility Suite, built on top of Trade Federation.

Available commands and options

Host:

  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 <plan> --module/-m <module>: run a test module.(单独运行某个模块) 

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

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

  run <plan> --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 <abi>
: The ABI to run the test against.

  --shards <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 <status>
: Which results to include in the subplan. One of passed, failed, not_executed. Repeatable.

run cts -c android.telephony.cts.MmsTest -m testSendMmsMessage --skip-preconditions --disable-reboot   //测试单项时跳过检查预置条件和不重启手机

CTS测试时如果遇到有蓝牙等测试项一直测试不通过,可以尝试安装TxEddystone-UID-release-1.0.01 后再测试。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: