eclipse调试Cts 单项
来源:互联网 发布:弦歌知雅意 编辑:程序博客网 时间:2024/05/19 14:37
Cts测试中,单项失败是常用的事情,想要查找原因却比较麻烦,因为cts的command line 虽然提供了单项单独测试的方法,却只会输出结果,最多也就保留了device和host的log,用eclipse来调试还是比较不常见的。今天想到了这个麻烦,研究了下eclipse 调试Cts单项的方法:
首先,Cts的测试主要还是要依赖apk,所以它的调试还是和app的调试很类似的。
1. 通过Cts command line 单独测试一下失败项,从log给出的信息中找到对应的apk。
2. Install这个apk,想办法让它跑起来,如果有activity,那am start 就好了。
3. 如果没有activity 只有instrumentation,那就要用am instrument,这个命令不太常用
am instrument: start an Instrumentation. Typically this target <COMPONENT> is the form <TEST_PACKAGE>/<RUNNER_CLASS>. Options are: -r: print raw results (otherwise decode REPORT_KEY_STREAMRESULT). Use with [-e perf true] to generate raw output for performance measurements. -e <NAME> <VALUE>: set argument <NAME> to <VALUE>. For test runners a common form is [-e <testrunner_flag> <value>[,<value>...]]. -p <FILE>: write profiling data to <FILE> -w: wait for instrumentation to finish before returning. Required for test runners. --user <USER_ID> | current: Specify user instrumentation runs in; current user if not specified. --no-window-animation: turn off window animations while running. --abi <ABI>: Launch the instrumented process with the selected ABI. This assumes that the process supports the selected ABI.
说明不是很清楚,大概可以看出可以通过 am instrument -r -w XXX 一个instrumentation的名字来跑这个instrumentation。
如何跑单项呢? 要用到-e
例如:
am instrument -r -e class android.provider.cts.MediaStore_FilesTest#testAccess -w com.android.cts.provider/android.support.test.runner.AndroidJUnitRunner
android.provider.cts.MediaStore_FilesTest#testAccess 这一串是不是很熟悉呢,对了,就是cts单项测试时候打印出来的东东,包名类名加方法名。
com.android.cts.provider/android.support.test.runner.AndroidJUnitRunner 这一串呢就是instrumentation的名字,咋知道呢?AndroidManifest里有。
通过pm list instrumentation 也可以查出来。
ok,只要能让这个apk跑起来就好办了,eclipse就可以attach来调试咯。
找个时机去attach也是关键,这里就可以用am set-debug-app来创造时机了。这是一个很有内涵的命令,找个时间再来分析了。
- eclipse调试Cts 单项
- android7.0 CTS的单项测试流程
- CTS 框架研究(2)-CTS环境调试 _源码导入eclipse
- android CTS调试
- android-CTS调试方法
- cts调试环境的搭建
- Cts框架解析(2)-cts调试环境的搭建
- Cts框架解析-cts调试环境的搭建
- CTS
- cts
- CTS
- CTS
- Android 2.3 CTS测试修改测试结果和调试方法
- Android 2.3 CTS测试修改测试结果和调试方法
- 关于camera CTS调试中遇到的问题
- Android CTS测试修改测试结果和调试方法
- eclipse调试
- eclipse调试
- 第12周项目4-点和圆的关系(2)
- PHP、Java、.Net和Javascript的AES加密解密实现
- yum 安装报 关于Public key for *.rpm is not installed 的解决方法
- Gleanings of Python
- HTML5 知识点(全)
- eclipse调试Cts 单项
- 唐山好治疗自闭症yiyuan
- netstat 的10个基本用法
- 重庆静脉曲张治疗方法
- 重庆静脉曲张治疗费用
- hibernate一对多
- 重庆静脉曲张治疗的方法
- 重庆静脉曲张怎么办
- 唐山好治疗自闭症的yiyuan