CTS认证是获得Google推出的Android系统中Android Market服务的前提

CTS兼容性测试的主要目的和意义在于使得用户在Android系统的应用过程中,有更好的用户体验,并展现出Android系统的优越特性;使得Android应用程序编写者更容易编写高质量的应用程序;充分展现Android Market的优势,让获得CTS认证的终端得到Android Market的使用许可。
运行CTS测试需要做的准备工作有有:

1.下载完整的cts测试工具包,方式有两种:

    a.在现有代码上编译,代码版本与目标机器版本一致;
 

2.下载media测试内容,还是上边的官网,在网页最下边:

CTS Media Files

These media files are required for the CTS media stress tests.
CTS Media .

3.连接手机与电脑(至少一台手机)

4.测试前准备

android-cts/repository/testcases中的CtsDelegatingAccessibilityService.apk和CtsDeviceAdmin.apk
安装完成以上apk后,在手机端操作:
a.设置->辅助程序->Delegating Accessibility Service,打开;
b.设置->安全->设备管理器->CTS相关的两个选项都激活;
c.打开USB调试模式;
d.保持屏幕唤醒;
e.允许模仿位置;
f.切换至英文模式US。
 

5.进入cts控制台

执行android-cts/tools/cts-tradefed

dev@linux-dev:~/android/CTS/android-cts/tools$
./cts-tradefed
-::
I/: Detectednew device c8090fe4
-::
I/: Detectednew device
5348300e
Android CTS .2_r1
我现在连接着两台设备,都检测到了。
 

6.开始进行CTS测试

首先,在控制台中输入help看这个控制台都能干什么。

cts-tf > help
CTS-tradefed host version .2_r1
 
CTS-tradefed is the test harness
for running the Android Compatibility Suite, built on top of the tradefed framework.
 
Available commands and options
Host:
  help: show this message
  help all: show the complete tradefed help
  exit: gracefully exit the cts console, waiting till all invocations are complete
Run:
  run cts --plan test_plan_name: run a test plan
  run cts --package/-p: run a CTS test package
  run cts --class/-c [--method/-m]:
run a specific test class and/ormethod
  run cts --continue-session session_ID: run all not executed tests from a previous CTS session
  run cts [options] --serial/s device_ID: run CTS on specified device
  run cts [options] --shards number_of_shards: shard a CTS run into given number of independent chunks, to run on multiple devices inparallel
  run cts --help/--help-all: get more help on running CTS
List:
  l/list d/devices: list connected devices and their state
  l/list packages: list CTS test packages
  l/list p/plans: list CTS test 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
Add:
  add derivedplan --plan plane_name
--session/-s session_id-r [pass/fail/notExecuted/timeout]:
derive a plan from the given session
Dump:
  d/dump l/logs: dump the tradefed logsfor all running invocations
Options:
  --disable-reboot: Do not reboot device after running some amount of tests.
run cts --plan + <plan name> 运行某个plan,查看当前支持的plan,运行l p,实际上所有的plan存放在android-cts/repository/plans;
run cts --package/-p 运行某一个测试包;
run cts --class/-c [--method/-m] 运行某一个测试类或测试方法;
run cts --continue-session session_ID 继续运行之前没有完成的CTS测试,要知道它的session_ID;
run cts [options] --serial/s device_ID 在某个串号的设备上进行CTS测试,对应多个机器的时候,通过adb devices能够查看当前连接的所有设备的串号;
run cts [options] --shards number_of_shards 在多个设备上同时运行CTS测试,如run cts --plan CTS --shards 2,在两个设备上同时运行;
run cts --help/--help-all 展示更多帮助
 
查看列表:
查看行为是l/list,接不同的参数显示对应信息。
d/devices 当前连接的设备,效果同adb devices,不过信息更详细,还有设备电量信息;
packages 当前CTS plan的所有测试包;
p/plan 当前所支持的CTS plan有哪些;
i/invocations 当前CTS的运行状态;
c/commands 展示出用户输入过的命令;
r/results 展示以往的测试结果

Session  Pass   Fail  Not Executed  Start time           Plan name  Device serial(s) 
                         ..24_18..  CTS        c8090fe4                
                           ..04_17..  CTS        FUSC85YLYPAMRC69
 

需要特别关注的几点注意事项:

  • 首先,手机的功能一定要完整,WIFI BT 3G CAMERA等;
  • 手机要切换至英文语言;
  • 连接到可用WIFI;
  • 有SIM卡,并能够打电话发短信;
  • 对于屏幕密度,目前CTS中最高支持320,但实际上Google已经添加了对480,也就是1080p的支持;
  • 会检测Fingerprint,注意厂家名;
  • 要保证能够访问到www.google.com
 
实战演戏:

连接两台手机后,进入cts控制台:
run cts --plan CTS --shards 2

