From 3396ec7b888e437407bfa5702656e6c82c243424 Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Fri, 28 Jul 2023 14:37:00 -0700 Subject: [PATCH] Device discovery output cleanup (#131223) Fixes https://github.com/flutter/flutter/issues/6538 --- .../lib/src/commands/devices.dart | 57 ++--- packages/flutter_tools/lib/src/device.dart | 6 +- .../commands.shard/hermetic/devices_test.dart | 231 ++++++++++-------- 3 files changed, 164 insertions(+), 130 deletions(-) diff --git a/packages/flutter_tools/lib/src/commands/devices.dart b/packages/flutter_tools/lib/src/commands/devices.dart index 9792a3d9f4..b71259248d 100644 --- a/packages/flutter_tools/lib/src/commands/devices.dart +++ b/packages/flutter_tools/lib/src/commands/devices.dart @@ -168,46 +168,41 @@ class DevicesCommandOutput { } if (allDevices.isEmpty) { - _printNoDevicesDetected(); + _logger.printStatus('No authorized devices detected.'); } else { if (attachedDevices.isNotEmpty) { - _logger.printStatus('${attachedDevices.length} connected ${pluralize('device', attachedDevices.length)}:\n'); - await Device.printDevices(attachedDevices, _logger); + _logger.printStatus('Found ${attachedDevices.length} connected ${pluralize('device', attachedDevices.length)}:'); + await Device.printDevices(attachedDevices, _logger, prefix: ' '); } if (wirelessDevices.isNotEmpty) { if (attachedDevices.isNotEmpty) { _logger.printStatus(''); } - _logger.printStatus('${wirelessDevices.length} wirelessly connected ${pluralize('device', wirelessDevices.length)}:\n'); - await Device.printDevices(wirelessDevices, _logger); + _logger.printStatus('Found ${wirelessDevices.length} wirelessly connected ${pluralize('device', wirelessDevices.length)}:'); + await Device.printDevices(wirelessDevices, _logger, prefix: ' '); } } - await _printDiagnostics(); + await _printDiagnostics(foundAny: allDevices.isNotEmpty); } - void _printNoDevicesDetected() { - final StringBuffer status = StringBuffer('No devices detected.'); + Future _printDiagnostics({ required bool foundAny }) async { + final StringBuffer status = StringBuffer(); status.writeln(); - status.writeln(); - status.writeln('Run "flutter emulators" to list and start any available device emulators.'); - status.writeln(); - status.write('If you expected your device to be detected, please run "flutter doctor" to diagnose potential issues. '); - if (deviceDiscoveryTimeout == null) { - status.write('You may also try increasing the time to wait for connected devices with the --${FlutterOptions.kDeviceTimeout} flag. '); - } - status.write('Visit https://flutter.dev/setup/ for troubleshooting tips.'); - - _logger.printStatus(status.toString()); - } - - Future _printDiagnostics() async { final List diagnostics = await _deviceManager?.getDeviceDiagnostics() ?? []; if (diagnostics.isNotEmpty) { - _logger.printStatus(''); for (final String diagnostic in diagnostics) { - _logger.printStatus('• $diagnostic', hangingIndent: 2); + status.writeln(diagnostic); + status.writeln(); } } + status.writeln('Run "flutter emulators" to list and start any available device emulators.'); + status.writeln(); + status.write('If you expected ${ foundAny ? 'another' : 'a' } device to be detected, please run "flutter doctor" to diagnose potential issues. '); + if (deviceDiscoveryTimeout == null) { + status.write('You may also try increasing the time to wait for connected devices with the "--${FlutterOptions.kDeviceTimeout}" flag. '); + } + status.write('Visit https://flutter.dev/setup/ for troubleshooting tips.'); + _logger.printStatus(status.toString()); } Future printDevicesAsJson(List devices) async { @@ -266,8 +261,8 @@ class DevicesCommandOutputWithExtendedWirelessDeviceDiscovery extends DevicesCom // Display list of attached devices. if (attachedDevices.isNotEmpty) { - _logger.printStatus('${attachedDevices.length} connected ${pluralize('device', attachedDevices.length)}:\n'); - await Device.printDevices(attachedDevices, _logger); + _logger.printStatus('Found ${attachedDevices.length} connected ${pluralize('device', attachedDevices.length)}:'); + await Device.printDevices(attachedDevices, _logger, prefix: ' '); _logger.printStatus(''); numLinesToClear += 1; } @@ -292,8 +287,8 @@ class DevicesCommandOutputWithExtendedWirelessDeviceDiscovery extends DevicesCom if (_logger.isVerbose && _includeAttachedDevices) { // Reprint the attach devices. if (attachedDevices.isNotEmpty) { - _logger.printStatus('\n${attachedDevices.length} connected ${pluralize('device', attachedDevices.length)}:\n'); - await Device.printDevices(attachedDevices, _logger); + _logger.printStatus('\nFound ${attachedDevices.length} connected ${pluralize('device', attachedDevices.length)}:'); + await Device.printDevices(attachedDevices, _logger, prefix: ' '); } } else if (terminal.supportsColor && terminal is AnsiTerminal) { _logger.printStatus( @@ -309,16 +304,16 @@ class DevicesCommandOutputWithExtendedWirelessDeviceDiscovery extends DevicesCom if (wirelessDevices.isEmpty) { if (attachedDevices.isEmpty) { // No wireless or attached devices were found. - _printNoDevicesDetected(); + _logger.printStatus('No authorized devices detected.'); } else { // Attached devices found, wireless devices not found. _logger.printStatus(_noWirelessDevicesFoundMessage); } } else { // Display list of wireless devices. - _logger.printStatus('${wirelessDevices.length} wirelessly connected ${pluralize('device', wirelessDevices.length)}:\n'); - await Device.printDevices(wirelessDevices, _logger); + _logger.printStatus('Found ${wirelessDevices.length} wirelessly connected ${pluralize('device', wirelessDevices.length)}:'); + await Device.printDevices(wirelessDevices, _logger, prefix: ' '); } - await _printDiagnostics(); + await _printDiagnostics(foundAny: wirelessDevices.isNotEmpty || attachedDevices.isNotEmpty); } } diff --git a/packages/flutter_tools/lib/src/device.dart b/packages/flutter_tools/lib/src/device.dart index 83d13746d2..c789e31652 100644 --- a/packages/flutter_tools/lib/src/device.dart +++ b/packages/flutter_tools/lib/src/device.dart @@ -849,8 +849,10 @@ abstract class Device { ]; } - static Future printDevices(List devices, Logger logger) async { - (await descriptions(devices)).forEach(logger.printStatus); + static Future printDevices(List devices, Logger logger, { String prefix = '' }) async { + for (final String line in await descriptions(devices)) { + logger.printStatus('$prefix$line'); + } } static List devicesPlatformTypes(List devices) { diff --git a/packages/flutter_tools/test/commands.shard/hermetic/devices_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/devices_test.dart index 86b8d1f74b..7ffae20854 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/devices_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/devices_test.dart @@ -77,11 +77,11 @@ void main() { expect( testLogger.statusText, equals(''' -No devices detected. +No authorized devices detected. Run "flutter emulators" to list and start any available device emulators. -If you expected your device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the --device-timeout flag. Visit https://flutter.dev/setup/ for troubleshooting tips. +If you expected a device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the "--device-timeout" flag. Visit https://flutter.dev/setup/ for troubleshooting tips. '''), ); }, overrides: { @@ -178,16 +178,18 @@ If you expected your device to be detected, please run "flutter doctor" to diagn final DevicesCommand command = DevicesCommand(); await createTestCommandRunner(command).run(['devices']); expect(testLogger.statusText, ''' -2 connected devices: +Found 2 connected devices: + ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) + webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) -ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) -webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) +Found 1 wirelessly connected device: + wireless android (mobile) • wireless-android • android-arm • Test SDK (1.2.3) (emulator) -1 wirelessly connected device: +Cannot connect to device ABC -wireless android (mobile) • wireless-android • android-arm • Test SDK (1.2.3) (emulator) +Run "flutter emulators" to list and start any available device emulators. -• Cannot connect to device ABC +If you expected another device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the "--device-timeout" flag. Visit https://flutter.dev/setup/ for troubleshooting tips. '''); }, overrides: { DeviceManager: () => _FakeDeviceManager(devices: deviceList), @@ -200,12 +202,15 @@ wireless android (mobile) • wireless-android • android-arm • Test SDK (1.2 final DevicesCommand command = DevicesCommand(); await createTestCommandRunner(command).run(['devices', '--device-connection', 'attached']); expect(testLogger.statusText, ''' -2 connected devices: +Found 2 connected devices: + ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) + webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) -ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) -webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) +Cannot connect to device ABC -• Cannot connect to device ABC +Run "flutter emulators" to list and start any available device emulators. + +If you expected another device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the "--device-timeout" flag. Visit https://flutter.dev/setup/ for troubleshooting tips. '''); }, overrides: { DeviceManager: () => _FakeDeviceManager(devices: deviceList), @@ -217,11 +222,14 @@ webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulato final DevicesCommand command = DevicesCommand(); await createTestCommandRunner(command).run(['devices', '--device-connection', 'wireless']); expect(testLogger.statusText, ''' -1 wirelessly connected device: +Found 1 wirelessly connected device: + wireless android (mobile) • wireless-android • android-arm • Test SDK (1.2.3) (emulator) -wireless android (mobile) • wireless-android • android-arm • Test SDK (1.2.3) (emulator) +Cannot connect to device ABC -• Cannot connect to device ABC +Run "flutter emulators" to list and start any available device emulators. + +If you expected another device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the "--device-timeout" flag. Visit https://flutter.dev/setup/ for troubleshooting tips. '''); }, overrides: { DeviceManager: () => _FakeDeviceManager(devices: deviceList), @@ -244,12 +252,15 @@ wireless android (mobile) • wireless-android • android-arm • Test SDK (1.2 final DevicesCommand command = DevicesCommand(); await createTestCommandRunner(command).run(['devices']); expect(testLogger.statusText, ''' -2 connected devices: +Found 2 connected devices: + ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) + webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) -ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) -webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) +Cannot connect to device ABC -• Cannot connect to device ABC +Run "flutter emulators" to list and start any available device emulators. + +If you expected another device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the "--device-timeout" flag. Visit https://flutter.dev/setup/ for troubleshooting tips. '''); }, overrides: { DeviceManager: () => _FakeDeviceManager(devices: deviceList), @@ -270,11 +281,14 @@ webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulato final DevicesCommand command = DevicesCommand(); await createTestCommandRunner(command).run(['devices']); expect(testLogger.statusText, ''' -1 wirelessly connected device: +Found 1 wirelessly connected device: + wireless android (mobile) • wireless-android • android-arm • Test SDK (1.2.3) (emulator) -wireless android (mobile) • wireless-android • android-arm • Test SDK (1.2.3) (emulator) +Cannot connect to device ABC -• Cannot connect to device ABC +Run "flutter emulators" to list and start any available device emulators. + +If you expected another device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the "--device-timeout" flag. Visit https://flutter.dev/setup/ for troubleshooting tips. '''); }, overrides: { DeviceManager: () => _FakeDeviceManager(devices: deviceList), @@ -308,11 +322,11 @@ wireless android (mobile) • wireless-android • android-arm • Test SDK (1.2 equals(''' No devices found yet. Checking for wireless devices... -No devices detected. +No authorized devices detected. Run "flutter emulators" to list and start any available device emulators. -If you expected your device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the --device-timeout flag. Visit https://flutter.dev/setup/ for troubleshooting tips. +If you expected a device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the "--device-timeout" flag. Visit https://flutter.dev/setup/ for troubleshooting tips. '''), ); }, overrides: { @@ -329,11 +343,11 @@ If you expected your device to be detected, please run "flutter doctor" to diagn final DevicesCommand command = DevicesCommand(); await createTestCommandRunner(command).run(['devices', '--device-connection', 'attached']); expect(testLogger.statusText, ''' -No devices detected. +No authorized devices detected. Run "flutter emulators" to list and start any available device emulators. -If you expected your device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the --device-timeout flag. Visit https://flutter.dev/setup/ for troubleshooting tips. +If you expected a device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the "--device-timeout" flag. Visit https://flutter.dev/setup/ for troubleshooting tips. '''); }, overrides: { DeviceManager: () => NoDevicesManager(), @@ -347,11 +361,11 @@ If you expected your device to be detected, please run "flutter doctor" to diagn expect(testLogger.statusText, ''' Checking for wireless devices... -No devices detected. +No authorized devices detected. Run "flutter emulators" to list and start any available device emulators. -If you expected your device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the --device-timeout flag. Visit https://flutter.dev/setup/ for troubleshooting tips. +If you expected a device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the "--device-timeout" flag. Visit https://flutter.dev/setup/ for troubleshooting tips. '''); }, overrides: { DeviceManager: () => NoDevicesManager(), @@ -449,19 +463,21 @@ If you expected your device to be detected, please run "flutter doctor" to diagn final DevicesCommand command = DevicesCommand(); await createTestCommandRunner(command).run(['devices']); expect(testLogger.statusText, ''' -2 connected devices: - -ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) -webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) +Found 2 connected devices: + ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) + webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) Checking for wireless devices... -2 wirelessly connected devices: +Found 2 wirelessly connected devices: + wireless android (mobile) • wireless-android • android-arm • Test SDK (1.2.3) (emulator) + wireless ios (mobile) • wireless-ios • ios • iOS 16 (simulator) -wireless android (mobile) • wireless-android • android-arm • Test SDK (1.2.3) (emulator) -wireless ios (mobile) • wireless-ios • ios • iOS 16 (simulator) +Cannot connect to device ABC -• Cannot connect to device ABC +Run "flutter emulators" to list and start any available device emulators. + +If you expected another device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the "--device-timeout" flag. Visit https://flutter.dev/setup/ for troubleshooting tips. '''); }, overrides: { DeviceManager: () => _FakeDeviceManager(devices: deviceList), @@ -477,10 +493,9 @@ wireless ios (mobile) • wireless-ios • ios • iOS 16 (simul terminal = FakeTerminal(supportsColor: true); fakeLogger = FakeBufferLogger(terminal: terminal); fakeLogger.originalStatusText = ''' -2 connected devices: - -ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) -webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) +Found 2 connected devices: + ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) + webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) Checking for wireless devices... '''; @@ -491,17 +506,19 @@ Checking for wireless devices... await createTestCommandRunner(command).run(['devices']); expect(fakeLogger.statusText, ''' -2 connected devices: +Found 2 connected devices: + ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) + webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) -ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) -webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) +Found 2 wirelessly connected devices: + wireless android (mobile) • wireless-android • android-arm • Test SDK (1.2.3) (emulator) + wireless ios (mobile) • wireless-ios • ios • iOS 16 (simulator) -2 wirelessly connected devices: +Cannot connect to device ABC -wireless android (mobile) • wireless-android • android-arm • Test SDK (1.2.3) (emulator) -wireless ios (mobile) • wireless-ios • ios • iOS 16 (simulator) +Run "flutter emulators" to list and start any available device emulators. -• Cannot connect to device ABC +If you expected another device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the "--device-timeout" flag. Visit https://flutter.dev/setup/ for troubleshooting tips. '''); }, overrides: { DeviceManager: () => @@ -525,24 +542,25 @@ wireless ios (mobile) • wireless-ios • ios • iOS 16 (simul await createTestCommandRunner(command).run(['devices']); expect(fakeLogger.statusText, ''' -2 connected devices: - -ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) -webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) +Found 2 connected devices: + ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) + webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) Checking for wireless devices... -2 connected devices: +Found 2 connected devices: + ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) + webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) -ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) -webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) +Found 2 wirelessly connected devices: + wireless android (mobile) • wireless-android • android-arm • Test SDK (1.2.3) (emulator) + wireless ios (mobile) • wireless-ios • ios • iOS 16 (simulator) -2 wirelessly connected devices: +Cannot connect to device ABC -wireless android (mobile) • wireless-android • android-arm • Test SDK (1.2.3) (emulator) -wireless ios (mobile) • wireless-ios • ios • iOS 16 (simulator) +Run "flutter emulators" to list and start any available device emulators. -• Cannot connect to device ABC +If you expected another device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the "--device-timeout" flag. Visit https://flutter.dev/setup/ for troubleshooting tips. '''); }, overrides: { DeviceManager: () => _FakeDeviceManager( @@ -560,12 +578,15 @@ wireless ios (mobile) • wireless-ios • ios • iOS 16 (simul expect(testLogger.statusText, ''' Checking for wireless devices... -2 wirelessly connected devices: +Found 2 wirelessly connected devices: + wireless android (mobile) • wireless-android • android-arm • Test SDK (1.2.3) (emulator) + wireless ios (mobile) • wireless-ios • ios • iOS 16 (simulator) -wireless android (mobile) • wireless-android • android-arm • Test SDK (1.2.3) (emulator) -wireless ios (mobile) • wireless-ios • ios • iOS 16 (simulator) +Cannot connect to device ABC -• Cannot connect to device ABC +Run "flutter emulators" to list and start any available device emulators. + +If you expected another device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the "--device-timeout" flag. Visit https://flutter.dev/setup/ for troubleshooting tips. '''); }, overrides: { DeviceManager: () => _FakeDeviceManager(devices: deviceList), @@ -588,16 +609,19 @@ wireless ios (mobile) • wireless-ios • ios • iOS 16 (simul final DevicesCommand command = DevicesCommand(); await createTestCommandRunner(command).run(['devices']); expect(testLogger.statusText, ''' -2 connected devices: - -ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) -webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) +Found 2 connected devices: + ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) + webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) Checking for wireless devices... No wireless devices were found. -• Cannot connect to device ABC +Cannot connect to device ABC + +Run "flutter emulators" to list and start any available device emulators. + +If you expected another device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the "--device-timeout" flag. Visit https://flutter.dev/setup/ for troubleshooting tips. '''); }, overrides: { DeviceManager: () => _FakeDeviceManager(devices: deviceList), @@ -613,10 +637,9 @@ No wireless devices were found. terminal = FakeTerminal(supportsColor: true); fakeLogger = FakeBufferLogger(terminal: terminal); fakeLogger.originalStatusText = ''' -2 connected devices: - -ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) -webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) +Found 2 connected devices: + ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) + webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) Checking for wireless devices... '''; @@ -627,14 +650,17 @@ Checking for wireless devices... await createTestCommandRunner(command).run(['devices']); expect(fakeLogger.statusText, ''' -2 connected devices: - -ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) -webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) +Found 2 connected devices: + ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) + webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) No wireless devices were found. -• Cannot connect to device ABC +Cannot connect to device ABC + +Run "flutter emulators" to list and start any available device emulators. + +If you expected another device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the "--device-timeout" flag. Visit https://flutter.dev/setup/ for troubleshooting tips. '''); }, overrides: { DeviceManager: () => _FakeDeviceManager( @@ -660,21 +686,23 @@ No wireless devices were found. await createTestCommandRunner(command).run(['devices']); expect(fakeLogger.statusText, ''' -2 connected devices: - -ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) -webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) +Found 2 connected devices: + ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) + webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) Checking for wireless devices... -2 connected devices: - -ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) -webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) +Found 2 connected devices: + ephemeral (mobile) • ephemeral • android-arm • Test SDK (1.2.3) (emulator) + webby (mobile) • webby • web-javascript • Web SDK (1.2.4) (emulator) No wireless devices were found. -• Cannot connect to device ABC +Cannot connect to device ABC + +Run "flutter emulators" to list and start any available device emulators. + +If you expected another device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the "--device-timeout" flag. Visit https://flutter.dev/setup/ for troubleshooting tips. '''); }, overrides: { DeviceManager: () => _FakeDeviceManager( @@ -703,12 +731,15 @@ No wireless devices were found. expect(testLogger.statusText, ''' No devices found yet. Checking for wireless devices... -2 wirelessly connected devices: +Found 2 wirelessly connected devices: + wireless android (mobile) • wireless-android • android-arm • Test SDK (1.2.3) (emulator) + wireless ios (mobile) • wireless-ios • ios • iOS 16 (simulator) -wireless android (mobile) • wireless-android • android-arm • Test SDK (1.2.3) (emulator) -wireless ios (mobile) • wireless-ios • ios • iOS 16 (simulator) +Cannot connect to device ABC -• Cannot connect to device ABC +Run "flutter emulators" to list and start any available device emulators. + +If you expected another device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the "--device-timeout" flag. Visit https://flutter.dev/setup/ for troubleshooting tips. '''); }, overrides: { DeviceManager: () => _FakeDeviceManager(devices: deviceList), @@ -733,12 +764,15 @@ No devices found yet. Checking for wireless devices... await createTestCommandRunner(command).run(['devices']); expect(fakeLogger.statusText, ''' -2 wirelessly connected devices: +Found 2 wirelessly connected devices: + wireless android (mobile) • wireless-android • android-arm • Test SDK (1.2.3) (emulator) + wireless ios (mobile) • wireless-ios • ios • iOS 16 (simulator) -wireless android (mobile) • wireless-android • android-arm • Test SDK (1.2.3) (emulator) -wireless ios (mobile) • wireless-ios • ios • iOS 16 (simulator) +Cannot connect to device ABC -• Cannot connect to device ABC +Run "flutter emulators" to list and start any available device emulators. + +If you expected another device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the "--device-timeout" flag. Visit https://flutter.dev/setup/ for troubleshooting tips. '''); }, overrides: { DeviceManager: () => _FakeDeviceManager( @@ -766,12 +800,15 @@ wireless ios (mobile) • wireless-ios • ios • iOS 16 (simul expect(fakeLogger.statusText, ''' No devices found yet. Checking for wireless devices... -2 wirelessly connected devices: +Found 2 wirelessly connected devices: + wireless android (mobile) • wireless-android • android-arm • Test SDK (1.2.3) (emulator) + wireless ios (mobile) • wireless-ios • ios • iOS 16 (simulator) -wireless android (mobile) • wireless-android • android-arm • Test SDK (1.2.3) (emulator) -wireless ios (mobile) • wireless-ios • ios • iOS 16 (simulator) +Cannot connect to device ABC -• Cannot connect to device ABC +Run "flutter emulators" to list and start any available device emulators. + +If you expected another device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the "--device-timeout" flag. Visit https://flutter.dev/setup/ for troubleshooting tips. '''); }, overrides: { DeviceManager: () => _FakeDeviceManager(