ADB Install Fails With INSTALL_FAILED_TEST_ONLY

2019-01-07 05:18发布

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?

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

22条回答
一纸荒年 Trace。
2楼-- · 2019-01-07 05:42

What worked for me is performing Refresh all Gradle projects from the Gradle toolbar from the right menu.

PFB the screenshot from Android Studio.

  1. Select Gradle toolbar from the right menu.
  2. Select the Refresh icon

This resolved the issue for me.

Screenshot from Android Studio

查看更多
Ridiculous、
3楼-- · 2019-01-07 05:43

If you want to test the apk, just add the -t command line option.

Example command:

adb install -t .\app-debug.apk
查看更多
可以哭但决不认输i
4楼-- · 2019-01-07 05:43

I tried external project, with multiple apk.

The command from Studio, looked like

adb install-multiple -r ....

Solution -

  • select console
  • aste command with -t
查看更多
戒情不戒烟
5楼-- · 2019-01-07 05:45

The easiest to solve this, without reverting to an older gradle version is to add the '-t' option in the run configurations (for pm install).

testOnly='false' had no effect whatsoever. The error is caused by the alpha version of gradle plugin that makes debug APK 'for test only purposes'. The -t option allows such APK to be installed. Setting it in run configuration makes it automatically install you APK as usual.

查看更多
Fickle 薄情
6楼-- · 2019-01-07 05:46

For me it has worked execute the gradle task 'clean' (under :app, at Gradle pane, usually located at the right) and run again the project.

查看更多
男人必须洒脱
7楼-- · 2019-01-07 05:46

first remove the unstable version:

adb uninstall problematic-package-name

; and then reinstall the apk.

查看更多
登录 后发表回答