Xcode is not detecting my iPhone over Wi-Fi, even though I had been running builds on it without a cable earlier that day. Everything works over USB, but on the network Xcode can't find the device. I searched, and Google showed an AI answer with three commands:
sudo killall -9 remoted
sudo killall -9 usbmuxd
sudo killall -9 mDNSResponderI rebooted the iPhone, ran the commands, and wireless debugging came back. I was sure the first command, the one for remoted, had done it. Then I pulled the logs from this Mac and went through them second by second. The third command restored the connection. The iPhone reboot and four remoted restarts in a row changed nothing.
Below: what each command does, how Xcode finds an iPhone on the network at all, what was in the log, and what I now do first when wireless debugging stops working.
Setup: macOS 26.4.1, Xcode 26.5, iPhone 14 Pro. The Mac had not been rebooted for 178 days. The second case below was captured on macOS 27.0.1 and Xcode 27.1.
What each of the three commands kills#
All three processes are system daemons, and launchd brings them back by itself. remoted and usbmuxd have KeepAlive => true in their plist files, and mDNSResponder starts on the first access to its socket, a fraction of a second after it is killed. So why -9? No reason. SIGKILL is for a process that has hung and ignores a plain killall, and none of these had.
| Process | What it does | Needed for Wi-Fi |
|---|---|---|
remoted | RemoteXPC: device services over an already open tunnel | Yes, but only after the connection is up |
usbmuxd | Cable connections and the old network channel via Bonjour _apple-mobdev2._tcp | Not for the channel that remotepairingd opens in my logs |
mDNSResponder | Bonjour (mDNS) and the system DNS cache | Yes, it is how the Mac finds the iPhone |
Two processes are missing from this list, although they are the ones that hold the wireless connection. remotepairingd looks for the iPhone over Bonjour and opens a control channel to it. CoreDeviceService serves Xcode and xcrun devicectl. Both run as the user, not as root, so sudo killall from the advice never touches them.
How Xcode finds an iPhone over Wi-Fi#
Since Xcode 15 the chain looks like this:
- The iPhone advertises a Bonjour service,
_remotepairing._tcp, on the local network. remotepairingdon the Mac asksmDNSResponderto find that service and gets an address.remotepairingdopens a TCP channel, checks the keys the devices exchanged when they were paired, and brings up a tunnel.- Over the tunnel,
remotedandCoreDeviceServicegive Xcode install, launch and debugging.
Apple's network requirements were spelled out by DTS engineer Ed Ford on the developer forums in November 2025:
There are two main network level requirements for device connectivity with Xcode: The network supports Bonjour. The network supports IPv6 with link-local traffic.
He also writes there that you can't connect a device by a single IP address, neither IPv4 nor IPv6. If Bonjour doesn't work on the network, typing in the iPhone's address by hand won't help.
What the log showed#
I pulled the logs without sudo, read-only:
/usr/bin/log show --last 24h --style compact \
--predicate 'process IN {"remoted","remotepairingd","CoreDeviceService","usbmuxd","mDNSResponder"}' \
> ~/Desktop/devices.logThe full path /usr/bin/log matters here. In zsh, log is a builtin, and without the full path you get a too many arguments error instead of a log. I tripped on that.
ps -axo pid,lstart,user,comm shows when each daemon started. From the PID changes and the launchd Successfully spawned lines I rebuilt the whole timeline:
| Time | What happened |
|---|---|
| 15:32 | The iPhone dropped off Wi-Fi. For almost two hours after that remotepairingd sees its Bonjour advert and discards it |
| 17:10–17:17 | iPhone reboot. It did not come back over Wi-Fi |
| 17:24:50–17:25:23 | remoted restarted four times. No change |
| 17:25:33 | usbmuxd restarted. No change |
| 17:25:46 | New mDNSResponder started. The old one had been running since June 1 |
| 17:25:48 | iPhone connected over Wi-Fi, handshake completed |
While the connection was down, the same line kept showing up in the log, the last time at 17:24:26:
remotepairingd [com.apple.dt.remotepairing:bonjour] Discovered bonjour advert
for device <private> but it is not visible through any valid interface.
Treating as lost event.The iPhone's advert reached the Mac, but remotepairingd could not tie it to any network interface and treated the device as lost. Connection attempts in two hours: zero.
Why mDNSResponder was the one that worked#
At 17:25:46 the old mDNSResponder disappeared, and the Bonjour browse in remotepairingd failed with ServiceNotRunning (-65563). A second later remotepairingd created the browse again, this time in the new mDNSResponder. 0.4 seconds after that the iPhone's advert resolved to its UDID, and a TCP channel opened right away. Two seconds from restart to a working connection.
Restarting remoted changed nothing in this chain: it works at step 4, and step 2 was the broken one. Worse, every restart dropped the iPhone's cable session.
Why the old mDNSResponder began handing out an advert that remotepairingd couldn't bind to an interface, the log doesn't say directly. There is one lead. At 15:31:54 mDNSResponder logged a Network Configuration Change for the Mac's Wi-Fi interface, two seconds later the iPhone was plugged in by cable, and ten seconds after that it dropped off Wi-Fi. I suspect these events are connected, but I haven't proved it. What is certain: the process had been running for almost six months, and a fresh process with clean state fixed discovery.
The second kind of failure: iPhone visible, TCP hangs#
The day before, on my main Mac (macOS 27.0.1, Xcode 27.1), wireless debugging dropped out differently. Bonjour found the iPhone over Wi-Fi, remotepairingd tried to connect every 11 seconds, and every attempt ended like this:
remotepairingd [com.apple.dt.remotepairing:controlchanneltransport] tcp-19506:
Cancelling TCP control channel transport as connection is stuck preparing after 10 secondsThe runs of attempts lasted 20 to 50 minutes and then stopped, and later the iPhone connected normally. Nobody restarted any daemons that day: remotepairingd and mDNSResponder on that Mac have been running since October 13. This is a different case. Discovery works, the connection doesn't get established, and mDNSResponder is most likely not involved. One line of the log is enough to tell the two failures apart.
Xcode wireless debugging not working: what to check first#
The order I now check things in:
- Device state.
xcrun devicectl list devices. If the iPhone isunavailable, check that it is unlocked and on the same Wi-Fi network as the Mac. - Is the advert on the network.
dns-sd -B _remotepairing._tcp local.and wait a few seconds. If the list is empty, either the iPhone isn't advertising or the network blocks Bonjour: a guest network, client isolation on the router, corporate Wi-Fi. - Which of the two log lines you have:
/usr/bin/log show --last 1h --style compact \
--predicate 'process == "remotepairingd"' \
| grep -E 'not visible through any valid interface|stuck preparing'- "not visible through any valid interface": discovery is broken. Start with the gentle variant that Apple gives for flushing the DNS cache:
sudo killall -HUP mDNSResponder. I did not test it on this failure. If it doesn't help,sudo killall mDNSResponderwithout-9. That is what worked for me. - "stuck preparing": the iPhone is found, but TCP doesn't go through. Check for a VPN and packet filters on the Mac. TN3158 explicitly names VPNs with Packet Filter rules and security configurations built on PF: they block the link-local IPv6 that Xcode uses to talk to the device. If everything works on another network, for example through Personal Hotspot on the iPhone, the problem is the network, not the Mac.
- After an iOS update. The Xcode 27 documentation for Device Hub says the device has to be paired again after a system update. It also advises rebooting the device if it doesn't appear after you tap Trust. In my case a reboot did not bring Wi-Fi back.
Restarting remoted and usbmuxd isn't on this list. In my logs the wireless connection never broke because of them.
What one case can't show#
- This is one incident on one Mac. I saw that restarting
mDNSResponderworked, but I don't know whether-HUPwould have been enough. - The log doesn't show why
mDNSResponderstarted handing out the "invisible" interface. - Apple does not recommend restarting daemons. An Apple Developer Tools engineer answered a suggestion to kill
remotepairingdlike this: "There are no known issues for which this step should be necessary, so if there are issues, we want to know about them". If a restart helped, Apple asks for a Feedback Assistant report with the output ofxcrun devicectl diagnose.
If you also found the three killall commands in a search, you don't need to run all three: check the log with step 3 and restart only what is broken. Another of my log-based write-ups on Xcode covers a launch crash with dyld: Symbol not found. And if you have no iPhone at hand at all, look at the iPhone Duo simulator in Xcode.



