iPhone remote debugging over VPN connection

冷暖自知 提交于 2020-01-04 04:10:09

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/49267354/iphone-remote-debugging-over-vpn-connection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!