Android Developer site has extensive tutorials on testing Android applications with Eclipse but should you not be using Eclipse you may find the documentation somewhat lacking.
These comments and notes are based on the official guide found here: http://developer.android.com/guide/developing/testing/testing_otheride.html and using Android SDK Tools Rev 15, Platform Tools Rev
As per the documentation:
Quick build and run with Ant
You can use Ant to run all the tests in your test project, using the target
run-tests, which is created automatically when you create a test project with the
This clearly does not work as the current targets are:
clean, debug, install, installd, installi, intallr,
installt, instrument, release, test, uninstall
So to get tests running on a device/emulator, you need to:
- Build your test package: ant debug
- Install and run it: ant installd test
After making modifications to your test code, you’ll need to package and install the test apk again, just saying ant test will only re-run the already installed test package.
Hope this helps to get more tests created.