LG debugging/logcat fixed (#58670)
This commit is contained in:
@@ -1024,7 +1024,11 @@ class AdbLogReader extends DeviceLogReader {
|
||||
}(await device.apiVersion);
|
||||
|
||||
// Start the adb logcat process and filter the most recent logs since `lastTimestamp`.
|
||||
// Some devices (notably LG) will only output logcat via shell
|
||||
// https://github.com/flutter/flutter/issues/51853
|
||||
final List<String> args = <String>[
|
||||
'shell',
|
||||
'-x',
|
||||
'logcat',
|
||||
'-v',
|
||||
'time',
|
||||
@@ -1034,9 +1038,9 @@ class AdbLogReader extends DeviceLogReader {
|
||||
'flutter',
|
||||
] else if (apiVersion != null && apiVersion >= kLollipopVersionCode) ...<String>[
|
||||
// Otherwise, filter for logs appearing past the present.
|
||||
// Empty `-T` means the timestamp of the logcat command invocation.
|
||||
// '-T 0` means the timestamp of the logcat command invocation.
|
||||
'-T',
|
||||
device.lastLogcatTimestamp ?? '',
|
||||
if (device.lastLogcatTimestamp != null) '\'${device.lastLogcatTimestamp}\'' else '0',
|
||||
],
|
||||
];
|
||||
final Process process = await processManager.start(device.adbCommandForDevice(args));
|
||||
|
||||
@@ -26,11 +26,13 @@ void main() {
|
||||
'adb',
|
||||
'-s',
|
||||
'1234',
|
||||
'shell',
|
||||
'-x',
|
||||
'logcat',
|
||||
'-v',
|
||||
'time',
|
||||
'-T',
|
||||
kLastLogcatTimestamp,
|
||||
'\'$kLastLogcatTimestamp\'',
|
||||
],
|
||||
)
|
||||
]);
|
||||
@@ -49,6 +51,8 @@ void main() {
|
||||
'adb',
|
||||
'-s',
|
||||
'1234',
|
||||
'shell',
|
||||
'-x',
|
||||
'logcat',
|
||||
'-v',
|
||||
'time',
|
||||
@@ -70,6 +74,8 @@ void main() {
|
||||
'adb',
|
||||
'-s',
|
||||
'1234',
|
||||
'shell',
|
||||
'-x',
|
||||
'logcat',
|
||||
'-v',
|
||||
'time',
|
||||
@@ -91,6 +97,8 @@ void main() {
|
||||
'adb',
|
||||
'-s',
|
||||
'1234',
|
||||
'shell',
|
||||
'-x',
|
||||
'logcat',
|
||||
'-v',
|
||||
'time',
|
||||
@@ -115,6 +123,8 @@ void main() {
|
||||
'adb',
|
||||
'-s',
|
||||
'1234',
|
||||
'shell',
|
||||
'-x',
|
||||
'logcat',
|
||||
'-v',
|
||||
'time',
|
||||
@@ -141,6 +151,8 @@ void main() {
|
||||
'adb',
|
||||
'-s',
|
||||
'1234',
|
||||
'shell',
|
||||
'-x',
|
||||
'logcat',
|
||||
'-v',
|
||||
'time',
|
||||
|
||||
@@ -217,6 +217,8 @@ void main() {
|
||||
'adb',
|
||||
'-s',
|
||||
'1234',
|
||||
'shell',
|
||||
'-x',
|
||||
'logcat',
|
||||
'-v',
|
||||
'time',
|
||||
|
||||
@@ -370,10 +370,10 @@ flutter:
|
||||
exitCode: 1,
|
||||
),
|
||||
const FakeCommand(
|
||||
command: <String>['adb', '-s', '1234', 'logcat', '-v', 'time', '-s', 'flutter'],
|
||||
command: <String>['adb', '-s', '1234', 'shell', '-x', 'logcat', '-v', 'time', '-s', 'flutter'],
|
||||
),
|
||||
const FakeCommand(
|
||||
command: <String>['adb', '-s', '1234', 'logcat', '-v', 'time'],
|
||||
command: <String>['adb', '-s', '1234', 'shell', '-x', 'logcat', '-v', 'time'],
|
||||
)
|
||||
])
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user