Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run flutter app on multiple connected devices/emulators simultaneously [duplicate]

Tags:

flutter

How can I run my flutter app on multiple devices at the same time without having to go through the sequential procedure of: select a device -> run, select other device -> run, etc.?

Using: Android Studio 3.2.1 Flutter 1.0.0 Dart 2.1.0

like image 932
Oliver Metz Avatar asked Feb 05 '19 04:02

Oliver Metz


1 Answers

Run command in terminal:

flutter run -d all 

or create a script (e.g. runall.sh in root):

#!/usr/bin/env bash
flutter run -d all

and go to "Run" -> "Edit Configurations". Press "+" in upper left corner -> select "Bash". Then set:

  • Name: runall
  • Script: [path to runall.sh script]
  • Interpreter Path: /bin/bash

Select "runall" instead of "main.dart" beside run icon. Performing run (also through shortcut) will now run app on all devices.

Drawback: You'll have to enter "r" followed by Enter in run terminal for hot reload. Icon and shortcut does not work. Hot reload is performed on all devices though.

Just a workaround for now. I'm pretty sure the flutter plugin will cover this soon.

like image 199
Oliver Metz Avatar answered Oct 25 '22 09:10

Oliver Metz