Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 258
kobayashi Avatar asked Sep 26 '17 06:09

kobayashi


1 Answers

Try adding in Manifest

<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
like image 197
Al Cabone Avatar answered Nov 12 '22 06:11

Al Cabone