From ff9dc22e44c81399cd790c3fddb5847c99ae41bc Mon Sep 17 00:00:00 2001 From: Danny Tuppeny Date: Tue, 18 Sep 2018 17:57:31 +0100 Subject: [PATCH] Run logcat through shell (#21977) This should fix #18889 which may be related to `adb logcat` not working correctly in non-terminals on some LG devices. See https://github.com/flutter/flutter/issues/18889#issuecomment-422217761. --- packages/flutter_tools/lib/src/android/android_device.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);