Running Android Junit tests from command line

后端 未结 2 1683
不知归路
不知归路 2021-01-03 10:25

I want to be able to run Junit tests from the command line, but when I run this command

java -cp /usr/share/java/junit.jar org.junit.runner.JUnitCore [test c         


        
2条回答
  •  醉酒成梦
    2021-01-03 10:59

    Template:

    adb shell am instrument -w .test/android.support.test.runner.AndroidJUnitRunner
    

    Example:

    adb shell am instrument -w com.example.android.testing.blueprint.flavor2.test/android.support.test.runner.AndroidJUnitRunner
    

    Details on Google's github page: Android Testing Blueprint

提交回复
热议问题