The tunnel connection failed while the system tried to connect to the device. (XCode and iPhone)
Hello,
I’m new to macOS after many years on iPhone, and I’m trying to run a simple app on my iPhone directly from Xcode. The app builds fine in the simulator, but deploying to a real device fails with this error:
The tunnel connection failed while the system tried to connect to the device.
Domain: com.apple.dt.CoreDeviceError
Code: 4
Failure Reason: The tunnel connection failed while the system tried to connect to the device.
User Info: {
DVTErrorCreationDateKey = "2025-10-02 16:55:53 +0000";
"com.apple.dt.DVTCoreDevice.operationName" = connect;
}
--
The tunnel connection failed while the system tried to connect to the device.
Domain: com.apple.dt.RemotePairingError
Code: 4
--
I get the same error via command line, e.g. for
xcrun devicectl device info apps --device "..."
My setup:
- macOS Version 26.0.1 (Build 25A362)
- Xcode 26.0.1 (Build 17A400)
- iPhone 13 on iOS 26.0.1
- iPhone is paired with the Mac (I can see it in Finder and in Xcode alongside the simulator).
- Developer Mode is enabled on the iPhone.
- I also see my Apple Watch listed in Xcode.
What I tried:
- Restarted both Mac and iPhone, unpaired them, paired them again.
- Disabled and re-nabled development mode
- Tried both Wi-Fi and wired connection (Apple-certified cable).
- Reset privacy and network settings on the iPhone.
- Verified I’m not running any VPN.
Despite this, deployment always fails with the same tunnel connection error.
Has anyone encountered this before or found a solution/workaround?
Thank you very much,
Martin
(the device ID has been hidden)
[Edited by Moderator]
iPhone 13