Android单元测试的配置
来源:互联网 发布:数据割接 编辑:程序博客网 时间:2024/05/17 08:23
Android 单元测试的配置如图:
1.添加JUnit4的关联 .
2.在AndroidManifest.xml 文件中添加相关代码
<uses-permission android:name="android.permission.RUN_INSTRUMENTATION" /> <instrumentation android:name="android.test.InstrumentationTestRunner" android:label="Tests for My App" android:targetPackage="com.example.androidtest" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <uses-library android:name="android.test.runner" /> ..... </application>
3.运行时出错 应在JUnit中去掉android api的依赖.
操作:右键点项目→选中“Debug As”→ 选择“Debug Configurations”→然后按下图操作,去掉对Android2.3.3的启动依赖
0 0
- Android单元测试的配置
- Android单元测试的配置
- Android:单元测试Junit的配置
- Android:单元测试Junit的配置
- Android:单元测试Junit的配置
- Android:单元测试Junit的配置
- Android:单元测试Junit的配置
- Android单元测试Junit的配置
- Android:单元测试Junit的配置
- Android:单元测试Junit的配置
- Android:单元测试Junit的配置
- Android:单元测试Junit的配置
- Android:单元测试Junit的配置
- Android:单元测试Junit的配置
- Android 中 单元测试的配置
- Android:单元测试Junit的配置
- Android:单元测试Junit的配置
- Android配置 常规单元测试
- Xcode常见崩溃问题
- 纯代码实现2048各种版本
- poj_1005
- codeforce 631C report
- ArrayList和LinkedList区别
- Android单元测试的配置
- XML使用总结(二)
- Switch Fall Through
- 过滤器
- LeetCode207. Course Schedule
- Scala Match
- leetcode 103. Binary Tree Zigzag Level Order Traversal
- iOS学习之 plist文件的读写
- 基础算法-直接选择排序