“无法连接到已锁定"尝试运行Flutter应用程序时 [英] "Could not connect to lockdownd" while attempting to run flutter app

查看:150
本文介绍了“无法连接到已锁定"尝试运行Flutter应用程序时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注入门教程.

我可以安装所有内容,flutter doctor返回所有选中标记,但最后显示一条消息:

I can install everything, flutter doctor returns all checkmarks but in the end there is a message:

idevice_id返回错误:
错误:无法连接到锁定状态,错误代码-2

idevice_id returned an error:
ERROR: Could not connect to lockdownd, error code -2

如果尝试使用flutter run运行应用程序,或者尝试使用flutter devices列出设备,则会出现相同的消息.

Same message appears if I try to run the app using flutter run or if I try to list the devices using flutter devices.

本教程还指出:

注意:如果运行&调试按钮被禁用,并且未列出任何目标,Flutter无法发现任何已连接的iOS或Android设备或模拟器.您需要连接设备或启动模拟器才能继续

Note: If the Run & Debug buttons are disabled, and no targets are listed, Flutter has not been able to discover any connected iOS or Android devices or simulators. You need to connect a device, or start a simulator, to proceed

我列出了两台设备,其中列出了我的Android手机和一个iPhone模拟器. RunDebug按钮已启用!

I have two devices listed my Android phone and an iPhone simulator. Run and Debug buttons are ENABLED!

如何使用Flutter运行我的应用程序?可以使用命令行或IntelliJ IDE.

How can I run my app using flutter? It can be either using the command line or IntelliJ IDE.

推荐答案

断开所有iOS设备的连接,然后:

Disconnect all iOS devices, then:

brew uninstall ideviceinstaller
brew uninstall libimobiledevice
brew install --HEAD libimobiledevice
brew link --overwrite libimobiledevice
brew install --HEAD  ideviceinstaller
brew link --overwrite ideviceinstaller
sudo rm -rf /var/db/lockdown/*

连接iOS设备,然后在出现提示时选择信任":

Connect an iOS device, and choose "Trust" when prompted, after that:

sudo chmod -R 777 /var/db/lockdown/

这篇关于“无法连接到已锁定"尝试运行Flutter应用程序时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