两台手机上会同时跑起CTS测试,大概5小时候测试完成,生成测试报告,保存在results下。
转自:http://blog.csdn.net/airk000/article/details/11113391
其他相关资源:
http://www.cnblogs.com/yyangblog/archive/2011/02/16/1955665.html

android CTS测试的更多相关文章

  1. 监听Android CTS测试项解决方案(一)

    前言: 首先这里需要详细叙述一下标题中"监听Android CTS测试项解决方案"的需求.这里的需求是指我们需要精确的监听到当前CTS测试正在测试的测试项. 因为我们知道CTS认证 ...

  2. 监听Android CTS测试项解决方案(二)

    二,监听当前测试项是否是Accelerometer Measurement Test测试项 通过第一种方式介绍的,我们可以得到当前处于活动状态的Activity类似监听CTS测试当前的测试项.但是由于 ...

  3. 【转】Android CTS 测试

    http://blog.csdn.net/zxm317122667/article/details/8508013 Android-CTS 4.0.3测试基本配置 1. Download CTS CT ...

  4. Android 4.0.3 CTS 测试

    Android-CTS 4.0.3测试基本配置 1. Download CTS CTS的获取方式有两种: 1.1.由Google提供 1.1.1.打开浏览器输入连接: http://source.an ...

  5. android 兼容性测试 CTS 测试过程(实践测试验证通过)

    source: http://blog.csdn.net/jianguo_liao19840726/article/details/7222814 写这个博客的时候是为了记忆,建议大家还是看官方的说明 ...

  6. 【转】android 兼容性测试 CTS 测试过程(实践测试验证通过)

    原文网址:http://blog.csdn.net/jianguo_liao19840726/article/details/7222814 写这个博客的时候是为了记忆,建议大家还是看官方的说明,官方 ...

  7. 【转】Android 4.0.3 CTS 测试

    原文网址:http://blog.csdn.net/zxm317122667/article/details/8508013 Android-CTS 4.0.3测试基本配置 1. Download C ...

  8. 【转】Android兼容性测试CTS Verifier-环境搭建、测试执行、结果分析

    原文网址:http://www.cnblogs.com/zh-ya-jing/p/4452675.html CTS Verifier算是CTS的一部分,需要手动进行,主要用于测试那些自动测试系统无法测 ...

  9. 【转】Android兼容性测试CTS --环境搭建、测试执行、结果分析

    原文网址:http://www.cnblogs.com/zh-ya-jing/p/4396918.html 为了确保Android应用能够在所有兼容Android的设备上正确运行,并且保持相似的用户体 ...

随机推荐

  1. c#代码发送post请求,上传文件(并带其他参数)

    本人对post理解不深,前段时间遇到一个需要用c#代码发送post请求上传文件的业务,于是参考了几篇帖子,加上自身实践写出了如下代码.写的比较low 望各位大大指正^_^. 业务需求: 对方给了一个接 ...

  2. Mybatis一对多查询得不到多方结果

    一对多查询:一个年级对应多个学生,现在要查询年级(带学生)信息. 查询结果: [main] INFO com.java1234.service.GradeTest - 查询年级(带学生)[main] ...

  3. bison实例

    逆波兰记号计算器[文件名rpcalc.y]%{ #define YYSTYPE double #include <stdio.h> #include <math.h> #inc ...

  4. HDU 5572 An Easy Physics Problem (计算几何+对称点模板)

    HDU 5572 An Easy Physics Problem (计算几何) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5572 Descripti ...

  5. Myeclipse启动错误

    问题描述: Errors occurred during the build.Errors running builder 'DeploymentBuilder' on project 'szoa'. ...

  6. JavaScript DOM编程艺术-学习笔记(总结一)

    1.1)dom-core方法:(不专属于js,支持dom的任何一种程序设计语言都可以使用它,它们的用途,也不仅限于处理网页,也可以用来处理任何一种标记语言编写处理的文档)  ①getElementBy ...

  7. C# 常用接口学习 IComparable 和 IComparer

    C# 常用接口学习 IComparable 和 IComparer 作者:乌龙哈里 时间:2015-11-01 平台:Window7 64bit,Visual Studio Community 201 ...

  8. 关于微信端不支持window.location.reload()

    今天写了一个调查问卷页面,项目经理说要表单提交之后页面刷新,之间没沟通清楚,以为整个页面重载,所以刚开始就用了window.location.reload()的方法. 但是发现,在微信直接打开之后,居 ...

  9. OSGI.NET,请求因HTTP状态404 失败:Not Found

    在VS里使用OSGI.NET可以正常运行项目和插件,开放工厂远程管理工具也可以使用,没有任何异常.可是,当我把项目部署到IIS上,网站可以正常运行,插件也正常:使用开放工厂远程管理工具时,就出现&qu ...

  10. OpenVPN GUI: "No TAP-WIN32 adapters on this system"

    找到C:\Program Files\TAP-Windows\bin 管理员身份运行: deltapall.bat addtap.bat