A practical field guide for iOS developers building VPN and Network Extension apps with NEPacketTunnelProvider .
Hi everyone,
I've spent a good amount of time building and maintaining iOS apps with a Network Extension layer, and I keep seeing the same debugging questions: "My tunnel is stuck on Connecting", "my breakpoint in startTunnel never hits", "the VPN just drops after a few minutes with no crash." Packet Tunnel Providers are hard to debug because they don't behave like a normal app. This post collects the setup, tools and habits that saved me the most time. I'd love to hear what has worked for you too.
1. Why this is harder than normal iOS debugging
A packet tunnel runs as an app extension, which means:
It's a separate process. Your host app and the extension have different lifecycles, and Xcode attaches to only one of them by default.
The system controls its lifecycle. iOS launches and kills the extension, not you.…