ITeye博客

使用命令行在手机上运行android单元测试

nid007 · 2014-07-03 10:25 · android · 移动开发 · Markdown

本文假设你已经知道如何adb连接设备,知道如何在eclipse里运行android的单元测试。

关键命令:


直接运行所有有case
adb shell am instrument -w com.myapp.test/android.test.InstrumentationTestRunner

运行一个case
adb shell am instrument -w -e class com.myapp.test.TestDemo#testSearch com.myapp.test/android.test.InstrumentationTestRunner

说明:com.myapp.test是包名,com.myapp.test.TestDemo是类名 testSearch是方法名

更多信息可以参考官网: http://developer.android.com/tools/testing/testing_otheride.html#RunTestsDevice

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。