开发者

Need help in running Android Unit Test Project on real phone

开发者 https://www.devze.com 2023-03-25 00:20 出处:网络
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.

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>
0

精彩评论

暂无评论...
验证码 换一张
取 消