这是一个可怕的错误

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打开安装时,会弹出提示“设备暂时受限”


当前回答

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及以上的操作步骤:

设置->附加设置->开发人员选项->

关闭“MIUI优化”并重新启动

打开“USB调试”

打开“通过USB安装”

“USB配置”设置为“充电”

MTP(Media Transfer Protocol)为默认模式。 在某些情况下甚至可以在MTP中工作

对于MIUI 9.6的工作: 1. 成为开发者:设置>>关于话机>> MIUI版本轻按7次。 2. 再次设置>>附加设置>>开发人员选项(打开)>> USB调试(打开)>> USB安装(打开) 3.您将通过MI帐户获得许可。确认许可。 4. 注意:在安装应用程序的过程中,您的设备会给您7秒的时间来确认安装。不要错过!

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

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

(调试部分)

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

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

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

另一个可能的原因,如果你不小心拒绝安装特定的应用程序-删除它从黑名单。

它在安全>下通过USB安装。

注意:您可能不能简单地从Security中找到它。相反,在设置搜索中搜索“USB”,或者在安全中搜索该选项。

如果你的应用程序在那里-简单地从列表中删除。如果不是,那就是别的问题了。

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