Commit 72d0e0b4 authored by Danny Tuppeny's avatar Danny Tuppeny Committed by Danny Tuppeny

Add text explaining how to run an emulator

parent 20a2a202
...@@ -55,8 +55,10 @@ class EmulatorsCommand extends FlutterCommand { ...@@ -55,8 +55,10 @@ class EmulatorsCommand extends FlutterCommand {
if (emulators.isEmpty) { if (emulators.isEmpty) {
printStatus("No emulator found that matches '$id'."); printStatus("No emulator found that matches '$id'.");
} else if (emulators.length > 1) { } else if (emulators.length > 1) {
printStatus("More than one emulator matches '$id':\n"); _printEmulatorList(
Emulator.printEmulators(emulators); emulators,
"More than one emulator matches '$id':",
);
} else { } else {
await emulators.first.launch(); await emulators.first.launch();
} }
...@@ -75,9 +77,17 @@ class EmulatorsCommand extends FlutterCommand { ...@@ -75,9 +77,17 @@ class EmulatorsCommand extends FlutterCommand {
'You may need to create one using Android Studio ' 'You may need to create one using Android Studio '
'or visit https://flutter.io/setup/ for troubleshooting tips.'); 'or visit https://flutter.io/setup/ for troubleshooting tips.');
} else { } else {
printStatus( _printEmulatorList(
'${emulators.length} available ${pluralize('emulator', emulators.length)}:\n'); emulators,
Emulator.printEmulators(emulators); '${emulators.length} available ${pluralize('emulator', emulators.length)}:',
);
} }
} }
void _printEmulatorList(List<Emulator> emulators, String message) {
printStatus('$message\n');
Emulator.printEmulators(emulators);
printStatus(
"\nTo run an emulator, run 'flutter emulators --launch <emulator id>'.");
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment