-
Notifications
You must be signed in to change notification settings - Fork 29.7k
flutter_tools: iOS wireless debugging support #58185
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
b473550 to
c8f12fd
Compare
6b4d084 to
0497a67
Compare
|
Tests should be passing now. |
0497a67 to
0741a6b
Compare
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.
Thanks for your interest in this! The nslookup part is particularly clever.
I've been working up to this since:
#49854
#51015
#51678
and all the fallout thereof:
#50248
#53184
#53203
#58137
I had the device USB/network detection exposed on the iOS device part done on a branch, and I just put it out for review at #58257. It's pretty close to what you have (I even renamed the method getAvailableIOSDevices). The biggest difference is that it will avoid regressing #8309 for the 99% of users not on a wirelessly paired device. If you don't mind, I'd like to land that one, then you can rebase on it and we can review your change (plus it narrows the scope of your change).
My concerns so far are:
- We would like to avoid regressing device discovery time for the 99% of users that are not using wireless debugging (2 seconds -> 5 seconds, even that 2 seconds increase was contentious). Once thought I had for this was to require specifying a
--device-idforflutter run/install/screenshot/etc, trying the fast USB path first, and then dropping back to a slower discovery if it's not found. - This needs tests for the
nslookup/ port forwarding changes. - A change to the default
--observatory-hostbehavior in flutter/engine#18651 could have all kinds of unexpected consequences for consumers of the observatory that aren't just thisfluttertool. Why exactly did you need that change?
|
Thanks for leaving a review! To address your points:
Additionally, that PR would really clean up my code a lot so I'd be interested in rebasing off it. |
For sure, the timeout would have to be increased to detect wireless devices. Adding more seconds on discovery which would add that number of seconds to every
This could be mitigated by more device property caching between
I can look at this more after your rebase. We have plenty of technical debt to pay down in the tool testing category.
That's what I was thinking too. Check out locations where
It's merged! Please rebase I can do a more thorough review. |
0741a6b to
f580bc5
Compare
|
Just finished rebasing off your PR. The engine PR is also now unnecessary (and has been closed) - resulting in me not needing to change a lot of tests. If |
f580bc5 to
4a9fc0b
Compare
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: This feels kinda hacky. Is there any way to do this better?
48e4060 to
06e5636
Compare
|
@jmagman Rolled back 5 second timeout back to 2. I'm planning to address the disconnection issue using |
Tests (should) be updated properly. Not sure if this is the best way to do it.
06e5636 to
9a9d781
Compare
|
Added error handling by checking for How would I write tests for this? |
|
Hi @anirudhb, sorry for the delay with this review. I'll try to look at it today! |
| return null; | ||
| } | ||
| // 1st match is IPv6, last match is IPv4 | ||
| final String ip = (ipv6 ? re.firstMatch(out) : re.allMatches(out).last).group(1).trim(); |
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.
I'm still concerned about the unreliability of parsing this, cleaning the name up, etc. There's no tests for this parsing, and we don't have confidence the nslookup formatting won't change, or that we have a complete understanding of what else this output can look like.
I started working on #54781 to get the logs and observatory URL from the lldb logs (which will also give us crash-on-launch logs and anything else that was lost in the iOS 13 universal logging transition). Then we should be able to delete the FallbackDiscovery, and the iOS mDNS lookup code paths.
|
Thank you so much for this contribution, we definitely know the community wants this feature. |
|
|
Description
This adds proper support for debugging wirelessly-connected devices on iOS. The toolchain seems to support deploying and connecting to devices over WiFi, so I've just removed the guards against wireless devices.
iOS devices now set the observatory to listen on all interfaces if they are network connected.
This is my first time contributing, please let me know if there's anything I need to fix!
Related Issues
Fixes #15072
Tests
None
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.