0

I'm trying to do Hot Reload when running flutter code from xcode but nothing I seem to do works.

I see a console within xcode. I can see my logs there but I don't see the normal "Flutter run commands" output. When I type "r" or "R" there it just writes "r" or "R" with no change to my running app.

I have tried running flutter run from the terminal and I also can't type "r" or "R" without it only typing that letter into the console.

I can do do hot reload via VSCode but I'm running into this issue (I can temporarily fix this issue but it comes up every other build).

2 Answers2

1

I was able to debug my flutter code that was ran from xcode by attaching a flutter debugger.

I had to use VScode to attach the debugger. I installed the flutter extension. Second, I searched for the commend Flutter: Attach to Flutter on Device. Once you have that running, there are options to click to hot reload or hot restart.

0

The Xcode console doesn't work the way you're trying to do so. Here are a few commands to Clean, Build and Run Xcode Project. Also there is no hot reload in Xcode. You can simply use these commands anywhere in Xcode except Console.

Shift + CMD + K to clean.

CMD + B to build.

CMD + R to run.

אורי orihpt
  • 2,358
  • 2
  • 16
  • 41
NaveedUlHassan5
  • 235
  • 1
  • 14
  • This is a flutter-specific question. Please verify that the provided answer is for flutter projects. – Alexander Price Oct 15 '22 at 18:17
  • (2) "You see a console within Xcode and you're writing commands in it expecting to see some output", I have answered it before, and I'll say it again, the Xcode Console doesn't work like that. You can't Hot reload flutter projects from Xcode Console either. So you're wrong again. – NaveedUlHassan5 Oct 18 '22 at 07:18
  • (3) Here are steps to run flutter builds from Mac Terminal. First give project path like cd document/flutter/myporject whatever your project path is. then," flutter pub get", then, "open -a Simulator" to open a simulator if device is not connected, then "flutter run", let it take its time to install pods and stuff, and once the project is running on Simulator/Device, then you can atomically see different commands on Mac terminal like press R to hot reload and etc. – NaveedUlHassan5 Oct 18 '22 at 07:26
  • Is it possible that the two of you do not agree on what exactly is meat by "hot reload flutter from/via xcode"? What could be observed in case of successfully doing that? What are the symptoms of it currently failing? – Yunnosch Oct 21 '22 at 07:23
  • 1
    Thanks for the feedback @Yunnosch. I have updated my question to hopefully be more clear. I've also submitted an answer that hopefully helps others in the future. – Alexander Price Oct 21 '22 at 07:50