5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Flutter iOS実機での開発で "Lost connection to device" が出る場合の対処

Posted at

Flutter でiOSの実機での開発起動(flutter run)しようとすると、アプリが起動した直後に接続が切れてしまうことがあります。以下のようなエラーが出ます。

An Observatory debugger and profiler on My iPhone is available at: http://127.0.0.1:1025/
For a more detailed help message, press "h". To detach, press "d"; to quit, press "q".
Service protocol connection 
Lost connection to device.
DevFS: Deleting filesystem on the device (file:///private/var/mobile/Containers/Data/Application/.../)
Sending to VM service: _deleteDevFS({fsName: myapp})
Ignored error while cleaning up DevFS: TimeoutException after 0:00:00.250000: Future not completed

接続が切れると、ホットリロードができなくなってしまいます。


これは iOS の開発に使っている libusbmuxd というツールのバグのようです。

このバグが修正されるまでは、特定のバージョンの libusbmuxd を使う必要があり、Flutterの Issue #35102 のコメント で以下のようなワークアラウンドが紹介されていました。

brew uninstall --ignore-dependencies usbmuxd libimobiledevice ideviceinstaller
brew tap flutter/flutter https://flutter-mirrors.googlesource.com/homebrew-flutter
brew install --HEAD usbmuxd-flutter libimobiledevice-flutter ideviceinstaller-flutter

上記のような感じで usbmuxd libimobiledevice ideviceinstaller の3つを入れ直すと動くようになると思います。

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?