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 {
if (emulators.isEmpty) {
printStatus("No emulator found that matches '$id'.");
} else if (emulators.length > 1) {
printStatus("More than one emulator matches '$id':\n");
Emulator.printEmulators(emulators);
_printEmulatorList(
emulators,
"More than one emulator matches '$id':",
);
} else {
await emulators.first.launch();
}
......@@ -75,9 +77,17 @@ class EmulatorsCommand extends FlutterCommand {
'You may need to create one using Android Studio '
'or visit https://flutter.io/setup/ for troubleshooting tips.');
} else {
printStatus(
'${emulators.length} available ${pluralize('emulator', emulators.length)}:\n');
Emulator.printEmulators(emulators);
_printEmulatorList(
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