[tools] Add column header for emulators information (#142853)

Add column information as table header for `flutter emulators` command.

**Before:**

```
2 available emulators:

Pixel_3_API_30   • Pixel 3 API 30   • Google • android
Resizable_API_33 • Resizable API 33 • Google • android

To run an emulator, run 'flutter emulators --launch <emulator id>'.
To create a new emulator, run 'flutter emulators --create [--name xyz]'.

You can find more information on managing emulators at the links below:
  https://developer.android.com/studio/run/managing-avds
  https://developer.android.com/studio/command-line/avdmanager
```

**After:**

```
2 available emulators:

Id               • Name             • Manufacturer • Platform

Pixel_3_API_30   • Pixel 3 API 30   • Google       • android
Resizable_API_33 • Resizable API 33 • Google       • android

To run an emulator, run 'flutter emulators --launch <emulator id>'.
To create a new emulator, run 'flutter emulators --create [--name xyz]'.

You can find more information on managing emulators at the links below:
  https://developer.android.com/studio/run/managing-avds
  https://developer.android.com/studio/command-line/avdmanager
```

fixes #140656
This commit is contained in:
Anas
2024-02-14 18:19:24 +05:30
committed by GitHub
parent abadf9ff8c
commit ca03beda4d
2 changed files with 24 additions and 1 deletions

View File

@@ -87,6 +87,18 @@ void main() {
returnsNormally);
});
testUsingContext('printEmulators prints the the emualtors information with header', () {
Emulator.printEmulators(emulators, testLogger);
expect(testLogger.statusText, '''
Id • Name • Manufacturer • Platform
Nexus_5 • Nexus 5 • Google • android
Nexus_5X_API_27_x86 • Nexus 5X • Google • android
iOS Simulator • iOS Simulator • Apple • android
''');
});
testUsingContext('getEmulators with no Android SDK', () async {
// Test that EmulatorManager.getEmulators() doesn't throw when there's no Android SDK.
final EmulatorManager emulatorManager = EmulatorManager(