-
运行CTS:
-
Launch the CTS console by running the cts-tradefed script from the folder where the CTS package has been unzipped, e.g. $ ./android-cts/tools/cts-tradefed
-
You may start the default test plan (containing all of the test packages) by appending: run cts –plan CTS This will kick off all the CTS tests required for compatibility. Enter list plans to see a list of test plans in the repository. Enter list packages to see a list of test packages in the repository. See the CTS command reference or type help for a complete list of supported commands.
-
Alternately, you may run the CTS plan of your choosing from the command line using: cts-tradefed run cts –plan
-
View test progress and results reported on the console.
-
If your device is Android 5.0 or later and declares support for an ARM and a x86 ABI, you should run both the ARM and x86 CTS packages.
-
The following test plans are available:
-
CTS—all tests required for compatibility.
-
Signature—the signature verification of all public APIs
-
Android—tests for the Android APIs
-
Java—tests for the Java core library
-
VM—tests for ART or Dalvik
-
Performance—performance tests for your implementation
-
中断后重新启动测试:
-
l r 查看上次运行情况,获知 sessionID 号
-
run cts –continue-session sessionID –disable-reboot继续运行上次的cts项 ,sessionID = 0, 1 ,2 。。。。。。
-
对整体测试完成后,单独测试fail项的一种简单方法:
1) .整体测试完成,生成result report 等xml文件 ,通过l r 查看session ID号,2) .编辑result report 中的xml文件,把其中的fail项全部替换成not executed 项,3) .使用run cts –continue-session session_ID 重新执行之前的fail项,得到新的result report xml
-
cts fail项处理
每次测试完一个CTS ID后,都会产生一个目录,里面有测试log及测试result report 的xml文件.通过xml文件及log信息里面的错误信息,找到对应的cts 测试安排款源码,分析定位问题cts fail项 log 关键字查找TestRunner: started:TestRunner: finishedTestRunner: passedTestRunner: failed
-
注意事项:
-
Connect at least one device.
-
Press the home button to set the device to the home screen at the start of CTS.
-
While a device is running tests, it must not be used for any other tasks and must be kept in a stationary position (to avoid triggering sensor activity) with the cameras pointing at an object that could be focused.
-
Do not press any keys on the device while the CTS is running. Pressing keys or touching the screen of a test device will interfere with the running tests and may lead to test failures.
-
如果设备不支持USB Debug等,只能通过网络方式,那么运行的时候,需要加上 —disable-reboot,例如run cts —plan CTS —disable-reboot
另外,Android设备端,运行setprop sys.usb.config adb