【发布时间】: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