CTS测试总结

上一篇 / 下一篇  2011-01-25 20:03:53 / 个人分类:原创

 CTS搭建

1.   下载CTS包http://source.android.com/compatibility/cts-intro.html

2.   手机或者模拟器上安装CtsDelegatingAccessibilityService.apk

1$sudo ./adb install -r /home/tester/cts/android-cts/repository/testcases

/CtsDelegatingAccessibil

ityService.apk

2)手机或模拟器设置Settings > Accessibility > Accessibility > Delegating Accessibility Service

3.   进入android/out/host/linux-x86/cts /android-cts/repository/tools目录下,修改startcts脚本文件。将脚本中的SDK_ROOT该成自己的android SDK路径.

$cd home/tester /cts/android-cts/repository/tools $vim startcts修改脚本中出现的第一个SDK_ROOT,"SDK_ROOT=/home/tester/cts/android-sdk-linux_86"

4.   执行startcts脚本。在执行CTS测试计划时(执行一段时间后,大于5分钟)会出现没有足够权限启动devices,使用$sudo ./startcts可解决该问题。

5.   出现如下提示符表示启动cts并连接设备成功。(红色部分未deviceID,视设备号而定)

Android CTS version 2.1_r2

Device(CB511KADGR) connected

cts_host > cts_host >

6.   在“cts_host >”提示符下输入命令,以下为几个常用的命令

help查看所有

exit退出

ls -p列出所有的测试包

ls --plan列出所有的测试方案

start --plan plan_name运行一个测试方案,如:start --plan CTS

start --plan plan_name --package package_name运行一个特定的测试包,如:start --plan CTS --package android.bluetooth

 

查看测试报告

 

运行测试时,在CTS运行界面能看到测试报告与运行状况。测试完成后可在android-cts/repository/results/下生成详细的测试报告和一些附加信息,其中用日期和时间命名的文件夹下为所有的测试结果,同时文件夹也会被打成一个对应的.zip包方便提交。用浏览器打开.xml文件(默认就是,直接双击)就可以查看所用的测试报告了

常见问题:

a)        问题描述:在执行paln时,执行一段时间后会抛异常,异常如下:

CTS_INFO >>> Restarting device ...
Device(HC09MPL00037) disconnected
Exception in thread "Thread-17" com.android.ddmlib.AdbCommandRejectedException: 
insufficient permissions for device
   at com.android.ddmlib.AdbHelper.setDevice(AdbHelper.java:736)
   at com.android.ddmlib.SyncService.openSync(SyncService.java:164)
   at com.android.ddmlib.Device.getSyncService(Device.java:253)
   at com.android.cts.DeviceManager$DeviceServiceMonitor.run(DeviceManager.java:217)

解决方案:是因为权限不够,提升至root权限可解决,命令如下$sudo ./startcts   

b)        问题描述:输入./adb shell出现如下异常:

error: insufficient permissions for device

解决方案:输入:

$sudo -s

./adb kill-server

./adb devices

c)     问题描述:出现如下异常:Unable to locate  android-sdk-linux_86/tools/adb.

解决方案:是因为android-sdk-linux_86tools目录下没有adb文件,可以从platfrorm-tools目录下的adb文件拷贝到tools目录下,或者去SVN上取下

d)        问题描述:error: device not found

解决方法:1)请确认你的手机是否连接电脑,(2)以连接PC,重新拔下来,在连一次(3)如果2操作后还不行,看下USB连接方式是否为默认(仅充电),选htcUSB连接。

e)        写入测试结果时报Too many open files的错误,这是因为网络请求过多,也就导致了系统打开的文件过多。每一个连接都会当成“文件”看待的。

解决方案:ulimit –a命令查看每个用户允许打开的最大文件数,看到是的1024,把它改大点,用命令:ulimit -n 4096

 

补充说明:

为了避免一些没必要的错误,在测试前先更改一下手机设置:

1.   You need to download the TTS files via Settings > Speech synthesis > Install
voice data before running CTS tests. (Note that this assumes you have Android
Market installed on the device, if not you will need to install the files manually via
adb)

2. It is advisable to log in to the device with a test Google account, not an account
that you actually use.

3. Make sure the device has a SD card plugged in and the card is empty. Warning:
CTS may modify/erase data on the SD card plugged in to the device.

4. Do a factory data reset on the device (Settings > SD Card & phone storage >
Factory data reset). Warning: This will erase all user data from the phone.

5. Make sure no lock pattern is set on the device (Settings > Security & location >
Require Pattern should be unchecked.
Google Confidential

6. Make sure the "Screen Timeout" is set to "Never Timeout" (Settings > Sound &
Display > Screen Timeout should be set to "Never Timeout".

our board have not this selection, so we can select the longest time 30min

7. Make sure the "Stay Awake" development option is checked (Settings >
Applications > Development > Stay awake).

8. Make sure Settings > Application > Development > Allow mock locations is set
to true.

9. Make sure the device is at the home screen at the start of CTS (Press the home
button).

10. While a device is running tests, it must not be used for any other tasks.

11. Do not press any keys on the device while CTS is running. Pressing keys or
touching the screen of a test device will interfere with the running tests and may
lead to test failures.


TAG:

Rock.wu的个人空间 引用 删除 Rock.wu   /   2011-08-03 16:59:42
我是新手,请教一下大侠。我的报错 "Thread-15",手机上运行了几秒钟就退回到idle,大侠有何看法?
Rock.wu的个人空间 引用 删除 Rock.wu   /   2011-08-03 16:59:34
5
引用 删除 Jacky601   /   2011-07-29 21:48:20
5
引用 删除 celery4   /   2011-06-29 16:02:13
5
引用 删除 wangjunbao19   /   2011-06-09 22:48:51
请问执行CTS的plan是不是可以自动执行其他的几个plan?
worange74的个人空间 引用 删除 worange74   /   2011-05-18 18:17:41
3
haldis的个人空间 引用 删除 haldis   /   2011-03-07 20:12:58
CTS 不仅仅测试软件的 API 部份,它还包括性能测试,硬件功能,设备设计,UI 用户界面需求,和机内打包的服务。CTS 决定了你可以添加额外功能,但不能从最基础的配置中削减功能。除了 CTS 以外,OEM 厂商还要和 Google 签订授权合同,这样他们才能打包 Google 的服务,比如 Gmail、YouTube 等等。

  CTS 限制了 OEM 定制弱化版 Android 手机的想法(译者注:山寨的机会啊!MTK、中微星,年底发布些低端 Android 手机吧!)。这也大大限制了 Android 开拓低端市场的能力。CTS 和向前兼容 4 万多个应用的事实,极大的挑战着 Google 想占领智能手机市场2位数的市场份额目标。这些限制,还有 Google 与 OEM 亦敌亦友的合作关系,使得 OEM 圈内掀起了建立 Android 基金的讨论。
haldis的个人空间 引用 删除 haldis   /   2011-02-18 13:32:10
   相互学习,还请多多指正啊
薇_笑的个人空间 引用 删除 薇_笑   /   2011-02-15 09:36:30
  好东西
 

评分:0

我来说两句

Open Toolbar