Android runInstallCreate from pm command asks to run as user -1 but is calling from user 0

android使用pm静默安装

pm install -i “包名” -r apkPath

提示错误:

Android runInstallCreate from pm command asks to run as user -1 but is calling from user 0

随后查资料说是加上--user 0 

pm install -i “包名” --user 0 -r apkPath

返回了一个Failure [null]错误

Failure [null]:**********************
最后去查了pm安装的配置,
需要在AndroidManifest -> manifest中加上android:sharedUserId="android.uid.system",sharedUserId一致的apk允许静默安装。
最后测试我是发行成release版本测试。
安装成功!

 

posted @ 2022-12-16 16:50  HelloWord_wuxuemin  阅读(253)  评论(0编辑  收藏  举报