0
0
FlutterHow-ToBeginner Ā· 3 min read

How to Run a Flutter App: Step-by-Step Guide

To run a Flutter app, first ensure you have Flutter installed and a device or emulator ready. Use the flutter run command in your project folder to launch the app on the connected device or emulator.
šŸ“

Syntax

The basic command to run a Flutter app is flutter run. This command builds your app and installs it on a connected device or emulator.

  • flutter run: Starts the app on the default connected device.
  • flutter run -d device_id: Runs the app on a specific device if multiple are connected.
  • flutter run --release: Runs the app in release mode for better performance.
bash
flutter run
šŸ’»

Example

This example shows how to run a Flutter app on an Android emulator or physical device after navigating to your project folder.

bash
cd my_flutter_app
flutter run
Output
Launching lib/main.dart on Android SDK built for x86 in debug mode... Running Gradle task 'assembleDebug'... āœ“ Built build/app/outputs/flutter-apk/app-debug.apk. Installing build/app/outputs/flutter-apk/app-debug.apk... Waiting for Android SDK built for x86 to report its views... Syncing files to device Android SDK built for x86... Flutter run key commands. 'R' Hot reload. 'Q' Quit.
āš ļø

Common Pitfalls

Common mistakes when running Flutter apps include:

  • Not having a device or emulator connected or running.
  • Forgetting to navigate to the Flutter project folder before running commands.
  • Not accepting Android licenses or missing SDK setup.
  • Using outdated Flutter versions causing build errors.

Always check flutter doctor to verify your setup before running.

bash
flutter run
# Wrong: running outside project folder causes error

cd my_flutter_app
flutter run
# Right: run inside project folder
šŸ“Š

Quick Reference

Summary tips for running Flutter apps:

  • Use flutter doctor to check your environment.
  • Start an emulator or connect a device before running.
  • Navigate to your project folder in the terminal.
  • Run flutter run to launch the app.
  • Use hot reload with r key during run to see changes instantly.
āœ…

Key Takeaways

Run your Flutter app using the command flutter run inside your project folder.
Make sure a device or emulator is connected and ready before running the app.
Use flutter doctor to verify your Flutter setup and fix issues.
Navigate to your project directory in the terminal before running commands.
Use hot reload during development by pressing r in the running app console.