qileilove

blog已经转移至github,大家请访问 http://qaseven.github.io/

Android 单元测试cmd 命令集

 对app进行单元测试时,或使用robotium进行黑盒测试时,需要把测试apk安装到模拟器或者android真机上,然后用命令去驱动测试
  1.运行测试程序命令-运行测试工程中所有test方法:
  >adb shell am instrument -w 测试程序packageName/android.test.InstrumentationTestRunner
  例如:
  >adb shell am instrument -w com.example.action02.test/android.test.InstrumentationTestRunner
  2.运行测试程序命令-运行测试工程中指定测试类方法:
  >abd shell am instrument -e class package.testClass(测试类) -w packageName/android.test.InstrumentationTestRunner
  例如:adb shell am instrument -e class com.example.action02.test.testlogin  -w com.example.action02.test/android.test.InstrumentationTestRunner
  3.运行测试程序命令-运行单个测试方法
  >adb shell am instrument -e class package.testClass#testmethod -w cpackageNameandroid.test.InstrumentationTestRunner
  例如:adb shell am instrument -e class com.example.action02.test.testloginandquit#testlogin  -w com.example.action02.test/android.test.InstrumentationTestRunner

posted on 2014-01-24 16:15 顺其自然EVO 阅读(438) 评论(0)  编辑  收藏 所属分类: android


只有注册用户登录后才能发表评论。


网站导航:
 
<2014年1月>
2930311234
567891011
12131415161718
19202122232425
2627282930311
2345678

导航

统计

常用链接

留言簿(55)

随笔分类

随笔档案

文章分类

文章档案

搜索

最新评论

阅读排行榜

评论排行榜