"Cannot Debug iOS Wirelessly on Mac with Flutter (VS Code)"

iOS Wireless Debugging Stuck on App Initialization (Flutter, VS Code, Mac)

Issue:

I’m trying to debug a Flutter app wirelessly on my iPhone using VS Code on my Mac. My Mac and iPhone are successfully connected wirelessly, and when I run flutter run in the terminal, the app installs and launches on the iPhone without issues.

However, when I try to debug the app in VS Code, it installs but gets stuck during initialization and does not proceed further.

What I’ve Checked:

  • Developer settings are properly configured on both Mac and iPhone.
  • No firewall restrictions blocking any necessary ports.
  • When the app launches for the first time, I have granted permission for local network access.
  • Both Flutter and Xcode are up to date.
  • This issue only occurs with iOS wireless debugging. Android devices work fine with wireless debugging.

Has anyone encountered this issue before? Any suggestions on how to fix it?

Is this turned on? It’s a little checkbox on top of the window (that is enabled only when the device is not connected through a cable - horrible Apple UI/UX, as usual).

https://chrisaydat.medium.com/how-to-enable-wireless-debugging-with-flutter-on-macos-390d86175f80

The wireless connection setting is enabled, and when I run the flutter run command, the app installs and runs on my iPhone wirelessly. However, wireless debugging is not working. I can’t figure out the reason.

The debugger is actually an HTTP server that works with websockets, if I’m not mistaken:

A Dart VM Service on iPhone 16e is available at: http://127.0.0.1:50927/OsKCWOsj3gs=/
The Flutter DevTools debugger and profiler on iPhone 16e is available at: http://127.0.0.1:9101?uri=http://127.0.0.1:50927/OsKCWOsj3gs=/

Your device must be able to connect using those endpoints. Maybe something is preventing it.

Another thing you should be aware: as usual, Apple f*** up us, developers: PSA: Do not update your development devices to iOS 18.4 - #2 by johnpryan

Check if you are using iOS >= 18.4

EDIT: From your phone, you should be able to call that http://address:50927/ and it should display a “missing or invalid authentication code”. If the iPhone can’t reach that URL, the debugger won’t be able to connect.

Thank you for your help. The issue hasn’t been completely resolved yet, but while testing a few things today, I discovered something strange.

I created a new Flutter project and didn’t modify anything.
1. The problem occurs more severely when debugging using the Flutter extension in VS Code. In this case, the app doesn’t reach the main screen and just stays on a white screen.
2. If I run flutter run --debug from the terminal, the app successfully reaches the main screen on my iPhone. Then, if I open a new terminal and enter flutter attach, I can debug wirelessly in a very inconvenient way (since I have to manually press r in the terminal every time I modify the code).

What could be causing this? I don’t understand what’s going on. Now, I’m even starting to wonder if this is happening because I installed Flutter via Homebrew.