>adb shell pm list instrumentation(该命令会列出所有已经安装的apk)
instrumentation:com.android.cts.stub/android.content.pm.cts.TestPmInstrumentation (target=android)
instrumentation:com.android.cts.animation/android.test.InstrumentationTestRunner (target=com.android.cts.anima
tion)
instrumentation:com.android.cts.app/android.test.InstrumentationCtsTestRunner (target=com.android.cts.stub)
instrumentation:com.android.cts.os/android.test.InstrumentationCtsTestRunner (target=com.android.cts.stub)


用该命令列出之后,测试单个函数或测试包时要与这里的相对应,如下面的例子所示:

1.cts测试单个函数:

eg:

a.测试testCurrentPlayTime方法

>adb shell am instrument -e class android.animation.cts.ValueAnimatorTest#te

stCurrentPlayTime -w -r com.android.cts.animation/android.test.InstrumentationTestRunner


b.测试testGetMemoryClass方法

>adb shell am instrument -e class android.app.cts.ActivityManagerMemoryClass
Test#testGetMemoryClass -w -r com.android.cts.app/android.test.InstrumentationCtsTestRunner



2.测试整个包

eg:

a.测试Android.animation这个包:

>adb shell am instrument-w -r com.android.cts.animation/android.test.InstrumentationTestRunner


b.测试Android.app这个包:

>adb shell am instrument -w -r com.android.cts.app/android.test.InstrumentationCtsTestRunner

更多相关文章

  1. android ViewParent requestDisallowInterceptTouchEvent 测试
  2. 修改Android系统目录的读写权限命令
  3. android之检查service运行状态函数
  4. Android Studio 基础 之 一键快速实现一个类的 构造函数、getter
  5. 谷安: 米国军方的 iOS、Android、Windows Phone 7 测试结果…
  6. Android Studio如何提示函数用法
  7. Android Studio怎样提示函数使用方法
  8. Android shell 下 busybox,clear,tcpdump、、众多命令的移植
  9. Android性能测试 一些适用于Android Studio的代码审查和性能测试

随机推荐

  1. Android(安卓)传感器
  2. Android(安卓)NDK开发使用以及so文件生成
  3. Google Android开发精华教程
  4. Android线程模型解析(包括UI的更新)
  5. android的编译和运行过程深入分析
  6. Android消息机制字典型探究(二)
  7. android window类
  8. Android中“分享”功能的实现
  9. Android内存溢出
  10. Android开发者e周报 第4期