天天看點

在安卓中對應用進行單元測試

  在application結點内部添加

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

  在application結點外部添加

<instrumentation android:name=”android.test.instrumentationtestrunner”

  上面的targetpackage就是要測試的目标應用的包名

  第二步:編寫單元測試類代碼,選擇要測試的方法,右鍵點選”run as”-“android junit test”來進行測試,注意該類需要繼承androidtestcase類

最新内容請見作者的github頁:http://qaseven.github.io/

繼續閱讀