Android 中如何进行单元测试

  1. 在 AndroidManifest.xml 的 <application></application>标签中加入以下语句:android

    <uses-library android:name="android.test.runner"/>app

  2. 在 AndroidManifest.xml 的 <manifest></manifest>标签中加入以下语句:spa

    <instrumentation 
    xml

       android:name="android.test.InstrumentationTestRunner"继承

       android:targetPackage="com.example.log"get

       android:label="Tests for My App"it

       />io

  3. 在src文件夹中建立 TestCase 必须继承 AndroidTestCasetest

相关文章
相关标签/搜索