@@ -151,7 +151,7 @@ class IOSDevice extends Device {
151
151
required FileSystem fileSystem,
152
152
required this .name,
153
153
required this .cpuArchitecture,
154
- required this .interfaceType ,
154
+ required this .connectionInterface ,
155
155
String ? sdkVersion,
156
156
required Platform platform,
157
157
required IOSDeploy iosDeploy,
@@ -199,7 +199,8 @@ class IOSDevice extends Device {
199
199
200
200
final DarwinArch cpuArchitecture;
201
201
202
- final IOSDeviceConnectionInterface interfaceType;
202
+ @override
203
+ final DeviceConnectionInterface connectionInterface;
203
204
204
205
final Map <IOSApp ?, DeviceLogReader > _logReaders = < IOSApp ? , DeviceLogReader > {};
205
206
@@ -256,7 +257,7 @@ class IOSDevice extends Device {
256
257
bundlePath: bundle.path,
257
258
appDeltaDirectory: app.appDeltaDirectory,
258
259
launchArguments: < String > [],
259
- interfaceType: interfaceType ,
260
+ interfaceType: connectionInterface ,
260
261
);
261
262
} on ProcessException catch (e) {
262
263
_logger.printError (e.message);
@@ -311,7 +312,7 @@ class IOSDevice extends Device {
311
312
@visibleForTesting Duration ? discoveryTimeout,
312
313
}) async {
313
314
String ? packageId;
314
- if (interfaceType == IOSDeviceConnectionInterface .network &&
315
+ if (isWirelesslyConnected &&
315
316
debuggingOptions.debuggingEnabled &&
316
317
debuggingOptions.disablePortPublication) {
317
318
throwToolExit ('Cannot start app on wirelessly tethered iOS device. Try running again with the --publish-port flag' );
@@ -351,7 +352,7 @@ class IOSDevice extends Device {
351
352
route,
352
353
platformArgs,
353
354
ipv6: ipv6,
354
- interfaceType: interfaceType ,
355
+ interfaceType: connectionInterface ,
355
356
);
356
357
Status startAppStatus = _logger.startProgress (
357
358
'Installing and launching...' ,
@@ -371,7 +372,7 @@ class IOSDevice extends Device {
371
372
bundlePath: bundle.path,
372
373
appDeltaDirectory: package.appDeltaDirectory,
373
374
launchArguments: launchArguments,
374
- interfaceType: interfaceType ,
375
+ interfaceType: connectionInterface ,
375
376
uninstallFirst: debuggingOptions.uninstallFirst,
376
377
);
377
378
if (deviceLogReader is IOSDeviceLogReader ) {
@@ -381,7 +382,7 @@ class IOSDevice extends Device {
381
382
// Don't port foward if debugging with a network device.
382
383
vmServiceDiscovery = ProtocolDiscovery .vmService (
383
384
deviceLogReader,
384
- portForwarder: interfaceType == IOSDeviceConnectionInterface .network ? null : portForwarder,
385
+ portForwarder: isWirelesslyConnected ? null : portForwarder,
385
386
hostPort: debuggingOptions.hostVmServicePort,
386
387
devicePort: debuggingOptions.deviceVmServicePort,
387
388
ipv6: ipv6,
@@ -394,7 +395,7 @@ class IOSDevice extends Device {
394
395
bundlePath: bundle.path,
395
396
appDeltaDirectory: package.appDeltaDirectory,
396
397
launchArguments: launchArguments,
397
- interfaceType: interfaceType ,
398
+ interfaceType: connectionInterface ,
398
399
uninstallFirst: debuggingOptions.uninstallFirst,
399
400
);
400
401
} else {
@@ -414,13 +415,13 @@ class IOSDevice extends Device {
414
415
415
416
_logger.printTrace ('Application launched on the device. Waiting for Dart VM Service url.' );
416
417
417
- final int defaultTimeout = interfaceType == IOSDeviceConnectionInterface .network ? 45 : 30 ;
418
+ final int defaultTimeout = isWirelesslyConnected ? 45 : 30 ;
418
419
final Timer timer = Timer (discoveryTimeout ?? Duration (seconds: defaultTimeout), () {
419
420
_logger.printError ('The Dart VM Service was not discovered after $defaultTimeout seconds. This is taking much longer than expected...' );
420
421
421
422
// If debugging with a wireless device and the timeout is reached, remind the
422
423
// user to allow local network permissions.
423
- if (interfaceType == IOSDeviceConnectionInterface .network ) {
424
+ if (isWirelesslyConnected ) {
424
425
_logger.printError (
425
426
'\n Click "Allow" to the prompt asking if you would like to find and connect devices on your local network. '
426
427
'This is required for wireless debugging. If you selected "Don\' t Allow", '
@@ -433,7 +434,7 @@ class IOSDevice extends Device {
433
434
});
434
435
435
436
Uri ? localUri;
436
- if (interfaceType == IOSDeviceConnectionInterface .network ) {
437
+ if (isWirelesslyConnected ) {
437
438
// Wait for Dart VM Service to start up.
438
439
final Uri ? serviceURL = await vmServiceDiscovery? .uri;
439
440
if (serviceURL == null ) {
@@ -538,7 +539,7 @@ class IOSDevice extends Device {
538
539
539
540
@override
540
541
Future <void > takeScreenshot (File outputFile) async {
541
- await _iMobileDevice.takeScreenshot (outputFile, id, interfaceType );
542
+ await _iMobileDevice.takeScreenshot (outputFile, id, connectionInterface );
542
543
}
543
544
544
545
@override
0 commit comments