🔊 [tool] Add a wirelessly connected device name as displayName (#160497)

An improvement for #144634.

A wirelessly connected device will displayed as `Target device 1
(wireless)` in various of places.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
This commit is contained in:
Alex Li 2025-01-11 04:51:34 +08:00 committed by GitHub
parent ee4d46d43a
commit 771b8a4197
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
31 changed files with 198 additions and 98 deletions

View File

@ -1085,7 +1085,7 @@ class AdbLogReader extends DeviceLogReader {
]);
}
final Process process = await processManager.start(device.adbCommandForDevice(args));
return AdbLogReader._(process, device.name, logger);
return AdbLogReader._(process, device.displayName, logger);
}
int? _appPid;

View File

@ -310,7 +310,7 @@ known, it can be explicitly provided to attach via the command-line, e.g.
logger: _logger,
);
_logger.printStatus('Waiting for a connection from Flutter on ${device.name}...');
_logger.printStatus('Waiting for a connection from Flutter on ${device.displayName}...');
final Status discoveryStatus = _logger.startSpinner(
timeout: const Duration(seconds: 30),
slowWarningCallback: () {
@ -421,7 +421,10 @@ known, it can be explicitly provided to attach via the command-line, e.g.
if (runner.exited || !runner.isWaitingForVmService) {
break;
}
_logger.printStatus('Waiting for a new connection from Flutter on ${device.name}...');
_logger.printStatus(
'Waiting for a new connection from Flutter on '
'${device.displayName}...',
);
}
} on RPCError catch (err) {
if (err.code == RPCErrorKind.kServiceDisappeared.code ||

View File

@ -434,7 +434,7 @@ class CustomDevicesAddCommand extends CustomDevicesCommandBase {
if (config.usesPortForwarding) {
final CustomDevicePortForwarder portForwarder = CustomDevicePortForwarder(
deviceName: device.name,
deviceName: device.displayName,
forwardPortCommand: config.forwardPortCommand!,
forwardPortSuccessRegex: config.forwardPortSuccessRegex!,
processManager: _processManager,

View File

@ -681,7 +681,7 @@ class AppDomain extends Domain {
if (!await device.supportsRuntimeMode(options.buildInfo.mode)) {
throw Exception(
'${sentenceCase(options.buildInfo.friendlyModeName)} '
'mode is not supported for ${device.name}.',
'mode is not supported for ${device.displayName}.',
);
}
@ -1388,7 +1388,7 @@ class DevToolsDomain extends Domain {
Future<Map<String, Object?>> _deviceToMap(Device device) async {
return <String, Object?>{
'id': device.id,
'name': device.name,
'name': device.displayName,
'platform': getNameForTargetPlatform(await device.targetPlatform),
'emulator': await device.isLocalEmulator,
'category': device.category?.toString(),

View File

@ -285,7 +285,7 @@ class DriveCommand extends RunCommandBase {
throwToolExit(null);
}
if (screenshot != null && !device.supportsScreenshot) {
_logger.printError('Screenshot not supported for ${device.name}.');
_logger.printError('Screenshot not supported for ${device.displayName}.');
}
final bool web = device is WebServerDevice || device is ChromiumDevice;

View File

@ -856,12 +856,15 @@ class RunCommand extends RunCommandBase {
if (!await device.supportsRuntimeMode(buildMode)) {
throwToolExit(
'${sentenceCase(getFriendlyModeName(buildMode))} '
'mode is not supported by ${device.name}.',
'mode is not supported by ${device.displayName}.',
);
}
if (hotMode) {
if (!device.supportsHotReload) {
throwToolExit('Hot reload is not supported by ${device.name}. Run with "--no-hot".');
throwToolExit(
'Hot reload is not supported by ${device.displayName}. '
'Run with "--no-hot".',
);
}
}
}

View File

@ -85,7 +85,7 @@ class ScreenshotCommand extends FlutterCommand {
throwToolExit('Must have a connected device for screenshot type $screenshotType');
}
if (!device!.supportsScreenshot) {
throwToolExit('Screenshot not supported for ${device!.name}.');
throwToolExit('Screenshot not supported for ${device!.displayName}.');
}
default:
if (vmServiceUrl == null) {

View File

@ -609,6 +609,14 @@ abstract class Device {
String get name;
String get displayName {
String result = name;
if (isWirelesslyConnected) {
result += ' (wireless)';
}
return result;
}
bool get supportsStartPaused => true;
/// Whether it is an emulated device running on localhost.
@ -813,7 +821,7 @@ abstract class Device {
supportIndicator += ' ($type)';
}
table.add(<String>[
'${device.name} (${device.category})',
'${device.displayName} (${device.category})',
device.id,
await device.targetPlatformDisplayName,
'${await device.sdkNameAndVersion}$supportIndicator',

View File

@ -572,6 +572,10 @@ class IOSDevice extends Device {
// If debugging with a wireless device and the timeout is reached, remind the
// user to allow local network permissions.
if (isWirelesslyConnected) {
_logger.printError(
'\nYour debugging device seems wirelessly connected. '
'Consider plugging it in and trying again.',
);
_logger.printError(
'\nClick "Allow" to the prompt asking if you would like to find and connect devices on your local network. '
'This is required for wireless debugging. If you selected "Don\'t Allow", '
@ -1148,7 +1152,7 @@ class IOSDeviceLogReader extends DeviceLogReader {
iMobileDevice,
device.majorSdkVersion,
device.id,
device.name,
device.displayName,
device.isWirelesslyConnected,
device.isCoreDevice,
appName,

View File

@ -255,7 +255,7 @@ class ResidentWebRunner extends ResidentRunner {
final String modeName = debuggingOptions.buildInfo.friendlyModeName;
_logger.printStatus(
'Launching ${getDisplayPath(target, _fileSystem)} '
'on ${device!.device!.name} in $modeName mode...',
'on ${device!.device!.displayName} in $modeName mode...',
);
if (device!.device is ChromiumDevice) {
_chromiumLauncher = (device!.device! as ChromiumDevice).chromeLauncher;
@ -578,7 +578,8 @@ Please provide a valid TCP port (an integer between 0 and 65535, inclusive).
packageConfig: device!.devFS!.lastPackageConfig ?? debuggingOptions.buildInfo.packageConfig,
);
final Status devFSStatus = _logger.startProgress(
'Waiting for connection from debug service on ${device!.device!.name}...',
'Waiting for connection from debug service on '
'${device!.device!.displayName}...',
);
final UpdateFSReport report = await device!.devFS!.update(
mainUri: await _generateEntrypoint(

View File

@ -505,7 +505,7 @@ class _ProxiedLogReader extends DeviceLogReader {
final PrebuiltApplicationPackage? applicationPackage;
@override
String get name => device.name;
String get name => device.displayName;
final StreamController<String> _logLinesStreamController = StreamController<String>();
Stream<String>? _logLines;

View File

@ -184,7 +184,10 @@ class FlutterResidentDevtoolsHandler implements ResidentDevtoolsHandler {
queryParameters: <String, dynamic>{'uri': '${device!.vmService!.httpAddress}'},
)
.toString();
_logger.printStatus('Launching Flutter DevTools for ${device.device!.name} at $devToolsUrl');
_logger.printStatus(
'Launching Flutter DevTools for '
'${device.device!.displayName} at $devToolsUrl',
);
unawaited(Chrome.start(<String>[devToolsUrl]));
}
launchedInBrowser = true;

View File

@ -436,7 +436,7 @@ class FlutterDevice {
final String modeName = hotRunner.debuggingOptions.buildInfo.friendlyModeName;
globals.printStatus(
'Launching ${getDisplayPath(hotRunner.mainPath, globals.fs)} '
'on ${device!.name} in $modeName mode...',
'on ${device!.displayName} in $modeName mode...',
);
final TargetPlatform targetPlatform = await device!.targetPlatform;
@ -476,7 +476,7 @@ class FlutterDevice {
final LaunchResult result = await futureResult;
if (!result.started) {
globals.printError('Error launching application on ${device!.name}.');
globals.printError('Error launching application on ${device!.displayName}.');
await stopEchoingDeviceLog();
return 2;
}
@ -513,7 +513,7 @@ class FlutterDevice {
final bool prebuiltMode = coldRunner.applicationBinary != null;
globals.printStatus(
'Launching ${getDisplayPath(coldRunner.mainPath, globals.fs)} '
'on ${device!.name} in $modeName mode...',
'on ${device!.displayName} in $modeName mode...',
);
final Map<String, dynamic> platformArgs = <String, dynamic>{};
@ -532,7 +532,7 @@ class FlutterDevice {
);
if (!result.started) {
globals.printError('Error running application on ${device!.name}.');
globals.printError('Error running application on ${device!.displayName}.');
await stopEchoingDeviceLog();
return 2;
}
@ -557,7 +557,7 @@ class FlutterDevice {
required PackageConfig packageConfig,
}) async {
final Status devFSStatus = globals.logger.startProgress(
'Syncing files to device ${device!.name}...',
'Syncing files to device ${device!.displayName}...',
progressId: 'devFS.update',
);
UpdateFSReport report;
@ -922,7 +922,9 @@ abstract class ResidentHandlers {
if (!device.device!.supportsScreenshot && !supportsServiceProtocol) {
return;
}
final Status status = logger.startProgress('Taking screenshot for ${device.device!.name}...');
final Status status = logger.startProgress(
'Taking screenshot for ${device.device!.displayName}...',
);
final File outputFile = getUniqueFile(fileSystem!.currentDirectory, 'flutter', 'png');
try {
@ -1456,8 +1458,8 @@ abstract class ResidentRunner extends ResidentHandlers {
if (includeVmService) {
// Caution: This log line is parsed by device lab tests.
globals.printStatus(
'A Dart VM Service on ${device.device!.name} is available at: '
'${device.vmService!.httpAddress}',
'A Dart VM Service on ${device.device!.displayName} '
'is available at: ${device.vmService!.httpAddress}',
);
}
if (includeDevtools) {
@ -1473,7 +1475,8 @@ abstract class ResidentRunner extends ResidentHandlers {
if (uri != null) {
globals.printStatus(
'The Flutter DevTools debugger and profiler '
'on ${device.device!.name} is available at: ${urlToDisplayString(uri)}',
'on ${device.device!.displayName} '
'is available at: ${urlToDisplayString(uri)}',
);
}
}

View File

@ -104,14 +104,14 @@ class ColdRunner extends ResidentRunner {
if (device!.vmService == null) {
continue;
}
globals.printTrace('Connected to ${device.device!.name}');
globals.printTrace('Connected to ${device.device!.displayName}');
}
if (traceStartup) {
// Only trace startup for the first device.
final FlutterDevice device = flutterDevices.first;
if (device.vmService != null) {
globals.printStatus('Tracing startup on ${device.device!.name}.');
globals.printStatus('Tracing startup on ${device.device!.displayName}.');
final String outputPath =
globals.platform.environment[kFlutterTestOutputsDirEnvName] ?? getBuildDirectory();
await downloadStartupTrace(

View File

@ -352,7 +352,7 @@ class TargetDevices {
void _displayDeviceOptions(List<Device> devices) {
int count = 1;
for (final Device device in devices) {
_logger.printStatus(_chooseDeviceOptionMessage(count, device.name, device.id));
_logger.printStatus(_chooseDeviceOptionMessage(count, device.displayName, device.id));
count++;
}
}
@ -416,7 +416,7 @@ class TargetDevicesWithExtendedWirelessDeviceDiscovery extends TargetDevices {
Future<Device?> _waitForIOSDeviceToConnect(IOSDevice device) async {
for (final DeviceDiscovery discoverer in _deviceManager.deviceDiscoverers) {
if (discoverer is IOSDevices) {
_logger.printStatus('Waiting for ${device.name} to connect...');
_logger.printStatus('Waiting for ${device.displayName} to connect...');
final Status waitingStatus = _logger.startSpinner(
timeout: const Duration(seconds: 30),
warningColor: TerminalColor.red,
@ -494,13 +494,13 @@ class TargetDevicesWithExtendedWirelessDeviceDiscovery extends TargetDevices {
if (matchedDevice is IOSDevice) {
// If the only matching device is not paired, print a warning
if (!matchedDevice.isPaired) {
_logger.printStatus(flutterSpecifiedDeviceUnpaired(matchedDevice.name));
_logger.printStatus(flutterSpecifiedDeviceUnpaired(matchedDevice.displayName));
return null;
}
// If the only matching device does not have Developer Mode enabled,
// print a warning
if (!matchedDevice.devModeEnabled) {
_logger.printStatus(flutterSpecifiedDeviceDevModeDisabled(matchedDevice.name));
_logger.printStatus(flutterSpecifiedDeviceDevModeDisabled(matchedDevice.displayName));
return null;
}
@ -516,12 +516,12 @@ class TargetDevicesWithExtendedWirelessDeviceDiscovery extends TargetDevices {
for (final IOSDevice device in specifiedDevices.whereType<IOSDevice>()) {
// Print warning for every matching unpaired device.
if (!device.isPaired) {
_logger.printStatus(flutterSpecifiedDeviceUnpaired(device.name));
_logger.printStatus(flutterSpecifiedDeviceUnpaired(device.displayName));
}
// Print warning for every matching device that does not have Developer Mode enabled.
if (!device.devModeEnabled) {
_logger.printStatus(flutterSpecifiedDeviceDevModeDisabled(device.name));
_logger.printStatus(flutterSpecifiedDeviceDevModeDisabled(device.displayName));
}
}
}

View File

@ -1742,6 +1742,9 @@ class FakeAndroidDevice extends Fake implements AndroidDevice {
@override
String get name => 'd$id';
@override
String get displayName => name;
@override
Future<bool> get isLocalEmulator async => false;
@ -1857,6 +1860,9 @@ class FakeIOSDevice extends Fake implements IOSDevice {
@override
final String name = 'name';
@override
String get displayName => name;
@override
Future<TargetPlatform> get targetPlatform async => TargetPlatform.ios;

View File

@ -1175,6 +1175,9 @@ class FakeAndroidDevice extends Fake implements AndroidDevice {
@override
final String name = 'android device';
@override
String get displayName => name;
@override
Future<String> get emulatorId async => 'device';

View File

@ -1526,6 +1526,9 @@ class FakeDevice extends Fake implements Device {
@override
String get name => 'name';
@override
String get displayName => name;
@override
String get id => 'device-id';

View File

@ -618,6 +618,9 @@ class ScreenshotDevice extends Fake implements Device {
@override
final String name = 'FakeDevice';
@override
String get displayName => name;
@override
final Category category = Category.mobile;

View File

@ -263,6 +263,9 @@ class FakeAndroidDevice extends Fake implements AndroidDevice {
@override
final String name = 'device';
@override
String get displayName => name;
@override
Future<String> get emulatorId async => 'device';

View File

@ -1632,6 +1632,9 @@ class FakeDevice extends Fake implements Device {
@override
String get name => 'FakeDevice';
@override
String get displayName => name;
@override
Future<TargetPlatform> get targetPlatform async => _targetPlatform;

View File

@ -207,6 +207,9 @@ class _ScreenshotDevice extends Fake implements Device {
@override
final String name;
@override
String get displayName => name;
@override
final String id;

View File

@ -248,6 +248,9 @@ class FakeAndroidDevice extends Fake implements AndroidDevice {
@override
String get name => 'test-device';
@override
String get displayName => name;
@override
Future<String> get apiVersion => Future<String>.value(_apiVersion);

View File

@ -209,6 +209,9 @@ class FakeDevice extends Fake implements Device {
@override
String get name => 'test';
@override
String get displayName => name;
@override
Future<TargetPlatform> get targetPlatform async => TargetPlatform.tester;

View File

@ -362,6 +362,12 @@ void main() {
'The Dart VM Service was not discovered after 45 seconds. This is taking much longer than expected...',
),
);
expect(
logger.errorText,
contains(
'Your debugging device seems wirelessly connected. Consider plugging it in and trying again.',
),
);
expect(
logger.errorText,
contains(

View File

@ -396,6 +396,9 @@ class FakeDevice extends Fake implements Device {
@override
String get name => 'FakeDevice';
@override
String get displayName => name;
@override
late DartDevelopmentService dds = FakeDartDevelopmentService();

View File

@ -237,6 +237,9 @@ class FakeWebDevice extends Fake implements Device {
@override
String get name => 'web';
@override
String get displayName => name;
@override
Future<bool> stopApp(ApplicationPackage? app, {String? userIdentifier}) async {
return true;

View File

@ -1584,6 +1584,9 @@ class FakeDevice extends Fake implements Device {
@override
String name = 'FakeDevice';
@override
String get displayName => name;
int count = 0;
@override

View File

@ -330,8 +330,8 @@ No supported devices found with name or id matching 'target-device'.
No supported devices found with name or id matching 'target-device'.
The following devices were found:
no-match-1 (mobile) xxx android Android 10
no-match-2 (mobile) xxx android Android 10
no-match-1 (mobile) xxx android Android 10
no-match-2 (wireless) (mobile) xxx android Android 10
'''),
);
expect(devices, isNull);
@ -386,7 +386,7 @@ target-device (mobile) • xxx • android • Android 10 (unsupported)
No supported devices found with name or id matching 'target-device'.
The following devices were found:
not-a-match-2 (mobile) xxx android Android 10
not-a-match-2 (wireless) (mobile) xxx android Android 10
'''),
);
expect(devices, isNull);
@ -678,10 +678,10 @@ Connected devices:
target-device-1 (mobile) xxx android Android 10
Wirelessly connected devices:
target-device-5 (mobile) xxx android Android 10
target-device-5 (wireless) (mobile) xxx android Android 10
[1]: target-device-1 (xxx)
[2]: target-device-5 (xxx)
[2]: target-device-5 (wireless) (xxx)
'''),
);
expect(devices, <Device>[wirelessAndroidDevice1]);
@ -732,11 +732,11 @@ target-device-2 (mobile) • xxx • android • Android 10
Connected devices:
Wirelessly connected devices:
target-device-5 (mobile) xxx android Android 10
target-device-6 (mobile) xxx android Android 10
target-device-5 (wireless) (mobile) xxx android Android 10
target-device-6 (wireless) (mobile) xxx android Android 10
[1]: target-device-5 (xxx)
[2]: target-device-6 (xxx)
[1]: target-device-5 (wireless) (xxx)
[2]: target-device-6 (wireless) (xxx)
'''),
);
expect(devices, <Device>[wirelessAndroidDevice1]);
@ -776,8 +776,8 @@ target-device-1 (mobile) • xxx • android • Android 10
target-device-4 (mobile) xxx android Android 10
Wirelessly connected devices:
target-device-5 (mobile) xxx android Android 10
target-device-8 (mobile) xxx android Android 10
target-device-5 (wireless) (mobile) xxx android Android 10
target-device-8 (wireless) (mobile) xxx android Android 10
'''),
);
expect(devices, isNull);
@ -825,8 +825,8 @@ target-device-2 (mobile) • xxx • android • Android 10
More than one device connected; please specify a device with the '-d <deviceId>' flag, or use '-d all' to act on all devices.
Wirelessly connected devices:
target-device-5 (mobile) xxx android Android 10
target-device-6 (mobile) xxx android Android 10
target-device-5 (wireless) (mobile) xxx android Android 10
target-device-6 (wireless) (mobile) xxx android Android 10
'''),
);
expect(devices, isNull);
@ -872,13 +872,13 @@ target-device-1 (mobile) • xxx • android • Android 10
target-device-4 (mobile) xxx android Android 10
Wirelessly connected devices:
target-device-5 (mobile) xxx android Android 10
target-device-8 (mobile) xxx android Android 10
target-device-5 (wireless) (mobile) xxx android Android 10
target-device-8 (wireless) (mobile) xxx android Android 10
[1]: target-device-1 (xxx)
[2]: target-device-4 (xxx)
[3]: target-device-5 (xxx)
[4]: target-device-8 (xxx)
[3]: target-device-5 (wireless) (xxx)
[4]: target-device-8 (wireless) (xxx)
'''),
);
expect(devices, <Device>[attachedUnsupportedForProjectAndroidDevice]);
@ -929,11 +929,11 @@ target-device-2 (mobile) • xxx • android • Android 10
Found 2 devices with name or id matching target-device:
Wirelessly connected devices:
target-device-5 (mobile) xxx android Android 10
target-device-6 (mobile) xxx android Android 10
target-device-5 (wireless) (mobile) xxx android Android 10
target-device-6 (wireless) (mobile) xxx android Android 10
[1]: target-device-5 (xxx)
[2]: target-device-6 (xxx)
[1]: target-device-5 (wireless) (xxx)
[2]: target-device-6 (wireless) (xxx)
'''),
);
expect(devices, <Device>[wirelessAndroidDevice1]);
@ -994,8 +994,8 @@ target-device-1 (mobile) • xxx • android • Android 10
target-device-4 (mobile) xxx android Android 10
Wirelessly connected devices:
target-device-5 (mobile) xxx android Android 10
target-device-8 (mobile) xxx android Android 10
target-device-5 (wireless) (mobile) xxx android Android 10
target-device-8 (wireless) (mobile) xxx android Android 10
'''),
);
expect(devices, isNull);
@ -1042,8 +1042,8 @@ target-device-2 (mobile) • xxx • android • Android 10
Found 2 devices with name or id matching target-device:
Wirelessly connected devices:
target-device-5 (mobile) xxx android Android 10
target-device-6 (mobile) xxx android Android 10
target-device-5 (wireless) (mobile) xxx android Android 10
target-device-6 (wireless) (mobile) xxx android Android 10
'''),
);
expect(devices, isNull);
@ -1308,10 +1308,10 @@ No devices found yet. Checking for wireless devices...
No supported devices connected.
The following devices were found, but are not supported by this project:
target-device-3 (mobile) xxx ios iOS 16 (unsupported)
target-device-4 (mobile) xxx ios iOS 16
target-device-7 (mobile) xxx ios iOS 16 (unsupported)
target-device-8 (mobile) xxx ios iOS 16
target-device-3 (mobile) xxx ios iOS 16 (unsupported)
target-device-4 (mobile) xxx ios iOS 16
target-device-7 (wireless) (mobile) xxx ios iOS 16 (unsupported)
target-device-8 (wireless) (mobile) xxx ios iOS 16
If you would like your app to run on ios, consider running `flutter create .` to generate projects for these platforms.
'''),
);
@ -1420,8 +1420,8 @@ No devices found yet. Checking for wireless devices...
No supported devices found with name or id matching 'target-device'.
The following devices were found:
no-match-1 (mobile) xxx ios iOS 16
no-match-2 (mobile) xxx ios iOS 16
no-match-1 (mobile) xxx ios iOS 16
no-match-2 (wireless) (mobile) xxx ios iOS 16
'''),
);
expect(devices, isNull);
@ -1592,7 +1592,7 @@ Checking for wireless devices...
No supported devices found with name or id matching 'target-device'.
The following devices were found:
not-a-match (mobile) xxx ios iOS 16
not-a-match (wireless) (mobile) xxx ios iOS 16
'''),
);
expect(devices, isNull);
@ -1652,11 +1652,11 @@ No devices found yet. Checking for wireless devices...
No devices found.
The following devices were found, but are not supported by this project:
target-device-10 (mobile) xxx fuchsia-arm64 tester
target-device-3 (mobile) xxx ios iOS 16 (unsupported)
target-device-4 (mobile) xxx ios iOS 16
target-device-7 (mobile) xxx ios iOS 16 (unsupported)
target-device-8 (mobile) xxx ios iOS 16
target-device-10 (mobile) xxx fuchsia-arm64 tester
target-device-3 (mobile) xxx ios iOS 16 (unsupported)
target-device-4 (mobile) xxx ios iOS 16
target-device-7 (wireless) (mobile) xxx ios iOS 16 (unsupported)
target-device-8 (wireless) (mobile) xxx ios iOS 16
If you would like your app to run on fuchsia or ios, consider running `flutter create .` to generate projects for these platforms.
'''),
);
@ -1926,7 +1926,7 @@ Checking for wireless devices...
expect(
logger.statusText,
equals('''
Waiting for target-device to connect...
Waiting for target-device (wireless) to connect...
'''),
);
expect(devices, <Device>[exactMatchWirelessDevice]);
@ -1953,7 +1953,7 @@ Waiting for target-device to connect...
expect(
logger.statusText,
equals('''
Waiting for target-device-1 to connect...
Waiting for target-device-1 (wireless) to connect...
'''),
);
expect(devices, <Device>[partialMatchWirelessDevice]);
@ -2174,11 +2174,11 @@ target-device-1 (mobile) • xxx • ios • iOS 16
target-device-2 (mobile) xxx ios iOS 16
Wirelessly connected devices:
target-device-5 (mobile) xxx ios iOS 16
target-device-5 (wireless) (mobile) xxx ios iOS 16
[1]: target-device-1 (xxx)
[2]: target-device-2 (xxx)
[3]: target-device-5 (xxx)
[3]: target-device-5 (wireless) (xxx)
Please choose one (or "q" to quit): '''),
);
expect(devices, <Device>[connectedWirelessIOSDevice1]);
@ -2253,11 +2253,11 @@ No devices found yet. Checking for wireless devices...
Connected devices:
Wirelessly connected devices:
target-device-5 (mobile) xxx ios iOS 16
target-device-6 (mobile) xxx ios iOS 16
target-device-5 (wireless) (mobile) xxx ios iOS 16
target-device-6 (wireless) (mobile) xxx ios iOS 16
[1]: target-device-5 (xxx)
[2]: target-device-6 (xxx)
[1]: target-device-5 (wireless) (xxx)
[2]: target-device-6 (wireless) (xxx)
'''),
);
expect(devices, <Device>[connectedWirelessIOSDevice1]);
@ -2303,11 +2303,11 @@ target-device-1 (mobile) • xxx • ios • iOS 16
target-device-2 (mobile) xxx ios iOS 16
Wirelessly connected devices:
target-device-5 (mobile) xxx ios iOS 16
target-device-5 (wireless) (mobile) xxx ios iOS 16
[1]: target-device-1 (xxx)
[2]: target-device-2 (xxx)
[3]: target-device-5 (xxx)
[3]: target-device-5 (wireless) (xxx)
'''),
);
expect(devices, <Device>[attachedIOSDevice1]);
@ -2424,11 +2424,11 @@ target-device-1 (mobile) • xxx • ios • iOS 16
target-device-2 (mobile) xxx ios iOS 16
Wirelessly connected devices:
target-device-5 (mobile) xxx ios iOS 16
target-device-5 (wireless) (mobile) xxx ios iOS 16
[1]: target-device-1 (xxx)
[2]: target-device-2 (xxx)
[3]: target-device-5 (xxx)
[3]: target-device-5 (wireless) (xxx)
Please choose one (or "q" to quit): '''),
);
@ -2490,8 +2490,8 @@ target-device-2 (mobile) • xxx • ios • iOS 16
target-device-4 (mobile) xxx ios iOS 16
Wirelessly connected devices:
target-device-5 (mobile) xxx ios iOS 16
target-device-8 (mobile) xxx ios iOS 16
target-device-5 (wireless) (mobile) xxx ios iOS 16
target-device-8 (wireless) (mobile) xxx ios iOS 16
'''),
);
expect(devices, isNull);
@ -2547,8 +2547,8 @@ No devices found yet. Checking for wireless devices...
More than one device connected; please specify a device with the '-d <deviceId>' flag, or use '-d all' to act on all devices.
Wirelessly connected devices:
target-device-5 (mobile) xxx ios iOS 16
target-device-6 (mobile) xxx ios iOS 16
target-device-5 (wireless) (mobile) xxx ios iOS 16
target-device-6 (wireless) (mobile) xxx ios iOS 16
'''),
);
expect(devices, isNull);
@ -2619,13 +2619,13 @@ target-device-1 (mobile) • xxx • ios • iOS 16
target-device-4 (mobile) xxx ios iOS 16
Wirelessly connected devices:
target-device-5 (mobile) xxx ios iOS 16
target-device-8 (mobile) xxx ios iOS 16
target-device-5 (wireless) (mobile) xxx ios iOS 16
target-device-8 (wireless) (mobile) xxx ios iOS 16
[1]: target-device-1 (xxx)
[2]: target-device-4 (xxx)
[3]: target-device-5 (xxx)
[4]: target-device-8 (xxx)
[3]: target-device-5 (wireless) (xxx)
[4]: target-device-8 (wireless) (xxx)
Please choose one (or "q" to quit): '''),
);
expect(devices, <Device>[connectedWirelessIOSDevice1]);
@ -2698,11 +2698,11 @@ No devices found yet. Checking for wireless devices...
Found 2 devices with name or id matching target-device:
Wirelessly connected devices:
target-device-5 (mobile) xxx ios iOS 16
target-device-6 (mobile) xxx ios iOS 16
target-device-5 (wireless) (mobile) xxx ios iOS 16
target-device-6 (wireless) (mobile) xxx ios iOS 16
[1]: target-device-5 (xxx)
[2]: target-device-6 (xxx)
[1]: target-device-5 (wireless) (xxx)
[2]: target-device-6 (wireless) (xxx)
'''),
);
expect(devices, <Device>[connectedWirelessIOSDevice1]);
@ -2782,8 +2782,8 @@ target-device-1 (mobile) • xxx • ios • iOS 16
target-device-4 (mobile) xxx ios iOS 16
Wirelessly connected devices:
target-device-5 (mobile) xxx ios iOS 16
target-device-8 (mobile) xxx ios iOS 16
target-device-5 (wireless) (mobile) xxx ios iOS 16
target-device-8 (wireless) (mobile) xxx ios iOS 16
'''),
);
expect(devices, isNull);
@ -2840,8 +2840,8 @@ No devices found yet. Checking for wireless devices...
Found 2 devices with name or id matching target-device:
Wirelessly connected devices:
target-device-5 (mobile) xxx ios iOS 16
target-device-6 (mobile) xxx ios iOS 16
target-device-5 (wireless) (mobile) xxx ios iOS 16
target-device-6 (wireless) (mobile) xxx ios iOS 16
'''),
);
expect(devices, isNull);
@ -3189,6 +3189,15 @@ class FakeDevice extends Fake implements Device {
@override
String name;
@override
String get displayName {
String result = name;
if (isWirelesslyConnected) {
result += ' (wireless)';
}
return result;
}
@override
final bool ephemeral;
@ -3204,6 +3213,9 @@ class FakeDevice extends Fake implements Device {
@override
DeviceConnectionInterface connectionInterface;
@override
bool get isWirelesslyConnected => connectionInterface == DeviceConnectionInterface.wireless;
@override
bool isConnected;
@ -3282,6 +3294,15 @@ class FakeIOSDevice extends Fake implements IOSDevice {
@override
String name;
@override
String get displayName {
String result = name;
if (isWirelesslyConnected) {
result += ' (wireless)';
}
return result;
}
@override
final bool ephemeral;
@ -3303,6 +3324,9 @@ class FakeIOSDevice extends Fake implements IOSDevice {
@override
DeviceConnectionInterface connectionInterface;
@override
bool get isWirelesslyConnected => connectionInterface == DeviceConnectionInterface.wireless;
@override
bool isConnected;

View File

@ -1306,6 +1306,9 @@ class FakeDevice extends Fake implements Device {
@override
String get name => 'Fake Device';
@override
String get displayName => name;
@override
DartDevelopmentService dds = DartDevelopmentService(logger: FakeLogger());

View File

@ -146,6 +146,9 @@ class FakeDevice extends Device {
@override
final String name;
@override
String get displayName => name;
@override
Future<LaunchResult> startApp(
ApplicationPackage? package, {