Android异常篇 Installation failed due to: ‘INSTALL_FAILED_TEST_ONLY‘

一、INSTALL_FAILED_TEST_ONLY 问题提示

在这里插入图片描述

二、分析

Android Studio 3.0 + 会在 debug apk 的manifest文件application标签里自动添加 android:testOnly="true"属性

详细链接:https://developer.android.com/guide/topics/manifest/application-element

三、解决方案

(一)在项目中的gradle.properties全局配置中设置

android.injected.testOnly = false

在这里插入图片描述
(二)编译添加 -t

adb install -t app-debug.apk

或者

adb install -t *.apk

猜你喜欢

转载自blog.csdn.net/weixin_44720673/article/details/121754886