Skip to content

Cookbook

Antoinegtir edited this page May 20, 2026 · 1 revision

Cookbook

Recipes for common flutter-cli workflows.


Multi-device hot reload

Run on every connected device at once:

flutter-cli run -d all

Press r to hot-reload all devices simultaneously. Use Tab to focus a single device panel and r to reload only that one.


Screenshots on all devices

While the TUI is running, press s to take a screenshot of the focused device. Screenshots land in screenshots/<device-id>/<timestamp>.png.

To automate screenshots across all devices from outside the TUI:

flutter-cli screenshot -d all --out screenshots/

Capture network traffic

  1. Start your app: flutter-cli run
  2. Press n to open the network inspector panel.
  3. Use your app to trigger the HTTP calls you care about.
  4. Press / to filter by URL substring (e.g., /api/v1).
  5. Press Enter on a request to expand headers and body.
  6. Press x to export everything as a HAR file for analysis in browser DevTools or HAR Viewer.

Inspect widget tree

With the TUI open, press i to enable the Flutter widget inspector overlay on the focused device. The VM Service URL is also shown in the panel header — paste it into your browser DevTools or IDE for deeper inspection.

Press d to print the full DevTools URL to the log.


Filter noisy logs

/  →  type a regex, e.g.  ERROR|WARN

Press / in the TUI, type your filter (plain string or regex), and press Enter. Only matching lines are shown. Press Esc to clear.

For permanent filtering, pass --log-filter on startup:

flutter-cli run --log-filter "ERROR|WARN"

Run with a specific flavor

flutter-cli run --flavor staging -- --dart-define=ENV=staging

Arguments after -- are forwarded verbatim to flutter run.


CI / headless mode (no TUI)

flutter-cli detects non-interactive terminals and falls back to plain log streaming automatically. You can also force it:

flutter-cli run --no-tui

Useful in CI where you want the multi-device orchestration but not the TUI renderer.


Open DevTools in browser

Press d inside the TUI to print the VM Service / DevTools URL for the focused device. Then open it in your browser, or press D (capital) to have flutter-cli open it for you via flutter pub global run devtools.


Reload on file save (watch mode)

flutter-cli run --watch

Triggers hot reload automatically whenever a Dart file in lib/ changes. Uses filesystem events — no polling.

Clone this wiki locally