问题描述
限时送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:testOnly
为 true
你可以使用 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:关键词]
发布评论