While looking for a way to implement this, I've found several how-tos, but they all used Maven, which didn't look great for me for several reasons. That's why I decided to set it up with myself. Here is the short manual if you are interested.
- Install Apache Ant
- Install Android SDK and its components (Tools and Platform Tools)
- Install Jenkins (formerly Hudson)
- Install Android Emulator Plugin for Jenkins and configure it with path to Android SDK
- Install Python Plugin for Jenkins
- Download android-junit-report.jar and place it to your tests lib/ directory (we need this as long as default Android test-runner doesn't generate XML report needed by Jenkins).
- Download build script and change variables section to fit your project (directories to application and tests, path to Android SDK, target version of Android, package name, use emulator or real device etc.). You don't need to add any modifications to AndroidManifest.xml or create build.xml - script will do this for you
- Create new job
- Add Python script as build step and paste modified version of build script there
- Try it!