Build & Run
Clone and configure
Section titled “Clone and configure”git clone https://github.com/rtenney/wgnextcd wgnextCreate and edit the developer configuration:
cp Sources/WireGuardApp/Config/Developer.xcconfig.template \ Sources/WireGuardApp/Config/Developer.xcconfigEdit Developer.xcconfig and set your values:
DEVELOPMENT_TEAM— your Apple Developer Team IDAPP_ID_IOS— your iOS app bundle identifierAPP_ID_MACOS— your macOS app bundle identifier
Install dependencies
Section titled “Install dependencies”brew install swiftlint go xcodegenGenerate Xcode project
Section titled “Generate Xcode project”xcodegen generateopen WireGuard.xcodeprojBuild targets
Section titled “Build targets”| Target | Platform | Description |
|---|---|---|
| WireGuard (iOS) | iOS 15+ | Main iOS app |
| WireGuard (macOS) | macOS 12+ | Main macOS app |
| WireGuardNetworkExtension | Both | Network Extension (packet tunnel provider) |
| WireGuardWidget | iOS | Status widget |
Select the appropriate target and device in Xcode, then build and run.
Simulator vs. device
Section titled “Simulator vs. device”Simulator
Section titled “Simulator”- The Network Extension does not run in the simulator
- The app uses
MockTunnelsto simulate tunnel behavior - Good for UI development and testing
Physical device
Section titled “Physical device”- Requires proper provisioning (see Prerequisites)
- Network Extension runs as a separate process
- Required for testing actual VPN functionality and failover
Debug failover testing
Section titled “Debug failover testing”To build with failover debug controls:
fastlane ios device_failoverThis adds the FAILOVER_TESTING compilation flag, which enables:
- Force Failover button in the failover group detail view
- Force Failback button to immediately switch back to primary
All debug code is #if FAILOVER_TESTING gated and excluded from release builds.