Flutter provides a rich set of command-line tools to manage SDKs, build configurations, and project workflows efficiently. Below is a categorized list of commonly used commands:
🧰 SDK-Level Commands
Command
Description
flutter --version
Displays the current Flutter SDK version installed on your system.
flutter devices
Lists all connected devices or emulators available for running the app.
flutter channel
Shows the current Flutter release channel (e.g., stable, beta, dev, master) and allows switching between them.
flutter upgrade
Updates Flutter SDK to the latest version available on the current channel.
flutter doctor
Checks your environment for missing dependencies, tools, or configurations needed to run Flutter.
📦 Project-Level Commands
Command
Description
flutter clean
Clears the build cache, temporary files, and artifacts. Run this before a fresh build.
flutter build
Builds the project for a specific platform (e.g., Android, iOS, Web, etc.).
flutter run (--verbose)
Runs the app on the connected device or emulator. Use --verbose to view detailed logs.
flutter run --flavor dev
Runs a build variant (flavor) such as dev, staging, or prod.
flutter --bug-report
Generates a report to help diagnose and debug Flutter-related issues.
flutter build apk -t lib/main.dart --release
Builds a release APK using the specified Dart entry point (main.dart).
📚 Dependency Management Commands
Command
Description
flutter pub add <package_name>
Adds a new dependency to your pubspec.yaml file and fetches it automatically. Example: flutter pub add shared_preferences
flutter pub get
Fetches all dependencies listed in pubspec.yaml.
flutter pub upgrade
Updates all dependencies to their latest compatible versions.
✅ Tip:
Use flutter help to see all available commands.
Combine --verbose with any command to get detailed diagnostic output for troubleshooting.