Skip to content

Commit ff9dc22

Browse files
authored
Run logcat through shell (flutter#21977)
This should fix flutter#18889 which may be related to `adb logcat` not working correctly in non-terminals on some LG devices. See flutter#18889 (comment).
1 parent ccd070a commit ff9dc22

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/flutter_tools/lib/src/android/android_device.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ class AndroidDevice extends Device {
498498
/// no available timestamp. The format can be passed to logcat's -T option.
499499
String get lastLogcatTimestamp {
500500
final String output = runCheckedSync(adbCommandForDevice(<String>[
501-
'logcat', '-v', 'time', '-t', '1'
501+
'shell', '-x', 'logcat', '-v', 'time', '-t', '1'
502502
]));
503503

504504
final Match timeMatch = _timeRegExp.firstMatch(output);
@@ -664,7 +664,7 @@ class _AdbLogReader extends DeviceLogReader {
664664

665665
void _start() {
666666
// Start the adb logcat process.
667-
final List<String> args = <String>['logcat', '-v', 'time'];
667+
final List<String> args = <String>['shell', '-x', 'logcat', '-v', 'time'];
668668
final String lastTimestamp = device.lastLogcatTimestamp;
669669
if (lastTimestamp != null)
670670
_timeOrigin = _adbTimestampToDateTime(lastTimestamp);

0 commit comments

Comments
 (0)