14

Whilst running my app using flutter run in the console I can press 'r' to do a reload and press 'R' to do a reload and restart. Is there a way to do this whilst debugging in VS Code? Saving a file causes a hot reload but I can't figure out a way to do a full restart.

Edit

This is a little bit different to the hot reload option so I don't think this is a duplicate. This question regards performing a full restart of the application without reinstalling it. This is possible by pressing a capital R in the console, as opposed to pressing a lowercase r in the console which would perform a hot reload.

1

2 Answers 2

13

When debugging you can press Ctrl+F5 for a full restart, or you can run the Flutter: Full Restart command from the VS Code's command palette (Ctrl+Shift+P or Cmd+Shift+P for macOS).

Note: In the next version (v2.13.0, which there's a beta of available) "Full Restart" has been renamed to "Hot Restart" to better reflect how it works (this is happening across the other Flutter tools and docs too).

Related info:

2
  • perfect :-) the command pallette seems to be what I was missing most
    – atreeon
    Commented May 23, 2018 at 16:21
  • It's super useful! Makes it really fast to do so many things without need keybindings for them all! It also shows the key-bindings for things that have them, so a good way to learn them while you're still using the palette to run stuff :) Commented May 23, 2018 at 20:19
5

The chosen answer wasn't working for me with Flutter 1.2.1 so I used this solution:

  1. get the Flutter extension
  2. search for dart.flutterDebuggerRestartBehaviour in VS Code settings and set it to hotRestart
  3. start the debugger (F5) and click the restart button when you want to hot restart:

    enter image description here

5
  • Upvoted for your trick. But, another question is "how to manage the hotReload?" Commented Mar 10, 2019 at 10:18
  • Sorry for the misunderstanding, my English is not so good. I mean, if we use dart.flutterDebuggerRestartBehaviour = hotRestart then how do I do the` hotReload` action. Because the hotRestart process will redirect us to the start page of the application. Commented Mar 12, 2019 at 7:59
  • 2
    FYI, its not 'Flutter 1.2.1' problem, but VSCode. This problem appears after I have upgraded to version 1.32, Commented Mar 12, 2019 at 8:01
  • 1
    I see. In my case I just save the file and the reload-level changes are reflected on the device.
    – galki
    Commented Mar 12, 2019 at 8:27
  • +1 for this another trick. Since I've disabled the Flutter Hot Reload on save feature, then I am never thought this will work. Thank you very much, dude. Commented Mar 18, 2019 at 9:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.