If you’re starting with Flutter, knowing the right terminal
commands can save you hours of setup and debugging. These
commands help you create projects, run apps on devices, manage
dependencies, and prepare your builds for release:
█████████████████████████████████████
1. Check Flutter version
flutter –version
Example: Shows Flutter, Dart, and DevTools version
█████████████████████████████████████
2. Check setup & dependencies
flutter doctor
Example: Checks Xcode, Android Studio, devices, etc.
█████████████████████████████████████
3. Create a new Flutter project
flutter create my_app
Example: Generates a project in folder my_app
█████████████████████████████████████
4. Run your app
flutter run
Example: Runs on connected device or simulator
█████████████████████████████████████
5. Run on specific device
flutter run -d chrome
flutter run -d emulator-5554
Example: Launches on Chrome or Android emulator
█████████████████████████████████████
6. List connected devices
flutter devices
Example: Shows available emulators and devices
█████████████████████████████████████
7. Get dependencies
flutter pub get
Example: Installs packages from pubspec.yaml
█████████████████████████████████████
8. Add a new package
flutter pub add http
Example: Adds http to pubspec.yaml automatically
█████████████████████████████████████
9. Remove a package
flutter pub remove http
Example: Removes http from your project
█████████████████████████████████████
10. Build APK (Android)
flutter build apk –release
Example: Generates app-release.apk
█████████████████████████████████████
11. Build App Bundle (Play Store)
flutter build appbundle –release
Example: Generates .aab for Google Play
█████████████████████████████████████
12. Build for iOS
flutter build ios –release
Example: Creates iOS build (requires macOS & Xcode)
█████████████████████████████████████
13. Build for Web
flutter build web
Example: Generates web build in /build/web
█████████████████████████████████████
14. Clean project cache
flutter clean
Example: Deletes build cache to fix errors
█████████████████████████████████████
15. Analyze code
flutter analyze
Example: Reports errors, warnings, unused imports
█████████████████████████████████████
16. Format code
flutter format .
Example: Formats all Dart files in project
█████████████████████████████████████
17. Upgrade Flutter SDK
flutter upgrade
Example: Updates to latest stable version
█████████████████████████████████████
18. Switch Flutter channel
flutter channel stable
flutter channel beta
Example: Switches between channels
█████████████████████████████████████
19. Check outdated packages
flutter pub outdated
Example: Shows which dependencies need upgrade
█████████████████████████████████████
20. Update dependencies
flutter pub upgrade
Example: Upgrades all packages to the latest versions
By mastering these 20 Flutter commands, you’ll streamline your workflow and avoid common errors. Keep this list as a handy reference whenever you work on Flutter projects.
