问题
Installation did not succeed.
The application could not be installed: INSTALL_FAILED_TEST_ONLY
List of apks:
[0] '/Users/apus/apus/xsda/app/build/outputs/apk/debug/app-debug.apk'
Installation failed due to: 'Failed to commit install session 1807709738 with command cmd package install-commit 1807709738. Error: INSTALL_FAILED_TEST_ONLY'
Retry
原因
在Android3.x会自动加入android:testOnly="true"标签,导致部分手机不能直接安装
解决办法
在~/.gradle路径下创建gradle.properties文件,在文件里面添加
android.injected.testOnly=false
便可解决
资料
The application could not be installed: INSTALL_FAILED_TEST_ONLY解决方案禁用 Android Studio 3.x 系列自带的 testOnly 属性,解决 debug 包安装失败的问题