I have create an android and a corresponding test project. When I run the Android test project as a 'Android junit test'. Both my android project and my android test project compiles under eclipse.
But when i run on a real phone (connected my phone to my laptop and click 'Run as Android junit test' in eclipse) I get this 'instrumentation target package'.
[2011-08-02 14:33:36 - MyApp-test2] ------------------------------
[2011-08-02 14:33:36 - MyApp-test2] Android Launch!
[2011-08-02 14:33:36 - MyApp-test2] adb is running normally.
[2011-08-02 14:33:36 - MyApp-test2] Performing android.test.InstrumentationTestRunner JUnit launch
[2011-08-02 14:33开发者_高级运维:36 - MyApp-test2] Automatic Target Mode: using device 'HT9BSP800010'
[2011-08-02 14:33:36 - MyApp-test2] Application already deployed. No need to reinstall.
[2011-08-02 14:33:36 - MyApp-test2] Project dependency found, installing: MyApp
[2011-08-02 14:33:37 - MyApp] Application already deployed. No need to reinstall.
[2011-08-02 14:33:37 - MyApp-test2] Launching instrumentation android.test.InstrumentationTestRunner on device HT9BSP800010
[2011-08-02 14:33:37 - MyApp-test2] Collecting test information
[2011-08-02 14:33:37 - MyApp-test2] Test run failed: Unable to find instrumentation target package:
Show us your android-manifest file, or make sure you have below in it:
<manifest ..>
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="YourTargetPkgNameHere" />
<application ...>
<uses-library android:name="android.test.runner" />
</application>
</manifest>
精彩评论