Flutter Commands
Flutter Commands
General Commands
flutter create <project_name>: Creates a new Flutter project.flutter run: Runs your Flutter app on an attached device or simulator.flutter devices: Lists all connected devices and available simulators.flutter doctor: Checks your environment and displays a report of the status of your Flutter installation, including dependencies like the Dart SDK.flutter upgrade: Upgrades your Flutter SDK to the latest version.flutter channel: Lists or switches Flutter channels.flutter config: Configures Flutter settings.flutter help: Displays help information for Flutter commands.
Development Commands
flutter analyze: Analyzes the project's Dart code and checks for errors and warnings.flutter test: Runs tests in a project.flutter pub get: Fetches the dependencies listed in yourpubspec.yamlfile.flutter pub upgrade: Upgrades the dependencies to the latest versions that are compatible with your project.flutter pub outdated: Displays outdated package dependencies.flutter pub add <package>: Adds a package to yourpubspec.yamlfile.flutter pub remove <package>: Removes a package from yourpubspec.yamlfile.
Building Commands
flutter build apk: Builds the Android APK file.flutter build appbundle: Builds the Android App Bundle file.flutter build ios: Builds the iOS application.flutter build web: Builds the web version of the application.flutter build macos: Builds the macOS application.flutter build windows: Builds the Windows application.flutter build linux: Builds the Linux application.flutter build aar: Builds the Android AAR file.flutter build bundle: Builds the Flutter assets directory from your app.flutter build ipa: Builds the iOS IPA file.
Deployment Commands
flutter install: Installs the Flutter app on an attached device.flutter drive: Runs integration tests on an attached device or simulator.flutter attach: Attaches to a running application.
Configuration and Cleanup Commands
flutter clean: Cleans the project by deleting the build directory, which can help resolve build issues.flutter precache: Populates the Flutter tool's cache of binary artifacts.flutter update-packages: Updates thepubspec.yamlfiles with dependencies that satisfy the version constraints.
Performance and Profiling Commands
flutter trace: Starts tracing on the attached device.flutter logs: Shows the logs from a connected device.flutter screenshot: Takes a screenshot from a connected device.flutter run --profile: Runs the Flutter app in profile mode.flutter run --release: Runs the Flutter app in release mode.flutter run --debug: Runs the Flutter app in debug mode (default mode).
Tooling and Plugins Commands
flutter format: Formats your Dart code.flutter gen-l10n: Generates localizations for your project.flutter pub run: Runs a Dart script in your package.flutter pub run build_runner build: Runs the build runner to generate code.flutter downgrade: Downgrades Flutter to the last active version.
Miscellaneous Commands
flutter analyze --watch: Continuously runs analysis as files change.flutter symbolize: Symbolizes a stack trace from an AOT compiled Flutter app.flutter upgrade --force: Forces an upgrade of your Flutter SDK.flutter pub cache repair: Reinstalls previously downloaded packages.flutter version: Displays the current version of the Flutter SDK.flutter pub deps: Shows dependency information for the current project.flutter pub global activate <package>: Activates a package from pub.dev globally.flutter pub global deactivate <package>: Deactivates a globally activated package.flutter gen-l10n: Generates Dart localization files from .arb files.flutter attach: Attaches to a running instance of the Flutter application.flutter pub outdated --mode=null-safety: Lists outdated packages with null-safety support.flutter pub cache clean: Clears the pub cache directory.