Android 8 Bug: Starting apk installation via adb doesn't work, needs permission REQUEST_INSTALL_PACKAGES
Asked Answered
P

1

7

I need to start the installation of an apk on an android 8 phone, but this should not be silent (adb install). The behavior should be as if the user has touched the apk file on the device. Before android 8 it was possible to launch the installation of an apk by adb like this:

adb shell am start -d file:"///sdcard/foobar.apk" -p com.google.android.packageinstaller

This is not possible anymore on android 8. According to the log file the permission android.permission.REQUEST_INSTALL_PACKAGES is necessary.

09-25 16:39:55.691  6066  6066 E InstallStart: Requesting uid 2000 needs to declare permission android.permission.REQUEST_INSTALL_PACKAGES

I know that since android 8 apps that requests installing other apps needs this permission, but this shouldn't be the case by doing it via adb, right?

Is this a bug in android 8? Is it somehow possible to do it in an other way?

Parasitize answered 26/9, 2017 at 6:20 Comment(0)
I
12

Try adding in Manifest

<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
Inbound answered 27/3, 2018 at 14:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.