Skip to content

Create vm service handshake for iOS without mDNS #46724

@jonahwilliams

Description

@jonahwilliams

We should support connecting to an iOS application via run without requiring mDNS, which has a number of issues (tracked in #46705). We still plan to harden mDNS as much as we can, but it is likely that it won't be able to work in all circumstances.

This requires one or two updates to the vm service

  • We modify the behavior (or support via a new flag) of specifying an observatory port for the vm service. Currently, if the vm service cannot bind to a specified port the entire process dies. Instead this would be modified to fallback to binding to port 0 (select available port).
  • We provide a new flag for auth codes (or disable them) which allows the tool to specify a random string (or generated through other means) to use instead.

The tool provides these flags to the dart VM via the launch arguments. Then, it attempts to connect to the port/path it specified. If it fails or times out during this process, it might be the case that the port was not available. If so, the tool falls back to mDNS.

Enhancements

If there was a way to ensure that a port was available before the tool specified it, then we might be able to guarantee that we almost always hit the happy path.

Caveats

This procedure won't work for attach, since the tool does not launch the application in this case it does not have a chance to provide the necessary launch arguments.

cc @dnfield @zanderso @mehmetf @bkonyi

Metadata

Metadata

Assignees

Labels

c: new featureNothing broken; request for a new capabilitycustomer: crowdAffects or could affect many people, though not necessarily a specific customer.dependency: dartDart team may need to help usplatform-iosiOS applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions