Search code examples
androidtestingantfunctional-testing

How can I run single test cases via Android's ant build script?


Android's standard build.xml comes with complete support for executing functional test cases on devices and emulators via the test target. But this target always executes all test cases in a test project; how can I instruct it to run only a single test case, for debugging reasons?


Solution

  • You can use adb shell "start instrument -w -e class package_name/class_name package_name/android.test.InstrumentationTestRunner"