创建单元测试:
新建Android项目--Manifest中引入 <application><uses-library android:name="android.test.runner"/></application> <instrumentation android:name="android.test.instrumentationTestRunner" android:targetPackage="com.example.******" android:label = "Tests"/> 测试文件和源程序运行在同一个进程中----新建一个普通类,继承父类AndroidTestCase---一定方法是public--public void testCall() throws Exception{ 实例化被测试的类,测试call方法 }---run as Android junit test .
查看输出日志信息:
Logcat
<span style="font-family:Microsoft YaHei;font-size:18px;"> Log.e(tag, msg);//error
Log.w(tag, msg);//warning
Log.d(tag, msg);//debug
Log.i(tag, msg);//info</span>