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

android GMS认证之CTS 常用命令

2016-04-07 12:19 543 查看


前面的一篇文章<<CTS测试命令详细>>全面的讲解了几乎所有的CTS命令的使用,其实我们平时用的就是一些常用的几条命令而已。

这篇文章我列了一下常用的CTS命令,可以不夸张的说,只要你掌握了下面的这些命令的使用,CTS的命令使用,你完全可以是得心应手。我没有骗你们噢。

CTS v1 (Android 6.0 and earlier),

help

查看帮忙信息

exit:

退出终端

run cts –plan test_plan_name:

进行plan为test_plan_name的测试,这个命令我们用的非常多

比如:

run cts –plan CTS


run cts –package/-p :

这是一个包的测试:

比如:

run cts --package/-p android.app


run cts –class/-c [–method/-m] :

这是测试类或方法的测试命令,我们单独跑fail项时非常的有用

比如:

run cts –c android.app.cts.SystemFeaturesTest
run cts –c android.app.cts.SystemFeaturesTest -m testLiveWallpaperFeature


run cts –continue-session session_ID:

这个命令是指在以前的一个测试报道上继续跑未跑的测试项,这个命令非常有用,特别是我们跑完第一次,有的测试项因为各种原因没有跑,那我们可以在这个测试报告上接着继续跑。

我们先使用l r查看现在的测试报道情况,再使用下面的命令跑sessin id为2的测试报告:

run cts --continue-session 2


run cts [options] –serial/-s device_ID:

run CTS on specified device

这个是如果我们电脑同进有连接多台手机测试时,我们指定手机的serial id来跑CTS

run cts –plan CTS –s 0123456789ABCDEF


run cts [options] –shards number_of_shards:

shard a CTS run into given number of independent chunks, to run on multiple devices inparallel

在几台手机上同时跑CTS,CTS会比较均衡的分配到多台机器上,这个命令非常有用,特别是现在进行一次CTS测试的时间要20多个小时,我们可以用多台手机来同时测试,减少测试时间。其本质是以机器数量换测试时间。

run cts –plan CTS –shards 5


run cts –help/–help-all:

get more help on running CTS

查看跑CTS更多的命令

l/list d/devices:

list connected devices and their state

l d


查看当前设备以及他们的状态,显示他们的Serial,电量,等等信息

l/list packages:

list CTS test packages

l packages


查看当前的CTS测试的包

l/list p/plans:

list CTS test plans

l p:

查看CTS的plan信息,这个plan信息是在android-cts/repository/plans目录下

l/list r/results:

list CTS results currently present in the repository

l r


主要是查看当前CTS的测试结果

–[no-]all-devices

fork this command to run on all connected devices. Default: false.

使测试在所有连接的设备上同进进行测试

比如:

run cts –plan cts –all-devices


–[no-]skip-preconditions

Whether to skip precondition checks and automation Default: false.

这个命令有用,是直接跳过前期的检查工作,直接强制运行相关的测试。特别是android 6.0后,CTS测试如果不加这个,会进行前期的wifi,网络,视频,location等等的检查。

比如:

run cts –plan CTS –skip-preconditions


–[no-]skip-media-download

Whether to skip verifying/downloading media files Default: false.

是否忽略检查和下载视频

比如:

run cts –plan CTS –skip-media-download


-d, –[no-]skip-device-info

flag to control whether to collect info from device. Providing this flag will speed up test execution for short test runs but will result in required data being omitted from the test report. Default: false.

不收集设备信息,加快测试速度

例如:

run cts -c android.hardware.cts.SensorBatchingTests --skip-preconditions –d


–disable-reboot :

Do not reboot device after running some amount of tests.

不要重启机器,直接测试

例如:

run cts -c android.hardware.cts.SensorBatchingTests --skip-preconditions –d –disable-reboot


–force-abi 32|64

–force-abi 32|64

On 64-bit devices, run the test against only the 32-bit or 64-bit ABI

这个命令非常有用,特别是对于64bit的手机,如果我们只跑run cts –plan CTS,会跑二次(32bit的abi和64bit的abi),严重浪费时间。

run cts --plan CTS --force-abi 64


CTS v2 (Android 7.0 and later),

help

Display a summary of the most commonly used commands

help all

Display the complete list of available commands

version

Show the version.

exit

Gracefully exit the CTS console. Console will close when all currently running tests are finished.

run cts –help/–help-all:

get more help on running CTS

查看跑CTS更多的命令

run cts

Run the default CTS plan (that is, the full CTS invocation).

run cts --plan CTS


–plan

Run the specified test plan.

run cts --plan CTS


–module/-m [–module/-m …]

Run the specified test module or modules.

run cts -m Gesture
run cts -m Gesture -t android.gesture.cts.GestureTest#testGetStrokes


–subplan

Run the specified subplan.

– module/-m – test

Run the specified module and test.

run cts -m Gesture --test android.gesture.cts.GestureTest#testGetStrokes


–retry

Retry all tests that failed or were not executed from the previous sessions. Use list results to get the session id.

run cts -r 0


–shards

Shard a CTS run into given number of independent chunks, to run on multiple devices in parallel.

–serial/-s

Run CTS on the specific device.

–include-filter

[–include-filter …] Run only with the specified modules.

–exclude-filter

[–exclude-filter …] Exclude the specified modules from the run.

–abi

Force the test to run on the given ABI, 32 or 64. By default CTS runs a test once for each ABI the device supports.

–skip-device-info

Skips collection of information about the device. Note: do not use this option when running CTS for approval.

run cts --plan CTS -d


–skip-preconditions

Bypasses verification and setup of the device’s configuration, such as pushing media files or checking for Wi-Fi connection.

run cts --plan CTS -o


参考资料:

1.Running CTS tests

https://source.android.com/compatibility/cts/run
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android GMS CTS