1.冒烟测试:adb shell monkey -p <程序的包名> -v <事件的数量>2.android下单元测试:在manifest节点下添加:<instrumentation        android:name="android.test.InstrumentationTestRunner"        android:targetPackage="com.itheima.junittest" />在application节点下配置下面信息:<uses-library android:name="android.test.runner" />测试的时候定义一个类继承自AndroidTestCaseandroid下的测试:public class MathUtils {    /** * 加法运算 * @param x * @param y * @return */    public static int incrment(int x, int y) {        System.out.println(x + " + " + y + " = " + (x + y));        System.err.println(x + " + " + y + " = " + (x + y));        Log.v("MathUtils", "黑色: " + x + " + " + y + " = " + (x + y));        Log.d("MathUtils", "蓝色: " + x + " + " + y + " = " + (x + y));        Log.i("MathUtils", "绿色: " + x + " + " + y + " = " + (x + y));        Log.w("MathUtils", "黄色: " + x + " + " + y + " = " + (x + y));        Log.e("MathUtils", "红色: " + x + " + " + y + " = " + (x + y));        return x + y;    }public class Test extends AndroidTestCase {    public void test() {// System.out.println("test is calling!!");        int result = MathUtils.incrment(9, 10);        // 断言, 断定某一个对象就是某一个值        assertEquals(19, result);    }建工程的时候就建一个Android test Project。写下测试工程的包名就不必在配置文件中添加代码了。

更多相关文章

  1. [Android(安卓)Studio导入第三方类库方法] Error:(19, 23) 错误:
  2. android 之 菜单
  3. android 让5556和5554发发sms
  4. Android(安卓)仿微信Activity左右切换 【全局配置Activity显示动
  5. Android(安卓)简单联系人操作
  6. android LinearLayout 动态添加子View
  7. Android给第三方应用添加系统签名的两种方式
  8. Android(安卓)NDK开发
  9. Android(安卓)ORM 框架——GreenDao的基本用法

随机推荐

  1. Android ndk开发 打包成apk后 找不到modu
  2. 【Android】Android的消息机制
  3. [Android问答] 开发环境问题集锦
  4. Android NDK下编译google protocol buffe
  5. Java转Android开发不得不知的一些经验
  6. Linux/Android——Input系统之InputMappe
  7. Android悬浮窗开发招式集合
  8. Android对象序列化(Activity之间传递对象,P
  9. Android圆形控件
  10. Android共享元素