The tunnel connection failed while the system tried to connect to the device.

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.
  • I might have enabled Multipath networking in the past - but in iOS 26.0.1, the setting is missing in the Developer settings - so there is no way to check if it's enabled or to disable it. I know this was the solution to a similar problem: https://developer.apple.com/forums/thread/737907

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

Answered by MartinChovanec in 864367022

I've found a workaround: enabling and disabling "Network Link Conditioner" seems to overwrite any legacy network settings that might have prevented the tunnel from being established.

Accepted Answer

I've found a workaround: enabling and disabling "Network Link Conditioner" seems to overwrite any legacy network settings that might have prevented the tunnel from being established.

Oh, thank you, kind soul!

My phone wouldn’t connect to the Mac Mini M1 nor to the MacBook M4. Today, by some miracle, after poking around in the settings and flipping random developer toggles, I managed to get it to connect to the Mac Mini - and, encouraged by that success, I tried to do the same on the MacBook. But I spent a whole hour and nothing worked. I even tried switching the Network Link Conditioner option.

After that, I decided to look up the topic again to see if there was any new info. And yes - it turned out that this very setting was the key.

Only in my case, just switching it didn’t help. What worked was the following sequence:

  1. Unpair the iPhone (you don't need to unplug the cable from the computer)
  2. Enable Network Link Conditioner (don't disable it immediately)
  3. Run the command xcrun devicectl device info apps --device "…"
  4. The iPhone will ask to allow pairing - allow it

Bingo! Everything works now.

The tunnel connection failed while the system tried to connect to the device.
 
 
Q