-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Let flutter attach find the service port by looking through old logs again #53153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
packages/flutter_tools/test/general.shard/android/adb_log_reader_test.dart
Show resolved
Hide resolved
packages/flutter_tools/test/general.shard/android/adb_log_reader_test.dart
Show resolved
Hide resolved
| '-v', | ||
| 'time', | ||
| '-s', | ||
| 'flutter' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: trailing comma
| await device.getLogReader(), | ||
| // If it's an Android device, attaching relies on past log searching | ||
| // to find the service protocol. | ||
| await device.getLogReader(includePastLogs: device is AndroidDevice), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
blasten
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Description
We stopped listening to old logs in #45743 to fix #45732.
Finding the service port through old logs was the primary way of letting
flutter attachwork for apps that already started in full-flutter or add-to-app cases.Let flutter logs continue to default to showing logs from the present. But for flutter attach specifically, let it read through old logs.
Related Issues
Fixes #52975
Tests
I added the following tests:
Unit test.
More test case in integration test.
Tested microbenchmarks still work #45732
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.
This breaks g3. For subclasses of DeviceLogReader, you can do nothing if includePastLogs = true.