ADB 安装失败,INSTALL

编程入门 行业动态 更新时间:2024-10-09 21:22:21
本文介绍了ADB 安装失败,INSTALL_FAILED_TEST_ONLY的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我在将 apk 安装到我的设备上时遇到问题.

I am having issues installing an apk to my device.

adb install <.apk>

使用上面的命令返回如下:

Using the above command returns the following:

5413 KB/s (99747 bytes in 0.017s)
        pkg: /data/local/tmp/AppClient.TestOnly.App3.apk
Failure [INSTALL_FAILED_TEST_ONLY]

对可能导致此问题的原因有任何想法吗?

Any idea on what might cause this issue?

它肯定能识别设备.会不会是 apk 的问题?

It definitely recognizes the device. Could it be an issue with the apk?

推荐答案

看来你需要修改你的AndroidManifest.xml
android:testOnly="true" 更改为 android:testOnly="false" 或删除此属性.

Looks like you need to modify your AndroidManifest.xml
Change android:testOnly="true" to android:testOnly="false" or remove this attribute.

如果你想保持属性 android:testOnlytrue 你可以使用 pm install 命令和 -t 选项,但是您可能需要先push apk 到设备.

If you want to keep the attribute android:testOnly as true you can use pm install command with -t option, but you may need to push the apk to device first.

$ adb push bin/hello.apk /tmp/
5210 KB/s (825660 bytes in 0.154s)

$ adb shell pm install /tmp/hello.apk 
    pkg: /tmp/hello.apk
Failure [INSTALL_FAILED_TEST_ONLY]

$ adb shell pm install -t /tmp/hello.apk 
    pkg: /tmp/hello.apk
Success

我能够重现同样的问题,上面的方法解决了.

I was able to reproduce the same issue and the above solved it.

如果您的 APK 在设备外部(在您的桌面上),那么下面的命令可以做到:

If your APK is outside the device (on your desktop), then below command would do it:

$ adb install -t hello.apk

这篇关于ADB 安装失败,INSTALL_FAILED_TEST_ONLY的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-18 02:41:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/928282.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:ADB   INSTALL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!