用robotium写的测试脚本后,打成apk包安装到手机中,在持续集成中需要通过windows 批处理命令执行测试。以下是执行robotium 测试脚本的具体命令。
1、 运行测试包下所有的TestCase
adb shell am instrument -w 测试包名/android.test.InstrumentationTestRunner
2、运行测试包下某个测试类中的TestCase
adb shell am instrument -e class 测试包名.测试类名 -w 测试包名/android.test.InstrumentationTestRunner
3、 运行测试包下某个测试类中的具体的TestCase
adb shell am instrument -e class 测试包名.测试类名#测试方法 -w 测试包名/android.test.InstrumentationTestRunner