• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • Android系統單元測試方法(20)

    發表于:2011-06-30來源:未知作者:領測軟件測試網采編點擊數: 標簽:
    activityandroid:name= .MainActivity android:label= @string/app_name intent-filter actionandroid:name= android.intent.action.MAIN / categoryandroid:name= android.intent.category.LAUNCHER / /intent-filt
  •   
  • <activity android:name=".MainActivity"  
  •   
  • 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>   
  •   
  • <instrumentation android:targetPackage="com.android.testapp" android:name="android.test.InstrumentationTestRunner" android:label="Test Unit Tests"></instrumentation>   
  •   
  • </manifest>  

  • 在這個文件中,我將Activity和Instrumentation的聲明寫到了一起,而沒有像Apis Demo那樣分開。請注意里面的<uses-library>標簽。如果沒有那句,在運行測試時會報告找不到TestRunner。這是由于 Android在build的時候只把需要的東西打包,所以你必須明確的告訴Android Builder這一點。 3. Build和Install

    在Eclipse上,這兩個步驟是一起完成的。只要點一下Run即可。只不過如果你不在Run Configuration里將安裝后的Launch Action設為“Do Nothing”,就會自動運行一下你的MainActivity。對于我們,設為Do Nothing即可。如下圖:
    qcN9iQf_8xt_hkv2s-ivNURGW_QfOnCgA/clip_image010_thumb%5B1%5D.jpg" />

    完成后,利用命令

    Java代碼 復制代碼 收藏代碼
    1. adb shell pm list packages  


    可以在已經安裝的pkg列表里看到com.android.testapp。 4. 運行測試,查看結果

    之后就打開命令行,運行以下命令
    Java代碼 復制代碼 

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>