我昨天买了一台小米Redmi 4x,我无法在这个设备上调试我的应用程序.
我已经启用了设备中的开发者选项,打开了USB调试,安装了USB驱动程序并接受了我第一次将其插入USB端口时出现的RSA调试指纹弹出窗口.
因此,我在Visual Studio的设备列表中选择“小米Redmi 4X(Android 6.0 – API 23)”,单击“运行”(或部署)并看到此错误:
>Detecting installed packages... >Removing old runtime: Mono.Android.DebugRuntime... >Target device is arm64-v8a. >Installing the Mono shared runtime (debug - 1505313604)... >10% ... 3520kb of 35035kb copied >20% ... 7040kb of 35035kb copied >30% ... 10560kb of 35035kb copied >40% ... 14016kb of 35035kb copied >50% ... 17536kb of 35035kb copied >60% ... 21056kb of 35035kb copied >70% ... 24576kb of 35035kb copied >80% ... 28032kb of 35035kb copied >90% ... 31552kb of 35035kb copied >100% ... 35035kb of 35035kb copied > Deployment Failed >Mono.AndroidTools.InstallFailedException: Unexpected install output: pkg: /data/local/tmp/Mono.Android.DebugRuntime-debug.apk >Failure [INSTALL_CANCELED_BY_USER] > > at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output,String packageName) > at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass94_0.<InstallPackage>b__0(Task`1 t) > at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke() > at System.Threading.Tasks.Task.Execute() >Unexpected install output: pkg: /data/local/tmp/Mono.Android.DebugRuntime-debug.apk >Failure [INSTALL_CANCELED_BY_USER] > >Creating "obj\Debug\upload.flag" because "AlwaysCreate" was specified. >Creating directory "obj\.cache\". >Done building project "MyTestApp.csproj". >Build succeeded. >An error occured. See full exception on logs for more details. >Unexpected install output: pkg: /data/local/tmp/Mono.Android.DebugRuntime-debug.apk >Failure [INSTALL_CANCELED_BY_USER] > > ========== Build: 1 succeeded,0 Failed,0 up-to-date,0 skipped ========== ========== Deploy: 0 succeeded,1 Failed,0 skipped ==========
这适用于我的所有应用程序,只是在这个小米设备中.在其他品牌的设备和模拟器中,调试正常.
只是为了补充,我有这个问题http://en.miui.com/thread-544718-1-1.html甚至按照说明,我不能使“通过USB安装”的工作.
在这个设备中有任何调试解决方案吗?
解决方法
只是为了帮助那些有同样问题的人:它与“通过UBS安装”选项完全相关,MIUI不会让我激活.经过多次尝试和重新启动设备后,它最终被激活并且部署同时工作.