从命令行运行Android的JUnit测试 [英] Running Android Junit tests from command line
本文介绍了从命令行运行Android的JUnit测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望能够运行在命令行的JUnit测试,但是当我运行此命令
I want to be able to run Junit tests from the command line, but when I run this command
java命令/usr/share/java/junit.jar org.junit.runner.JUnitCore [测试类的名称]
java -cp /usr/share/java/junit.jar org.junit.runner.JUnitCore [test class name]
我所得到的回复是
OK(0测试)
它有什么关系呢作为一个Android项目?我已经运行在这之前的命令,并没有太大的问题。
Does it have something to do with it being an Android project? I've run that command before and haven't had much issue.
谢谢!
推荐答案
我刚刚成功地运行命令行JUnit测试,但使用亚行的shell。
I just managed to run JUnit tests from command line, but using an adb shell.
该命令是 ./亚行外壳上午仪器-w com.dddforandroid.api / android.test.InstrumentationTestRunner
更多细节这里。
这篇关于从命令行运行Android的JUnit测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文