help命令的截图
Available commands and options
help:
show this message
这是我们现在使用的方式,主要是为显示帮助信息
help all:
show the complete tradefed help
显示更多的帮助信息
exit:
gracefully exit the cts console, waiting till all invocations are complete
退出终端
run cts --plan test_plan_name:
run a test plan
比如:
run cts –plan CTS
run cts --package/-p :
run a CTS test package
这是路一个包的测试:
比如:
run cts --package/-p android.app
run cts --class/-c [--method/-m] :
run a specific test class and/ormethod
这是测试类或方法的测试命令:
比如:
run cts –c android.app.cts.SystemFeaturesTest
run cts –c android.app.cts.SystemFeaturesTest -m testLiveWallpaperFeature
run cts --continue-session session_ID:
run all not executed tests from a previous CTS session
这个命令是指在以前的一个测试报道上继续跑未跑的测试项,这个命令非常有用,特别是我们跑完第一次,有的测试项因为各种原因没有跑,那我们可以在这个测试报告上接着继续跑。
我们先使用l r查看现在的测试报道情况,再使用下面的命令跑sessin id为2的测试报告:
run cts --continue-session 2
run cts [options] --serial/-s device_ID:
run CTS on specified device
这个是如果我们电脑同进有连接多台手机测试时,我们指定手机来跑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会比较均衡的分配到二台机器上,这个命令有用
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 i/invocations:
list invocations aka CTS test runs currentlyin progress
这个命令我测试,发现没有任何反应,让不要骗我,我书读的不多啊
l/list c/commands:
list commands: aka CTS test run commands currently in the queue waiting to be allocated devices
这个命令我测试,发现没有任何反应,让不要骗我,我书读的不多啊
l/list r/results:
list CTS results currently present in the repository
l r: 主要是查看当前CTS的测试结果
Add:
add derivedplan --plan plane_name --session/-s session_id -r [pass/fail/notExecuted/timeout]:
derive a plan from the given session
这个命令没有用过,但是从名字看,我们理解为添加一个plan的测试在给定的sesiion id上。
Dump:
d/dump l/logs:
dump the tradefed logs for all running invocations
d l:好像只是把终端的一些信息保存到/tmp/目录下,如下:
cts-tf > d l
Saved log to /tmp/tradefed_global_log_8844580533638460782.txt
--disable-reboot :
Do not reboot device after running some amount of tests.
这个没有用过,不过从名字看,是说不要重启机器
感觉这个没有什么特别要解释的:
cts-tf > run cts –help
‘cts’ configuration: Runs a CTS plan from a pre-existing CTS installation
Printing help for only the important options. To see help for all options, use the –help-all flag
cmd_options options:
–[no-]help display the help text for the most important/critical options. Default: false.
–[no-]help-all display the full help text for all options. Default: false.
–[no-]dry-run build but don’t actually run the command. Intended as a quick check to ensure that a command is runnable. Default: false.
–[no-]noisy-dry-run build but don’t actually run the command. This version prints the command to the console. Intended for cmdfile debugging. Default: false.
–[no-]loop keep running continuously. Default: false.
--plan the test plan to run.
-p, --package the test packages(s) to run.
-c, --class run a specific test class.
-m, --method run a specific test method, from given --class.
-t, --test run a specific test
--continue-session continue a previous test session.
--force-abi The abi to use, can be either 32 or 64.
这个命令应该是忽略abi的位数,直接测试
‘file’ logger options:
-l, –log-level-display
the minimum log level to display on stdout. Default: ERROR. Valid values: [VERBOSE, DEBUG, INFO, WARN, ERROR, ASSERT]
cts-tf > run cts –help-all
‘cts’ configuration: Runs a CTS plan from a pre-existing CTS installation
cmd_options options:
–[no-]help display the help text for the most important/critical options. Default: false.
–[no-]help-all display the full help text for all options. Default: false.
–[no-]json-help display the full help in json format. Default: false.
run cts –json-help
显示json 的格式
–[no-]dry-run build but don’t actually run the command. Intended as a quick check to ensure that a command is runnable. Default: false.
–[no-]noisy-dry-run build but don’t actually run the command. This version prints the command to the console. Intended for cmdfile debugging. Default: false.
–min-loop-time
the minimum invocation time in ms when in loop mode. Default: 600000.
–max-random-loop-time
the maximum time to wait between invocation attempts when in loop mode. when set, the actual value will be a random number between min-loop-time and this number.
--[no-]loop
keep running continuously. Default: false.
使测试持续进行
--[no-]all-devices
fork this command to run on all connected devices. Default: false.
使测试在所有连接的设备上同进进行测试
–[no-]bugreport-on-invocation-ended
take a bugreport when the test invocation has ended Default: false.
-s, --serial
run this test on a specific device with given serial number(s).
测试限定在对应serial的设备上进行
--exclude-serial
run this test on any device except those with this serial number(s).
测试排除在对应serial的设备的其它设备上进行
–product-type
run this test on device with this product type(s). May also filter by variant using product:variant.
–property
run this test on device with this property value. Expected format –property .
-e, –[no-]emulator
force this test to run on emulator. Default: false.
在模拟器上进行测试
-d, –[no-]device
force this test to run on a physical device, not an emulator. Default: false.
在物理设备上进行测试
–[no-]new-emulator
allocate a placeholder emulator. Should be used when config intends to launch an emulator Default: false.
-n, –[no-]null-device
do not allocate a device for this test. Default: false.
不分配设备进行测试
–min-battery
only run this test on a device whose battery level is at least the given amount. Scale: 0-100
设置测试的最少电池
–max-battery
only run this test on a device whose battery level is strictly less than the given amount. Scale: 0-100
设置测试的最大电池
–[no-]require-battery-check
If –min-battery and/or –max-battery is specified, skip devices that have an unknown battery level. Note that this may leave restart-looping devices in limbo indefinitely without manual intervention. Default: true.
如果设置了电池的最小最大值,不明电池电量的设置会被忽略,不进行测试
–min-sdk-level
Only run this test on devices that support this Android SDK/API level
–max-sdk-level
Only run this test on devices that are running this or lower Android SDK/API level
–[no-]enable-root
enable adb root on boot. Default: false.
可以使设备root
–[no-]disable-keyguard
attempt to disable keyguard once boot is complete. Default: true.
使设备不能锁屏
–disable-keyguard-cmd
shell command to disable keyguard. Default: input keyevent 82.
使设备不能锁屏
–[no-]enable-logcat
Enable background logcat capture when invocation is running. Default: true.
解发后台logcat
–max-tmp-logcat-file
The maximum size of tmp logcat data to retain, in bytes. Only used if –enable-logcat is set Default: 20971520.
设置最大的临时logcat数据比特数
–fastboot-timeout
time in ms to wait for a device to boot into fastboot. Default: 60000.
fastboot的超时时间
–adb-recovery-timeout
time in ms to wait for a device to boot into recovery. Default: 60000.
adb recovery的超时时间
–reboot-timeout
time in ms to wait for a device to reboot to full system. Default: 120000.
reboot的超时时间
–[no-]use-fastboot-erase
use fastboot erase instead of fastboot format to wipe partitions Default: false.
使用fastboot erase来替换fastboot format来wipe分区
–unencrypt-reboot-timeout
time in ms to wait for the device to format the filesystem and reboot after unencryption Default: 0.
解密reboot超时时间
–online-timeout
default time in ms to wait for the device to be visible on adb. Default: 60000.
设备被abd识别的超时时间
–available-timeout
default time in ms to wait for the device to be available aka fully boot. Default: 360000.
设备完全得到aka boot的超时时间
–ping-ip-or-host
default ip or host to ping during connectivity checks; [deprecated] use –ping-url instead. Default: www.google.com.
ping的地址
–conn-check-url
default URL to be used for connectivity checks. Default: http://www.google.com.
连接确认的地址
–wifi-attempts
default number of attempts to connect to wifi network. Default: 5.
连接wifi的数量
–wifi-retry-wait-time
the base wait time in ms between wifi connect retries. The actual wait time would be a multiple of this value. Default: 60000.
wifi重新连接的时间
–post-boot-command
shell command to run after reboots during invocation
重启机器后执行shell 命令
–cutoff-battery
the minimum battery level required to continue the invocation. Scale: 0-100
设备执行测试的最少电池电量
–log-file-path
root file system path to store log files. Default: /tmp.
保存root文件系统log文件的路径
–log-file-url
root http url of log files. Assumes files placed in log-file-path are visible via this url.
保存log的地址
–log-retention-days the number of days to keep saved log files.
log保存的日期天数
–[no-]compress-files
whether to compress files which are not already compressed Default: true.
是否压缩文件
–cts-install-path
the path to the cts installation to use Default: ./../…
安装cts的路径
–device-wait-time
maximum time in ms to wait for a single device recovery command. Default: 240000.
单个设备恢复命令的等待时间
–bootloader-wait-time
maximum time in ms to wait for device to be in fastboot. Default: 30000.
等待设备fastboot的时间
–shell-wait-time
maximum time in ms to wait for device shell to be responsive. Default: 30000.
shell 命令响应时间
–fastboot-wait-time
maximum time in ms to wait for a fastboot command result. Default: 30000.
fastboot 命令执行时间
–min-battery-after-recovery
require a min battery level after successful recovery, default to 0 for ignoring. Default: 0.
成功revovery后最少的电池电量
–[no-]disable-unresponsive-reboot
If this is set, we will not attempt to reboot an unresponsive devicethat is in userspace. Note that this will have no effect if the device is in fastboot or is expected to be in fastboot. Default: false.
禁止重启一个没有反应的设备
##’device-precondition-preparer’ target_preparer options:—设备前期准备的选项
--[no-]skip-preconditions
Whether to skip precondition checks and automation Default: false.
这个命令有用,是直接跳过前期的检查工作,直接强制运行相关的测试。特别是android 6.0后,CTS测试如果不加这个,会进行前期的wifi,网络,视频,location等等的检查。
--[no-]skip-preconditions
Whether to skip precondition checks and automation Default: false.
这个和上面的一样,也是跳过前期的检查
–wifi-ssid
Name of the WiFi network with which to connect
连接那个wifi
–wifi-psk
The WPA-PSK associated with option ‘wifi-ssid’
WPA-PSK连接wifi-ssid
--[no-]skip-media-download
Whether to skip verifying/downloading media files Default: false.
是否忽略检查和下载视频
–local-media-path
Absolute path of the media files directory on the host, containing’bbb_short’ and ‘bbb_full’ directories
本地视频的路径
--plan the test plan to run.
-p, --package the test packages(s) to run.
--exclude-package the test packages(s) to exclude from the run.
-c, --class run a specific test class.
-m, --method run a specific test method, from given --class.
-t, --test run a specific test
--continue-session continue a previous test session.
-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
–[no-]resume
flag to attempt to automatically resume aborted test run on another connected device. Default: false.
自动在另外一个连接的设备上启动一个已经停止的测试
--shards
shard the tests to run into separately runnable chunks to execute on multiple devices concurrently. Default: 1.
同时在几台设备上跑一个测试
–[no-]screenshot
flag for taking a screenshot of the device when test execution is complete. Default: false.
测试结束时截屏
-b, –[no-]bugreport
take a bugreport after each failed test. Warning: can potentially use a lot of disk space. Default: false.
没有用过,也看不懂
-k, –[no-]run-known-failures
run tests including known failures Default: false.
跑一些已经知道的failures测试项
--[no-]disable-reboot
Do not reboot device after running some amount of tests. Default behavior is to reboot. Default: false.
禁止重启机器
–reboot-wait-time
Additional wait time in ms after boot complete. Default: 120000.
reboot等待时间
–reboot-interval
Interval between each reboot in min. Default: 30.
reboot interval时间
–[no-]screenshot-on-failure
take a screenshot on every test failure. Default: false.
在每个测试失败时,截屏
–[no-]logcat-on-failure
take a logcat snapshot on every test failure. Unlike –bugreport, this can capturelogs even if connection with device has been lost, as well as being much more performant. Default: false.
在每个测试失败的时提取logcat
--force-abi
The abi to use, can be either 32 or 64.
强制忽略abi类型,直接使用
–logcat-on-failure-size
The max number of logcat data in bytes to capture when –logcat-on-failure is on. Should be an amount that can comfortably fit in memory. Default: 512000.
logcat on failure的字节数
–[no-]collect-deqp-logs
Collect dEQP logs from the device. Default: false.
提取dEQP log
–include Positive filters to pass to tests.
–exclude Negative filters to pass to tests.
–min-pre-reboot-package-count
The minimum number of packages to require a pre test reboot Default: 2.
收集以前的测试reboot的最小包数
–log-level
the minimum log level to log. Default: DEBUG. Valid values: [VERBOSE, DEBUG, INFO, WARN, ERROR, ASSERT]
log 的level
-l, –log-level-display
the minimum log level to display on stdout. Default: ERROR. Valid values: [VERBOSE, DEBUG, INFO, WARN, ERROR, ASSERT]
最小log level
–log-tag-display
Always display given tags logs on stdout
显示特定tag的log
–max-log-size
maximum allowable size of tmp log data in mB. Default: 20.
log的最大大小
–[no-]quiet-output
Mute display of test results. Default: false.
放弃输出报道
–output-file-path
root file system path to directory to store xml test results and associated logs. If not specified, results will be stored at /repository/results
自定义报道和log的输出位置
--plan
the test plan to run. Default: NA.
测试plan
--continue-session
the test result session to continue.
测试结果的session,以便接着跑
–result-server
Server to publish test results.
放置测试结果到服务器上
–[no-]include-test-log-tags
Include test log tags in XML report. Default: false.
在xml报道中包含tags的log信息
–[no-]use-log-saver
Also saves generated result XML with log saver Default: false.
user log的saver
result_reporter options: —–结果报告的选项
–[no-]quiet-output
Mute display of test results. Default: false.
放弃输出报道
result_reporter options:
–issue-server
Server url to post test failures to.
旋转测试失败项的服务器地址