activitycreator script is enhanced to generate 'tests' project along with the main project. The current behavior of generating Activity is extended by generating ActivityTest in 'tests/src' folder. The 'tests' folder follows the example provided asis in 'ApiDemos'. ApiDemos was used as reference project to mimic the project layout for building tests using Instrumentation.
From 'tests' project, type:
"adb shell am instrument -w [your.package].tests/android.test.InstrumentationTestRunner"
to run all tests using Android InstrumentationTestRunner.
NOTE: 'tests' is a separate AndroidProject by all means. It has its own AndroidManifest.xml, build.xml, src, res etc.,
AMEND:
Fixed style issues, javadoc
Fixed build.template to generate tests/build.xml
Removed build.tests.template since its obsolete now.