flutter/docs/tool/The-flutter-run-variants.md
Kate Lovett 6332ff6690
[wiki migration] Tool team pages (#148779)
This puts the wiki pages owned by the Tool team into the docs/tool directory as planned in [flutter.dev/go/migrate-flutter-wiki-spreadsheet](https://docs.google.com/spreadsheets/d/1x65189ZBdNiLRygpUYoU08pwvXD4M-Z157c6pm8deGI/edit?usp=sharing) 

It also adds the tool team labels to the label bot for future PRs.

Changes to the content were only updating cross links, or link to refer to the main branch rather than master.
Remaining links to the wiki will be updated once all other pages have finished moving, they still work in the meantime.

Part of https://github.com/flutter/flutter/issues/145009
2024-05-22 16:58:49 +00:00

1.3 KiB

The flutter run variants

We aspire to reach a state where flutter run has the following modes:

  • flutter run: builds a debug version of the app and starts it in "hot reload" mode, then shows the console UI to manipulate the running instance.
  • flutter run --no-hot: builds a debug version of the app and starts it directly, then shows the console UI to manipulate the running instance.
  • flutter run --profile: builds a profile version of the app and starts it directly, then shows the console UI to manipulate the running instance.
  • flutter run --release: builds a release version of the app and starts it directly, then shows the console UI to manipulate the running instance.

Adding --machine in any of the situations above spawns a flutter daemon which:

  • changes the output to JSON so that it can be more easily consumed by IDEs, and
  • allows the use of JSON commands to interact with the running application (e.g. stopping the application).

All of the commands above launch a Flutter application and do not return until that Flutter application exits. Adding --no-resident in any of the situations causes the command to return immediately after the application has been launched rather than waiting until the application exits.