diff --git a/packages/flutter_tools/lib/src/android/android_device.dart b/packages/flutter_tools/lib/src/android/android_device.dart index 841ca639f68..382260e8167 100644 --- a/packages/flutter_tools/lib/src/android/android_device.dart +++ b/packages/flutter_tools/lib/src/android/android_device.dart @@ -102,7 +102,7 @@ class AndroidDevice extends Device { // output lines like this, which we want to ignore: // adb server is out of date. killing.. // * daemon started successfully * - runCheckedSync(adbCommandForDevice(['start-server'])); + runCheckedSync([androidSdk.adbPath, 'start-server']); // Sample output: '22' String sdkVersion = runCheckedSync( @@ -283,7 +283,7 @@ class AndroidDevice extends Device { TargetPlatform get platform => TargetPlatform.android; void clearLogs() { - runSync(adbCommandForDevice(['-s', id, 'logcat', '-c'])); + runSync(adbCommandForDevice(['logcat', '-c'])); } DeviceLogReader get logReader { @@ -306,7 +306,7 @@ class AndroidDevice extends Device { /// no available timestamp. The format can be passed to logcat's -T option. String get lastLogcatTimestamp { String output = runCheckedSync(adbCommandForDevice([ - '-s', id, 'logcat', '-v', 'time', '-t', '1' + 'logcat', '-v', 'time', '-t', '1' ])); RegExp timeRegExp = new RegExp(r'^\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}', multiLine: true); @@ -332,7 +332,7 @@ class AndroidDevice extends Device { String tracePath = null; bool isComplete = false; while (!isComplete) { - List args = ['-s', id, 'logcat', '-d']; + List args = ['logcat', '-d']; if (beforeStop != null) args.addAll(['-T', beforeStop]); String logs = runCheckedSync(adbCommandForDevice(args)); @@ -488,21 +488,11 @@ class _AdbLogReader extends DeviceLogReader { throw new StateError('_AdbLogReader must be stopped before it can be started.'); // Start the adb logcat process. - List args = [ - '-s', - device.id, - 'logcat', - '-v', - 'tag', // Only log the tag and the message - '-s', - 'flutter:V', - 'ActivityManager:W', - 'System.err:W', - '*:F' - ]; + List args = ['logcat', '-v', 'tag']; String lastTimestamp = device.lastLogcatTimestamp; if (lastTimestamp != null) args.addAll(['-T', lastTimestamp]); + args.addAll(['-s', 'flutter:V', 'ActivityManager:W', 'System.err:W', '*:F']); _process = await runCommand(device.adbCommandForDevice(args)); _stdoutSubscription = _process.stdout.transform(UTF8.decoder) diff --git a/packages/flutter_tools/lib/src/commands/logs.dart b/packages/flutter_tools/lib/src/commands/logs.dart index 75261ca4ece..9d9fc1642b7 100644 --- a/packages/flutter_tools/lib/src/commands/logs.dart +++ b/packages/flutter_tools/lib/src/commands/logs.dart @@ -55,9 +55,9 @@ class LogsCommand extends FlutterCommand { StreamSubscription subscription = reader.lines.listen((String line) { if (devices.length > 1) { // Prefix with the name of the device. - print('[${reader.name}] $line'); + printStatus('[${reader.name}] $line'); } else { - print(line); + printStatus(line); } }); // Wait for the log reader to be finished.