Android CTS 测试

  CTS 全称(Compatibility Test Suite),兼容性测试工具,GTS全称Google Mobile Services Test Suite,主要用来测试google服务。这里我记录一下自己工作中的经验。
在做CTS之前,要先做到下面几条。

  • 手机手机安全要打开,不要锁定屏幕:设置->安全->屏幕锁定方式-> 设置为“无”
  • 手机不能休眠:
    • 设置->开发人员选项-> 不锁定屏幕 -> 设置为“充电时屏幕不会休眠”
    • USB调试 -> enable
    • 允许模拟位置-> enable
1.Android 7.0 CTS需要注意的地方
  • 1.JDK版本:JDK版本版本要使用jdk1.8,要不然运行CTS会提示,JDK版本过低。
  • 2.使用步骤
    • (1) 下载地址,这是google官方下载地址,里面包含各个版本的CTS包。
    • (2) 下载aapt可执行程序,并将aapt路径加入到环境变量PATH中。
    • (3)在CTS包中运行cts-tradefed可执行程序。
      这里写图片描述

Android Compatibility Test Suite 7.0_r9 (3943095)
cts-tf > help
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.
  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.
  --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.
  --logcat-on-failure: Capture logcat when a test fails.
  --bugreport-on-failure: Capture a bugreport when a test fails.
  --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
Add:
  a/add s/subplan: create a subplan from a previous session
Options:
  --session <session_id>: The session used to create a subplan.
  --name/-n <subplan_name>: The name of the new subplan.
  --result-type <status>: Which results to include in the subplan. One of passed, failed, not_executed. Repeatable.

cts-tf >
  • 3执行命令

    run cts -m CtsCameraTestCases -t android.hardware.cts.CameraGLTest#testCameraToSurfaceTextureMetadata --skip-preconditions

    “-m” :意思就是我们要测试的模块
    “-t”:意思就是我们的测试的类
    “#后面的方法”:我们要测试类中的方法。
    如果要想执行某一个模块的测试项,直接用-m参数,其它参数就不需要了。如果想测试某一个类的话,需要加上-m 和-t的参数了。

后面其它版本的CTS等有机会用到,在来这里补充吧。

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值