Introduction
When debugging Flutter apps, the CLI is more than just a launcher—it’s a powerful interface to logs, profiles, and dev tools. This tutorial dives into advanced Flutter CLI techniques that boost your diagnosis speed and clarity. You’ll learn to enable granular logs, profile performance, connect to Observatory remotely, and streamline hot reload automation. No fluff—just actionable commands and minimal code snippets to integrate into your workflow.
Enabling Detailed Logs with --verbose
By default, flutter run displays essential output. Adding --verbose surfaces every asset load, plugin registration, and toolchain event. This level of detail helps trace failures in build scripts, identify missing resources, or pinpoint channel handshake issues.
Run:
You can also filter logs by severity. Use grep or PowerShell’s Select-String to isolate ERROR or WARNING lines:
flutter run --verbose | grep ERROR
For timestamped logs, override debugPrint in your main.dart:
import 'package:flutter/foundation.dart';
void main() {
debugPrint = (String? message, {int? wrapWidth}) {
final ts = DateTime.now().toIso8601String();
print('$ts: $message');
};
runApp(MyApp());
}This snippet tags each log with an ISO timestamp, simplifying correlation with system logs or backend traces.
Profiling Flutter Apps
Flutter’s profile mode strikes a balance between speed and instrumentation. Use it to collect timeline traces without debug overhead:
flutter run --profile --trace-skia
--trace-skia captures GPU commands, highlighting rendering bottlenecks. To generate a CPU/GPU timeline file for DevTools:
flutter run --profile --trace-startup --dart-flags="--enable-vm-service=0"
Once running, open DevTools from the CLI:
flutter pub global run devtools --port=9100
Navigate to http://127.0.0.1:9100 and import the timeline .json generated under build/ or exported via the Observatory UI. You’ll see frame build times, rasterizer workloads, and jank spikes.
Using Observatory and DevTools via CLI
Observatory (Dart VM Service) exposes breakpoints, heap snapshots, and remote debug controls. Launch your app with a fixed port and host binding:
flutter run --observatory-port=8181 --disable-service-auth-codes
Then forward to other devices or VMs via SSH:
ssh -L 8181:localhost:8181 user@remote-host
Open DevTools against localhost:8181. You can set breakpoints, step through native async calls, and inspect GC events directly from a remote workstation. If you need pure CLI interaction, use dart dev tools commands:
dart devtools attach --port=8181
This workflow is ideal for CI environments or headless test rigs where GUI is limited.
Automating Hot Reload & Restart
Hot reload and restart are CLI staples. Combine them with file watchers (like entr on Unix) for zero-effort iteration:
find lib -type f | entr -c flutter run --hot
Alternatively, create a shell script flutter_watch.sh:
#!/usr/bin/env bash
flutter run --start-paused &
PID=$!
fswatch -o lib/ | while read; do
kill -CONT $PID # resume if paused
flutter reload
done
This script starts the app paused, then listens for file changes to trigger flutter reload. Customize signals or replace fswatch with inotifywait on Linux or Watchman on macOS.
Vibe Studio

Vibe Studio, powered by Steve’s advanced AI agents, is a revolutionary no-code, conversational platform that empowers users to quickly and efficiently create full-stack Flutter applications integrated seamlessly with Firebase backend services. Ideal for solo founders, startups, and agile engineering teams, Vibe Studio allows users to visually manage and deploy Flutter apps, greatly accelerating the development process. The intuitive conversational interface simplifies complex development tasks, making app creation accessible even for non-coders.
Conclusion
Mastering Flutter’s CLI features accelerates debugging and profiling, whether you’re troubleshooting local builds or remote test devices. Leveraging --verbose, profile mode flags, Observatory port forwarding, and automated reload scripts transforms your workflow into a precise, code-centric loop. Integrate these tips into your IDE or CI pipelines for a robust diagnostic setup that keeps you shipping high-quality mobile applications.