Android CTS 测试总结

本文介绍如何通过两种方式获取Android兼容性测试套件(CTS),并详细阐述了CTS的使用流程,包括设备配置步骤、运行测试的方法及查看结果的方式。此外,还提供了针对特定测试案例的执行指令。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

获取cts工具有两种方法:

1、直接下载,CTS下载地址:

http://source.android.com/compatibility/downloads.html

2、android工程中有cts目录,可以自己编译cts工具。

3、工作流程:

摘录自:http://source.android.com/compatibility/cts-intro.html

Workflow

@1 Download the CTS.

@2 Attach at least one device (or emulator) to your machine.

@3 For CTS 2.1 R2 and beyond, setup your device (or emulator) to run the accessibility tests:

#1 adb install -r android-cts/repository/testcases/CtsDelegatingAccessibilityService.apk

#2 On the device, enable Settings > Accessibility > Accessibility > Delegating Accessibility Service

@4 Launch the CTS. The CTS test harness loads the test plan onto the attached devices. For each test in the test harness:

The test harness pushes a .apk file to each device, executes the test through instrumentation, and records test results. The test harness removes the .apk file from each device.

@5 Once all the tests are executed, you can view the test results in your browser and use the results to adjust your design. You can continue to run the CTS throughout your development process.

When you are ready, you can submit the report generated by the CTS to cts@android.com. The report is a .zip archived file that contains XML results and supplemental information such as screen captures.

主机端需要完成的工作:

$ cd $work_dir$ unzip android-cts.zip

$ cp -a /release/android/tools/android-sdk-linux_86/ .

$ export SDK_ROOT=$work_dir/android-sdk-linux_86/

$ export PATH=$PATH:$work_dir/android-sdk-linux_86/bin

$ adb install -r android-cts/repository/testcases/CtsDelegatingAccessibilityService.apk

#### On the device, enable Settings > Accessibility > Accessibility > Delegating Accessibility Service

$ vi android-cts/repository/host_config.xml

#### 修改 <IntValue name="maxTestCount" value="200" /> to <IntValue name="maxTestCount" value="0" />

$ cd android-cts/tools

$ ./startcts

Android CTS version 2.2_r3 Device(4C5499EE119E) connected

cts_host > start --plan CTS

客户端要完成的工作(例子只是参考,根据实际情况设置):

  • 设置好Wifi
  • 设置语言为英文
  • 设置好google account
  • 确保SDCard正常mount
  • 调整好time zone,以及date的format,12小时格式
  • Screen lock unchecked
  • Screen Timeout -> 30 Minutes
  • Insert SIM Card
  • Check "Stay Awake", "Allow mock locations" and "USB Debugging" from Settings/Application/Development ‍
  • Download TTS files: Settings/Voice Input & Output/Text-to-speech settings/Install voice data

    如果要单独测试一个case,需要写全测试用例名称:

    格式如下:

    java_package_name.class_name#method_name

    例:

    start --plan CTS -t android.net.cts.ConnectivityManagerTest#testStartUsingNetworkFeature

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值