美文网首页iOS程序猿
执行flutter run命令报错::ERROR: Could

执行flutter run命令报错::ERROR: Could

作者: 骑马纵天下 | 来源:发表于2020-02-28 17:28 被阅读0次

    报错信息:

    ERROR: Could not connect to lockdownd, error code -17
    

    找不到模拟器或者真机设备。这个问题应该是flutter SDK更新后引起的。

    解决办法:修改lockdown文件夹的读写权限

    修改文件夹权限
    1. 点击屏幕空白位置或者finder(访达) > 前往 > 前往文件夹 > 输入/var/db/找到lockdown文件 > 右键显示简介 > 点击底部共享与权限 > 点击右下角的锁输入密码解锁 > 点击共享与权限下面的加号,将自己账号添加到权限列表中,修改为读与写 > 最后锁定权限即可。
    1. 接下来依次在终端执行下方命令
    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命令检测,成功找到设备。

    相关文章

      网友评论

        本文标题:执行flutter run命令报错::ERROR: Could

        本文链接:https://www.haomeiwen.com/subject/qsnlhhtx.html