You can run your Flutter project on an Android emulator and an iOS simulator at the same time by running this:
flutter run -d all
Note that you must start your Android emulator and iOS simulator before executing the command above.
Screenshot:
The output in the console will be similar to this:
Using hardware rendering with device sdk gphone x86. If you notice graphics artifacts, consider enabling software rendering with
"--enable-software-rendering".
Launching lib/main.dart on sdk gphone x86 in debug mode...
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 3.7s
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
Running Xcode build...
└─Compiling, linking and signing... 5.3s
Xcode build done. 11.7s
Waiting for sdk gphone x86 to report its views... 7ms
Waiting for iPhone 11 Pro Max to report its views... 1ms
Syncing files to device sdk gphone x86... 507ms
Syncing files to device iPhone 11 Pro Max... 187ms
Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h Repeat this help message.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
An Observatory debugger and profiler on sdk gphone x86 is available at: http://127.0.0.1:51428/m7lA7OKsAnQ=/
An Observatory debugger and profiler on iPhone 11 Pro Max is available at: http://127.0.0.1:51444/G75JXOyZEjY=/
Further reading:
- Flutter: SliverGrid example
- Create a Custom NumPad (Number Keyboard) in Flutter
- Environment Variables in Flutter: Development & Production
- Best Libraries for Making HTTP Requests in Flutter
- Using Stepper widget in Flutter: Tutorial & Example
- Flutter: Making Beautiful Chat Bubbles (2 Approaches)
You can also take a tour around our Flutter topic page and Dart topic page to see the latest tutorials and examples.