diff --git a/packages/flutter_tools/lib/src/ios/devices.dart b/packages/flutter_tools/lib/src/ios/devices.dart index 86ab1d0a1a..a7b0abd313 100644 --- a/packages/flutter_tools/lib/src/ios/devices.dart +++ b/packages/flutter_tools/lib/src/ios/devices.dart @@ -469,12 +469,6 @@ class IOSDevice extends Device { packageName: FlutterProject.current().manifest.appName, ); if (localUri == null) { - if (majorSdkVersion >= 14) { - _logger.printError('Failed to attach to the observatory.'); - _logger.printError( - 'Try accepting the local network permissions popup, or enable "Settings > Privacy > Local Network" for your app.'); - _logger.printError('For more information, see https://flutter.dev/docs/development/ios-14#debugging-flutter'); - } return LaunchResult.failed(); } return LaunchResult.succeeded(observatoryUri: localUri); diff --git a/packages/flutter_tools/test/general.shard/ios/ios_device_start_prebuilt_test.dart b/packages/flutter_tools/test/general.shard/ios/ios_device_start_prebuilt_test.dart index 062520a6de..0c5a6643cc 100644 --- a/packages/flutter_tools/test/general.shard/ios/ios_device_start_prebuilt_test.dart +++ b/packages/flutter_tools/test/general.shard/ios/ios_device_start_prebuilt_test.dart @@ -338,106 +338,6 @@ void main() { Usage: () => MockUsage(), }); - group('IOSDevice.startApp on discovery failure local network permissions', () { - // Still uses context for analytics and mDNS. - testUsingContext('is not prompted on < iOS 14', () async { - final FileSystem fileSystem = MemoryFileSystem.test(); - final FakeProcessManager processManager = FakeProcessManager.list([ - kDeployCommand, - kAttachDebuggerCommand, - ]); - final BufferLogger logger = BufferLogger.test(); - final IOSDevice device = setUpIOSDevice( - sdkVersion: '13.0', - processManager: processManager, - fileSystem: fileSystem, - logger: logger, - vmServiceConnector: (String string, {Log log}) async { - throw const io.SocketException( - 'OS Error: Connection refused, errno = 61, address = localhost, port ' - '= 58943', - ); - }, - ); - final IOSApp iosApp = PrebuiltIOSApp( - projectBundleId: 'app', - bundleName: 'Runner', - bundleDir: fileSystem.currentDirectory, - ); - final FakeDeviceLogReader deviceLogReader = FakeDeviceLogReader(); - - device.portForwarder = const NoOpDevicePortForwarder(); - device.setLogReader(iosApp, deviceLogReader); - - when(MDnsObservatoryDiscovery.instance.getObservatoryUri(any, any, usesIpv6: anyNamed('usesIpv6'))) - .thenAnswer((Invocation invocation) async => null); - - final LaunchResult launchResult = await device.startApp(iosApp, - prebuiltApplication: true, - debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug), - platformArgs: {}, - fallbackPollingDelay: Duration.zero, - fallbackThrottleTimeout: const Duration(milliseconds: 10), - ); - - expect(launchResult.started, false); - expect(launchResult.hasObservatory, false); - expect(logger.errorText, isEmpty); - }, overrides: { - MDnsObservatoryDiscovery: () => MockMDnsObservatoryDiscovery(), - Usage: () => MockUsage(), - }); - - // Still uses context for analytics and mDNS. - testUsingContext('is prompted on >= iOS 14', () async { - final FileSystem fileSystem = MemoryFileSystem.test(); - final FakeProcessManager processManager = FakeProcessManager.list([ - kDeployCommand, - kAttachDebuggerCommand, - ]); - final BufferLogger logger = BufferLogger.test(); - final IOSDevice device = setUpIOSDevice( - sdkVersion: '14.0', - processManager: processManager, - fileSystem: fileSystem, - logger: logger, - vmServiceConnector: (String string, {Log log}) async { - throw const io.SocketException( - 'OS Error: Connection refused, errno = 61, address = localhost, port ' - '= 58943', - ); - }, - ); - final IOSApp iosApp = PrebuiltIOSApp( - projectBundleId: 'app', - bundleName: 'Runner', - bundleDir: fileSystem.currentDirectory, - ); - final FakeDeviceLogReader deviceLogReader = FakeDeviceLogReader(); - - device.portForwarder = const NoOpDevicePortForwarder(); - device.setLogReader(iosApp, deviceLogReader); - - when(MDnsObservatoryDiscovery.instance.getObservatoryUri(any, any, usesIpv6: anyNamed('usesIpv6'))) - .thenAnswer((Invocation invocation) async => null); - - final LaunchResult launchResult = await device.startApp(iosApp, - prebuiltApplication: true, - debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug), - platformArgs: {}, - fallbackPollingDelay: Duration.zero, - fallbackThrottleTimeout: const Duration(milliseconds: 10), - ); - - expect(launchResult.started, false); - expect(launchResult.hasObservatory, false); - expect(logger.errorText, contains('Settings > Privacy > Local Network')); - }, overrides: { - MDnsObservatoryDiscovery: () => MockMDnsObservatoryDiscovery(), - Usage: () => MockUsage(), - }); - }); - // Still uses context for TimeoutConfiguration and usage testUsingContext('IOSDevice.startApp succeeds in release mode', () async { final FileSystem fileSystem = MemoryFileSystem.test();