代码之家  ›  专栏  ›  技术社区  ›  Rob Stevenson-Leggett

Android Eclipse插件:未指定仪器测试运行程序

  •  65
  • Rob Stevenson-Leggett  · 技术社区  · 17 年前

    7 回复  |  直到 12 年前
        1
  •  111
  •   Chris jorelli    9 年前

    你可能错过了 uses-library instrumentation 您的节点 AndroidManifest.xml :

    <manifest ...>
        <application ...>
            <!-- ... -->
            <uses-library android:name="android.test.runner" />
        </application>
        <instrumentation android:name="android.test.InstrumentationTestRunner"
            android:targetPackage="your.package"
            android:label="your tests label" />
    </manifest>
    
        2
  •  59
  •   BobbyG D.S.Pradeep Kumar    12 年前

    在 Run Configuration 你可能有 Android JUnit Test

        3
  •  18
  •   Charlie Collins    16 年前

    http://developer.android.com/guide/topics/manifest/instrumentation-element.html

    如果你把你的检测工具放在应用程序中,它就不会被调用,你在Eclipse ADT插件中为检测运行器所做的选择可能是空的。(但没有抛出或显示错误等)

        4
  •  9
  •   user190362    17 年前

    我认为这会解决你的问题。

        5
  •  2
  •   Cosmin    14 年前

        6
  •  1
  •   Yoong    12 年前

    除了确保在测试应用程序的清单中声明以下项目外,请在运行配置中检查“Instrumentation runner”字段是否设置为

    "com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner". 
    

    <instrumentation android:name="android.test.InstrumentationTestRunner"
     android:targetPackage="your.package"
     android:label="your tests label" />
    
     and...
    
    <uses-library android:name="android.test.runner" />
    
        7
  •  0
  •   Krishna Anisetty    16 年前

    问题是,当你创建项目时,你会有一个AVD,所以这些配置会丢失。我建议的方法是先创建AVD,然后创建android项目:)。