>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平台开发-Power management-电源管理
  2. Android(安卓)两种方式优雅实现按钮防重复点击,防抖功能
  3. Android下的junit 单元测试
  4. Android(安卓)加载图片文件 函数
  5. USB UMS MTP设置过程 (一)
  6. 客户端性能测试
  7. Android(安卓)Binder 机制详解
  8. android recovery 模式启动进入流程
  9. 箭头函数的基础使用

随机推荐

  1. AndroidManifest.xml - 【 manifest -> A
  2. Android计算器布局
  3. android常用对话框封装
  4. android ToggleButton
  5. Android Accessibility(辅助功能) 学习
  6. android秒表计时代码
  7. android多点触摸缩放图片
  8. android slidemenu
  9. 如何自学 Android 编程-----整理stormzha
  10. Android StatusBar