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
I just managed to run JUnit tests from command line, but using an adb shell.
The command was
./adb shell am instrument -w com.ffffdforandroid.api/android.test.InstrumentationTestRunner
More details here.
Template:
adb shell am instrument -w <YOUR_PACKGE_NAME>.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