diff --git a/packages/flutter_tools/lib/src/ios/devices.dart b/packages/flutter_tools/lib/src/ios/devices.dart index ac2b816cbb..3e4c37897f 100644 --- a/packages/flutter_tools/lib/src/ios/devices.dart +++ b/packages/flutter_tools/lib/src/ios/devices.dart @@ -249,6 +249,16 @@ class IOSDevice extends Device { // ports post launch. printTrace("Debugging is enabled, connecting to observatory and the diagnostic server"); + Future forwardObsPort = _acquireAndForwardPort(ProtocolDiscovery.kObservatoryService, + debuggingOptions.observatoryPort); + Future forwardDiagPort; + if (debuggingOptions.buildMode == BuildMode.debug) { + forwardDiagPort = _acquireAndForwardPort(ProtocolDiscovery.kDiagnosticService, + debuggingOptions.diagnosticPort); + } else { + forwardDiagPort = new Future.value(null); + } + Future launch = runCommandAndStreamOutput(launchCommand, trace: true); List ports = await launch.then((int result) async { @@ -260,17 +270,6 @@ class IOSDevice extends Device { } printTrace("Application launched on the device. Attempting to forward ports."); - - Future forwardObsPort = _acquireAndForwardPort(ProtocolDiscovery.kObservatoryService, - debuggingOptions.observatoryPort); - Future forwardDiagPort; - if (debuggingOptions.buildMode == BuildMode.debug) { - forwardDiagPort = _acquireAndForwardPort(ProtocolDiscovery.kDiagnosticService, - debuggingOptions.diagnosticPort); - } else { - forwardDiagPort = new Future.value(null); - } - return Future.wait(>[forwardObsPort, forwardDiagPort]); }); @@ -435,7 +434,7 @@ class _IOSDeviceLogReader extends DeviceLogReader { // // iOS 9 format: Runner[297] : // iOS 10 format: Runner(libsystem_asl.dylib)[297] : - static final RegExp _runnerRegex = new RegExp(r'Runner[(.*)]\[[\d]+\] <[A-Za-z]+>: '); + static final RegExp _runnerRegex = new RegExp(r'Runner(\(.*\))?\[[\d]+\] <[A-Za-z]+>: '); void _onLine(String line) { Match match = _runnerRegex.firstMatch(line);