diff --git a/packages/flutter_tools/lib/src/android/android_device.dart b/packages/flutter_tools/lib/src/android/android_device.dart index 582283c4828..339544209bb 100644 --- a/packages/flutter_tools/lib/src/android/android_device.dart +++ b/packages/flutter_tools/lib/src/android/android_device.dart @@ -498,7 +498,7 @@ class AndroidDevice extends Device { /// no available timestamp. The format can be passed to logcat's -T option. String get lastLogcatTimestamp { final String output = runCheckedSync(adbCommandForDevice([ - 'logcat', '-v', 'time', '-t', '1' + 'shell', '-x', 'logcat', '-v', 'time', '-t', '1' ])); final Match timeMatch = _timeRegExp.firstMatch(output); @@ -664,7 +664,7 @@ class _AdbLogReader extends DeviceLogReader { void _start() { // Start the adb logcat process. - final List args = ['logcat', '-v', 'time']; + final List args = ['shell', '-x', 'logcat', '-v', 'time']; final String lastTimestamp = device.lastLogcatTimestamp; if (lastTimestamp != null) _timeOrigin = _adbTimestampToDateTime(lastTimestamp);