1. 下载cts工具

https://source.android.com/compatibility/cts/downloads

或者make cts,

out/host/linux-x86/cts, cts-verifier

 

2. Setting up

https://source.android.com/compatibility/cts/setup

Wi-Fi and IPv6

CTS tests require a Wi-Fi network that supports IPv6, can treat the DUT as an isolated client, and has an internet connection.

ADB and AAPT

export PATH=$PATH:$HOME/android-sdk-linux/build-tools/version

  put in .bashrc, run "source .bashrc"

  or put in /etc/profile run "source /etc/profile"

 

Java Development Kit

Install the proper version of the Java Development Kit (JDK). For Android 7.0 and higher:

  • On Ubuntu, use OpenJDK 8

CTS files

Download and open the latest version of the CTS media files.

 

User builds

First API level for Android 9 and higher

For devices launched with Android 9 or higher, set the ro.product.first_api_level property to a valid value found on Codenames, Tags, and Build Numbers.

Android device configuration

  1. Factory data reset the device: Settings > Backup & reset > Factory data reset
  2. Set your device's language to English (United States): Settings > Language & input > Language
  3. Turn on the location setting if there's a GPS or Wi-Fi/cellular network feature on the device: Settings > Location > On
  4. Connect to a Wi-Fi network that supports IPv6, can treat the DUT as an isolated client (see Physical Environment above), and has an internet connection: Settings > Wi-Fi
  5. Make sure that no lock pattern or password is set on the device: Settings > Security > Screen lock > None
  6. Enable USB debugging on your device: Settings > Developer options > USB debugging

    Note: On Android 4.2 and higher, Developer options is hidden by default. To make it available, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options. See Enabling On-device Developer Options for additional details.

  7. Set the time to 12-hour format: Settings > Date & time > Use 24-hour format > Off
  8. Set the device to stay awake: Settings > Developer options > Stay Awake > On
  9. In Android 5.x and 4.4.x only, set the device to allow mock locations: Settings > Developer options > Allow mock locations > On
  10. In Android 4.2 and higher, turn off USB app verification: Settings > Developer options > Verify apps over USB > Off
  11. Launch the browser and dismiss any startup/setup screen.

Running CTS tests

https://source.android.com/compatibility/cts/run

./android-cts/tools/cts-tradefed

.verison

.help

.help run

.run cts --module/-m

.run cts --module/-m --test/-t

test name can package/class/class#function or native binary name

 

logs and results are under android-cts

 

https://ressrc.com/2018/03/27/android-gms%E8%AE%A4%E8%AF%81-cts-gts-ctsv/

3)CTS Verifier测试相关

1、测试准备

        1、根目录下安装CtsVerifier.apk、NotificationBot.apk

            adb install -r CtsVerifier.apk         

            adb install -r  NotificationBot.apk

        2、设置里security-Device administrators开启cts verifier

        3、打开手机上的CTS Verifier应用,根据提示测试每一项

2、保存查看结果

        所有测试完成后,点击CTS Verifier测试工具右上角的保存按钮,会提示结果保存位置,连接电脑,将结果拷贝到电脑即可查看。

 

更多相关文章

  1. android studio中AndroidJUnit4单元测试注解错误和recyclerview-
  2. 一个测试ok的popupwindow demo
  3. android截图代码
  4. Android(安卓)屏幕截图 代码
  5. Android(安卓)子线程测试
  6. android之纵横屏幕切换时保存数据
  7. android创建数据库(SQLite)保存图片示例
  8. Android(安卓)view 转化为Bitmap并保存在本地
  9. android中dialog工具类的实现(多种dialog的创建)

随机推荐

  1. 项目总结
  2. Android基础和运行机制
  3. android usb主从设备模式解析,网络连接调
  4. Android ADB安装和卸载或删除Android设备
  5. Android应用程序及其主要结构
  6. android 程序工程架构
  7. Android 客户端访问服务器以及服务器开发
  8. android java开发 第二天 之熟悉 程序开
  9. Android(安卓)中的依赖注入框架
  10. Android中的消息机制(Handler)