首页 > 其他 > 详细

Warning: No instrumentation runner found for the launch 解决方案

时间:2014-03-26 19:38:25      阅读:520      评论:0      收藏:0      [点我收藏+]

使用测试单元的时候,Androidmaniefest.xml文件如下:


<?xml version="1.0" encoding="utf-8"?>


<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.myapp"
    android:versionCode="1"
    android:versionName="1.0"
    android:debuggable="true">
    
    <application android:icon="@drawable/icon"
android:label="@string/app_name">
        <activity android:name=".MyApp" android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <uses-library android:name="android.test.runner" />
    </application>
    
    <uses-sdk android:minSdkVersion="3" />
    
    <instrumentation
        android:name="android.test.InstrumentationTestRunner"
        android:targetPackage="com.myapp.tests"             
        android:label="MyAppTests" />
    
</manifest>


单击“Android JUnit Test”运行后会,会出现如下警告:


It outputs Warning: No instrumentation runner found for the launch, using
android.test.InstrumentationTestRunner.

模拟器不能记住manifest的配置,在运行时需要重新设置运行配置,如下:


1.在工程名字上点击右键,选择properties


2.在Run/Debug setting中选择要运行的工程名字,点击右边的Edit,会进入下面的界面,在 instrumentation runner后面的下拉列表中选择:android.test.InstrumentationTestRunner(如下图)


 


bubuko.com,布布扣

3.重新运行该测试单元,则就不会出现上面的警告了。

Warning: No instrumentation runner found for the launch 解决方案,布布扣,bubuko.com

Warning: No instrumentation runner found for the launch 解决方案

原文:http://blog.csdn.net/yubaoma2014/article/details/22173091

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!