fluttermacosdebuggingvisual-studio-codewifi

How to connect device over Wifi in VScode on Mac to debug Flutter app?


I would like to be able to use WIFI to debug my Flutter app on VScode. I am using a mac and would not like to use the connection via USB


Solution

  • Updated May 2023 answer:

    Google released Flutter 3.10 in the Google IO event, after this Update, we can debug our Flutter app wirelessly in real-time with IOS devices.

    after testing this feature, I still prefer to use the simulator because it's faster than a real device. anyway, it was an interesting update.


    Old answer: You can't debug wireless in Visual Studio Code with iPhone and Mac.

    You should run your project with Xcode to use the wireless option, but you lose the hot reload option after that.

    So, it's impossible to debug an app with hot reload and wireless at the same time :(

    To run the Flutter project with Xcode :

    1. Open your project in VSCode
    2. Click right on iOS folder
    3. Select the Open in Xcode option
    4. Xcode will run your iOS Runner
    5. If you have any errors in Xcode - see this link from the Flutter documentation