Flutter Commands Cheat Sheet

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

CommandDescription
flutter --versionDisplays the current Flutter SDK version installed on your system.
flutter devicesLists all connected devices or emulators available for running the app.
flutter channelShows the current Flutter release channel (e.g., stable, beta, dev, master) and allows switching between them.
flutter upgradeUpdates Flutter SDK to the latest version available on the current channel.
flutter doctorChecks your environment for missing dependencies, tools, or configurations needed to run Flutter.

📦 Project-Level Commands

CommandDescription
flutter cleanClears the build cache, temporary files, and artifacts. Run this before a fresh build.
flutter buildBuilds 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 devRuns a build variant (flavor) such as dev, staging, or prod.
flutter --bug-reportGenerates a report to help diagnose and debug Flutter-related issues.
flutter build apk -t lib/main.dart --releaseBuilds a release APK using the specified Dart entry point (main.dart).

📚 Dependency Management Commands

CommandDescription
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 getFetches all dependencies listed in pubspec.yaml.
flutter pub upgradeUpdates 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.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top