執行flutter run命令報錯::ERROR: Could not connect to lockdownd, error code -17

騎馬縱天下發表於2020-02-28

報錯資訊:

ERROR: Could not connect to lockdownd, error code -17
複製程式碼

找不到模擬器或者真機裝置。這個問題應該是flutter SDK更新後引起的。

解決辦法:修改lockdown資料夾的讀寫許可權

修改資料夾許可權

  1. 點選螢幕空白位置或者finder(訪達) > 前往 > 前往資料夾 > 輸入/var/db/找到lockdown檔案 > 右鍵顯示簡介 > 點選底部共享與許可權 > 點選右下角的鎖輸入密碼解鎖 > 點選共享與許可權下面的加號,將自己賬號新增到許可權列表中,修改為讀與寫 > 最後鎖定許可權即可。

  2. 接下來依次在終端執行下方命令

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命令檢測,成功找到裝置。

相關文章