diff --git a/packages/flutter_tools/lib/src/ios/devices.dart b/packages/flutter_tools/lib/src/ios/devices.dart index 8478aaa01f..f0e2422c78 100644 --- a/packages/flutter_tools/lib/src/ios/devices.dart +++ b/packages/flutter_tools/lib/src/ios/devices.dart @@ -475,7 +475,7 @@ class _IOSDeviceLogReader extends DeviceLogReader { String get name => device.name; void _start() { - iMobileDevice.startLogger().then((Process process) { + iMobileDevice.startLogger(device.id).then((Process process) { _process = process; _process.stdout.transform(utf8.decoder).transform(const LineSplitter()).listen(_newLineHandler()); _process.stderr.transform(utf8.decoder).transform(const LineSplitter()).listen(_newLineHandler()); diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart index 77286f0c9b..3ad82ff5fa 100644 --- a/packages/flutter_tools/lib/src/ios/mac.dart +++ b/packages/flutter_tools/lib/src/ios/mac.dart @@ -127,7 +127,7 @@ class IMobileDevice { } /// Starts `idevicesyslog` and returns the running process. - Future startLogger() => runCommand(['idevicesyslog']); + Future startLogger(String deviceID) => runCommand(['idevicesyslog', '-u', deviceID]); /// Captures a screenshot to the specified outputFile. Future takeScreenshot(File outputFile) { diff --git a/packages/flutter_tools/test/ios/devices_test.dart b/packages/flutter_tools/test/ios/devices_test.dart index 39518a6d58..ba81bc529d 100644 --- a/packages/flutter_tools/test/ios/devices_test.dart +++ b/packages/flutter_tools/test/ios/devices_test.dart @@ -100,7 +100,7 @@ f577a7903cc54959be2e34bc4f7f80b7009efcf4 }); testUsingContext('suppresses non-Flutter lines from output', () async { - when(mockIMobileDevice.startLogger()).thenAnswer((Invocation invocation) { + when(mockIMobileDevice.startLogger('123456')).thenAnswer((Invocation invocation) { final Process mockProcess = MockProcess(); when(mockProcess.stdout).thenAnswer((Invocation invocation) => Stream>.fromIterable(>[''' @@ -130,7 +130,7 @@ f577a7903cc54959be2e34bc4f7f80b7009efcf4 }); testUsingContext('includes multi-line Flutter logs in the output', () async { - when(mockIMobileDevice.startLogger()).thenAnswer((Invocation invocation) { + when(mockIMobileDevice.startLogger('123456')).thenAnswer((Invocation invocation) { final Process mockProcess = MockProcess(); when(mockProcess.stdout).thenAnswer((Invocation invocation) => Stream>.fromIterable(>['''