Visual Studio 2022 is attempting to use port 11000 instead of 62078, but the port on iOS 18.5 is not listening for VS's Hot Reloading. Is this allowable? If so, how?
I’m not sure why your third-party tooling isn’t working in this case, but I can assure you that iOS does not limited access to port 11,000 [1]. So, if you’re having problems getting these connection to go through with your third-party tooling, I recommend that you escalate that via the support channel for those tools.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] Consider this code:
final class Listener {
var listener: NWListener? = nil
func start() -> NWListener {
print("listener will start")
let listener = try! NWListener.init(using: .tcp, on: 11000)
listener.service = .init(type: "_test._tcp")
listener.stateUpdateHandler = { newState in
print("listener did change state, new: \(newState)")
}
listener.newConnectionHandler = { connection in
print("listener will reject connection")
connection.cancel()
}
listener.start(queue: .main)
return listener
}
func stop(listener: NWListener) {
print("listener will stop")
listener.stateUpdateHandler = nil
listener.newConnectionHandler = nil
listener.cancel()
}
func startStop() {
if let listener = self.listener {
self.listener = nil
self.stop(listener: listener)
} else {
self.listener = self.start()
}
}
}
If you run it on a device (I’m testing with Xcode 16.4 on macOS 15.5 targeting iOS 18.5) and start the listener, you’ll see this:
listener will start
listener did change state, new: ready
You can then connect to your iOS device from your Mac like so:
% nc dr-nobel-price.local. 11000
The connection won’t go through, because the listener rejects everything, but you’ll see that the listener actually got a connection request that it could have accepted:
listener will start
listener did change state, new: ready
listener will reject connection
…
Note If you want to try this test for yourself, make sure set up both NSLocalNetworkUsageDescription
and NSBonjourServices
in your Info.plist
. See TN3179 Understanding local network privacy for more about this.