android GMS认证之CTS 常用命令

http://blog.csdn.net/hfreeman2008/article/details/51084821


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

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

help

查看帮忙信息

exit:

退出终端

run cts –plan test_plan_name:

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

run cts –plan CTS
  • 1
  • 1

run cts –package/-p :

这是一个包的测试: 
比如:

run cts --package/-p android.app
  • 1
  • 1

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

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

run cts –c android.app.cts.SystemFeaturesTest
run cts –c android.app.cts.SystemFeaturesTest -m testLiveWallpaperFeature
  • 1
  • 2
  • 1
  • 2

run cts –continue-session session_ID:

这个命令是指在以前的一个测试报道上继续跑未跑的测试项,这个命令非常有用,特别是我们跑完第一次,有的测试项因为各种原因没有跑,那我们可以在这个测试报告上接着继续跑。 
我们先使用l r查看现在的测试报道情况,再使用下面的命令跑sessin id为2的测试报告:

run cts --continue-session 2
  • 1
  • 1

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

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

run cts –plan CTS –s 0123456789ABCDEF
  • 1
  • 1

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
  • 1
  • 1

run cts –help/–help-all:

get more help on running CTS 
查看跑CTS更多的命令

l/list d/devices:

list connected devices and their state

l d
  • 1
  • 1

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

l/list packages:

list CTS test packages

l packages
  • 1
  • 1

查看当前的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
  • 1
  • 1

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

–[no-]all-devices

fork this command to run on all connected devices. Default: false. 
使测试在所有连接的设备上同进进行测试 
比如:

run cts –plan cts –all-devices
  • 1
  • 1

–[no-]skip-preconditions

Whether to skip precondition checks and automation Default: false. 
这个命令有用,是直接跳过前期的检查工作,直接强制运行相关的测试。特别是android 6.0后,CTS测试如果不加这个,会进行前期的wifi,网络,视频,location等等的检查。 
比如:

run cts –plan CTS –skip-preconditions
  • 1
  • 1

–[no-]skip-media-download

Whether to skip verifying/downloading media files Default: false. 
是否忽略检查和下载视频 
比如:

run cts –plan CTS –skip-media-download
  • 1
  • 1

-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
  • 1
  • 1

–disable-reboot :

Do not reboot device after running some amount of tests. 
不要重启机器,直接测试 
例如:

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

–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

猜你喜欢

转载自blog.csdn.net/thinkinwm/article/details/67633296