You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0088994
Browse filesBrowse the repository at this point in the historyBrowse files
feat(ios): serve Vite dev over the USB CoreDevice tunnel
A USB-connected iOS 17+ / visionOS device reaches the Mac over a
CoreDevice tunnel (a utun with an fdXX::/64 ULA pair) without Wi-Fi and
without the Local Network prompt. The tunnel only exists while a client
holds it, and every new tunnel gets a new address.
For a Vite HMR session whose only target of a platform is such a
device, the run controller now opens the tunnel before prepare: it
holds it with `devicectl device notification observe` for the session,
reads the device's end from `devicectl list devices`, and takes the
Mac's address in the same subnet from the local interfaces. The bundler
passes that address to both Vite children as NS_HMR_HOST, so bundle.mjs
and the dev server use the tunnel origin. The holder is killed when the
device leaves the session or the CLI exits; if it dies on its own the
CLI warns that the app lost the dev server.
Only an @nativescript/vite that lists the platform under
nativescriptCli.singleProcessDev gets the tunnel: older releases bind
the dev server to NS_HMR_HOST and put an IPv6 literal into URLs
unbracketed. A user-set NS_HMR_HOST, simulators, Wi-Fi or
network-paired devices, iOS < 17, a missing devicectl, a tunnel that
does not come up and sessions with more than one device of the platform
also keep the LAN host from @nativescript/vite, with one trace line.
0 commit comments