【问题标题】:Android 8 Bug: Starting apk installation via adb doesn't work, needs permission REQUEST_INSTALL_PACKAGESAndroid 8 Bug:通过 adb 启动 apk 安装不起作用,需要权限 REQUEST_INSTALL_PACKAGES
【发布时间】:2017-09-26 06:20:23
【问题描述】:

我需要在 android 8 手机上开始安装 apk,但这不应该是静默的(adb install)。行为应该就像用户触摸了设备上的 apk 文件一样。 在 android 8 之前,可以通过 adb 启动安装 apk,如下所示:

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

这在 android 8 上已经不可能了。根据日志文件,需要 android.permission.REQUEST_INSTALL_PACKAGES 权限。

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

我知道从 android 8 apps that requests installing other apps needs this permission 开始,但这不应该通过 adb 来实现,对吧?

这是 android 8 中的错误吗?是否有可能以其他方式做到这一点?

【问题讨论】:

    标签: android installation apk android-8.0-oreo packageinstaller


    【解决方案1】:

    尝试在 Manifest 中添加

    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-07-29
      • 2014-03-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-21
      • 2022-07-15
      相关资源
      最近更新 更多