Had a heck of a time finding a tutorial on configuring Android instrumentation testing in IntelliJ. I tried the command line approach, but it was cumbersome and I’d rather have IDE integration. Finally I stumbled across this link which got me most of the way there. Some of the instructions are now automated in IntelliJ 11, so here’s an updated tutorial.
This tutorial assumes that you have installed the Android SDK, created an Android project, and simply want to add testing to it.
First, open project structure dialog by right clicking on project name or with the keyboard shortcut F4. Click the plus button and select “Module.”