这是一个可怕的错误

Installation failed with message Failed to finalize session : INSTALL_FAILED_USER_RESTRICTED: Install canceled by user.
It is possible that this issue is resolved by uninstalling an existing version of the `apk` if it is present, and then re-installing.

WARNING: Uninstalling will remove the application data!

Do you want to uninstall the existing application?

当试图在我的红米4 MIUI 8.5.4.0中运行apk时

启用OEM解锁

解决方案尝试

MIUI优化关闭 打开USB调试 通过打开USB验证应用程序

注意:当通过USB打开安装时,会弹出提示“设备暂时受限”


当前回答

那么您必须启用开发人员模式

设置->附加设置->

USB调试:设置为ON 通过USB安装:设置为ON(要做到这一点,您必须插入sim卡,否则您将无法安装 能够启用它)

[![enter image description here][1]][1]

[![enter image description here][2]][2]

其他回答

在开发人员选项中禁用模拟SD卡优化 关闭“开启MIUI优化” 标记强制关闭的应用程序

这些设置对我有用。

如果你仍然面临INSTALL_FAILED_USER_RESTRICTED问题,试试这个 这个方法适合我在miui 13中使用 设置->权限->通过USB安装->取消你的应用程序

那么您必须启用开发人员模式

设置->附加设置->

USB调试:设置为ON 通过USB安装:设置为ON(要做到这一点,您必须插入sim卡,否则您将无法安装 能够启用它)

[![enter image description here][1]][1]

[![enter image description here][2]][2]

对我来说,只有从谷歌驱动器安装才能工作。

要打开“通过USB安装”和“USB调试(安全更改)”,需要登录到小米帐户,然后这两个可以打开,并与红米作为开发人员一起工作

注意:当打开USB调试(安全更改)时,会弹出一些安全警报,所有安全警报都需要接受才能在开发人员模式下工作