android - 在 proguard 之后运行 espresso 测试

标签 android android-espresso android-proguard

我正在寻找一种在 proguard 运行后运行我的 Espresso 测试的方法 - 这应该是一个错误配置的 proguard 的安全网(在将 butterknife 更新到 7.0 之后忘记更新 proguard 配置)

最佳答案

假设您使用 Android Gradle 构建系统内置的标准机制(为特定构建类型设置“minifyEnabled true”)来保护您的 APK,您可以通过设置 testBuildType 来测试您的“保护”APK,如 here 所述并正常运行您的 connectedAndroidTest 任务。

例如,如果您的“release”buildType 被配置为针对它运行 proguard,您可以将以下内容添加到您的 gradle 文件中:

android {
    testBuildType "release"
}

关于android - 在 proguard 之后运行 espresso 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31819619/

相关文章:

android - 调用包含列表的构造函数

从 MIFARE Classic NFC 标签读取的 Android 示例?

android - 在 Espresso 测试中等待依赖于网络调用的按钮

android - 在 io.branch.sdk 的 android gradle 中排除模块 'answer-shim' 后,无法使用 proguard 构建

java - 错误 :Execution failed for task ':app:transformClassesWithMultidexlistForDebug'

android - cordova 在 windows xp 上找不到 android 构建工具

android - 如何使用 espresso android 测试一定范围内的 View 文本

android-espresso - 安卓。 Espresso : How write test check is text is underlined on TextView?

android - 签名的应用程序崩溃和未签名的 apk 运行

android - 动态添加相对布局到线性布局