报错信息:
ERROR: Could not connect to lockdownd, error code -17
找不到模拟器或者真机设备。这个问题应该是flutter SDK更新后引起的。
解决办法:修改lockdown
文件夹的读写权限
- 点击屏幕空白位置或者
finder(访达)
> 前往 > 前往文件夹 > 输入/var/db/
找到lockdown
文件 > 右键显示简介 > 点击底部共享与权限
> 点击右下角的锁输入密码解锁 > 点击共享与权限
下面的加号,将自己账号添加到权限列表中,修改为读与写
> 最后锁定权限即可。
- 接下来依次在终端执行下方命令
brew update
brew uninstall --ignore-dependencies libimobiledevice
brew uninstall --ignore-dependencies usbmuxd
brew install --HEAD usbmuxd
brew unlink usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller
执行brew install --HEAD libimobiledevice
命令报错:
Error: An exception occurred within a child process:
DownloadError: Failed to download resource "libimobiledevice"
Failure while executing; `git clone --branch master https://git.libimobiledevice.org/libimobiledevice.git /Users/huanghaipo/Library/Caches/Homebrew/libimobiledevice--git` exited with 128. Here's the output:
Cloning into '/Users/huanghaipo/Library/Caches/Homebrew/libimobiledevice--git'...
fatal: unable to access 'https://git.libimobiledevice.org/libimobiledevice.git/': Failed to connect to git.libimobiledevice.org port 443: Operation timed out
解决办法:
打开科学上网软件,但是还是报错。但是第三次去执行brew install --HEAD libimobiledevice
命令成功了。当时科学上网软件在打开着,很有可能是网速的问题。或者说多执行几次这个命令
Error: An exception occurred within a child process:
DownloadError: Failed to download resource "libimobiledevice"
Failure while executing; `git clone --branch master https://git.libimobiledevice.org/libimobiledevice.git /Users/huanghaipo/Library/Caches/Homebrew/libimobiledevice--git` exited with 128. Here's the output:
Cloning into '/Users/huanghaipo/Library/Caches/Homebrew/libimobiledevice--git'...
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
最后执行flutter doctor
命令检测,成功找到设备。