Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone remote debugging over VPN connection

When my iPhone is on my local WiFi Xcode sees my iPhone over the network. My Mac Pro development machine is running macOS Server with a VPN server. When I VPN into my Mac Pro from my iPhone my Mac can ping the iPhone over its VPN IP address screenshot (172.22.0.225) and Network Utility is showing that port 62078 (the required port for debugging) is open. screenshot However, when I try to connect via IP in Xcode it says my iPhone is no longer available. screenshot Any suggestions?

like image 402
Kurt Bitner Avatar asked Oct 25 '25 23:10

Kurt Bitner


1 Answers

I managed to get this working on Mojave with OpenVPN and an iPhone 8 running iOS 12.4. I don't believe any special setup was necessary on the server side—I installed openvpn from brew and followed a few different configuration guides closely to setup a routed VPN (apparently the iPhone won't handle TAP, which is needed for an ethernet bridged VPN). I did install tuntap, but I think OpenVPN uses the default utun0 interface anyway, so it shouldn't matter.

Anyway, I did discover that this seemingly does not work if you are not on Wi-Fi. I discovered with Wireshark that although the iPhone will receive the message from Xcode when you are connected to the VPN server using cellular data, the iPhone seems to ignore the messages, sending [RST, ACK] packets back to the server. Maybe the iPhone is only listening for messages from Xcode on its en0 interface, or maybe there is some check in place to ensure that the messages are not coming from one of its cellular data interfaces. In any case, Xcode can see the iPhone when it is connected to the VPN server over Wi-Fi.

Unfortunately, I cannot confirm that this works with any other VPN servers, but I can at least confirm that remote debugging over a VPN is possible.

Update, 10/23/2025: This does not seem to be working with an iPhone 16 Pro on iOS 18.6.2, macOS Tahoe 26.0.1 on an M4 Mac Mini, and XCode 26.0.1.

like image 114
fakedad Avatar answered Oct 27 '25 12:10

fakedad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!