
Failure [INSTALL_FAILED_TEST_ONLY: installPackageLI]
发布日期:2021-05-07 19:15:52
浏览次数:21
分类:精选文章
本文共 1180 字,大约阅读时间需要 3 分钟。
平台版本是android 7.0,在adb install *.apk 会提示下面的错误:Failure [INSTALL_FAILED_TEST_ONLY: installPackageLI]
方法1:
修改AndroidManifest.xml 中android:testOnly="true" 改成 android:testOnly="false",或者直接去掉。
方法2:
adb push *.apk /tmp
adb shell pm install -t /tmp/*.apk
方法3:adb install -t *.apk
方法4:
Android Studio 3.0 and FLAG_TEST_ONLY 一文中,给出了关于Android studio 3.0中出现问题的说明:
Option to indicate this application is only for testing purposes. For example, it may expose functionality or data outside of itself that would cause a security hole, but is useful for testing. This kind of application can not be installed without the INSTALL_ALLOW_TEST flag, which means only through adb install. 1. You cannot install an app with android:testOnly="true" by conventional means, such as from an Android file manager or from a download off of a Web site 2. Android Studio 3.0 sets android:testOnly="true" on APKs that are run from the IDE解决办法:
在gradle.properties(项目根目录或者gradle全局配置目录 ~/.gradle/)文件中添加: android.injected.testOnly=false参考文献:
https://commonsware.com/blog/2017/10/31/android-studio-3p0-flag-test-only.html
https://stackoverflow.com/questions/25274296/adb-install-fails-with-install-failed-test-only
发表评论
最新留言
初次前来,多多关照!
[***.217.46.12]2025年04月10日 12时05分12秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
程序员应该知道的97件事
2021-05-08
create-react-app路由的实现原理
2021-05-08
Linux环境变量配置错误导致命令不能使用(杂谈)
2021-05-08
openstack安装(九)网络服务的安装--控制节点
2021-05-08
shell编程(六)语言编码规范之(变量)
2021-05-08
vimscript学习笔记(二)预备知识
2021-05-08
Android数据库
2021-05-08
HTML基础,块级元素/行内元素/行内块元素辨析【2分钟掌握】
2021-05-08
STM8 GPIO模式
2021-05-08
omnet++
2021-05-08
23种设计模式一:单例模式
2021-05-08
Qt中的析构函数
2021-05-08
C语言实现dijkstra(adjacence matrix)
2021-05-08
三层框架+sql server数据库 实战教学-徐新帅-专题视频课程
2021-05-08
【单片机开发】智能小车工程(经验总结)
2021-05-08
【单片机开发】基于stm32的掌上游戏机设计 (项目规划)
2021-05-08
C++&&STL
2021-05-08
子集(LeetCode 78)
2021-05-08
微信js-sdk使用简述(分享,扫码功能等)
2021-05-08