这是一个可怕的错误

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]

其他回答

If above answer didn't work for you as it didn't work for me on my Xiaomi Mi5.I tried to figure out the Core reason behind it and solve it. In MIUI, in order to change "Install via USB" option, you must be connected to the internet and signed in your Mi account. Due to some reason, requests from out of the China servers are getting rejected, so I connected to one open China VPN and tried again to enable 'Install via USB' and I got success. For detailed solution and VPN details, see this useful Youtube video: https://youtu.be/MeKUJlD-Ke4

它很简单,在MIUI 9中。x你需要显影器设置为ON,然后

>(系统和设备部分)附加设置->开发人员选项

(调试部分)

打开“USB调试” 打开“通过USB安装”

然后在Android选择Runb应用程序,选择你的小米手机

编辑:您还需要允许从未知来源安装

打开usb调试 打开USB安装:-> 当打开它要求mi帐户登录,你可以得到即时otp vis短信服务快速登录。 关闭MIUI优化。

更多详细视频

1) Turn ON Developer Options
2) Turn ON USB Debugging
3) Turn OFF MIUI optimization
4) Turn ON Install via USB

YouTube视频,以获得更直观的理解

For MIUI 12:

开发人员选项(开启) USB调试(开) 通过USB安装(开启)。 允许“Android系统”从未知应用程序安装。(如果在列表中看不到,请尝试“More/Show system”。)

这对我有用,但得到了一个android安全警告。