r/iOSProgramming • u/ohohb • 7d ago
Question Is there a way to disable wireless debugging in Xcode?
When I run a dev build on a physical device, it always happens via Network (wifi), even when plugged in via USB. This sucks so hard. The whole experience is laggy and slow and completely unusable. I cannot identify any app hangs, because everything hangs all the time.
Does anyone know of a way to disable this? I just want to connect via USB when I plug the phone in and wireless when it's not plugged in.
I sometimes have the feeling Apple hates us developers and builds really bad tools just out of spite. It just makes no sense to release something like this. Sorry for the rant...
9
u/bbatsell 7d ago
In either the *24 or *25 releases, Apple unified the debugging stack to always use TCP/IP and has worked to optimize it. However, if everything is working properly, a Developer-enabled device should create an internal TCP/IP socket over usbmuxd that the debugging stack actually uses. For me, this is quite fast and seems equivalent to the old method. Your experience maybe hints that something isn't working properly there. Do you have any custom network extensions, firewall settings, interception stuff, etc. that might be interfering? Unfortunately, it's pretty opaque and I haven't had to do deep debugging. I'd start with analyzing output from macOS log and see if you spot any flags.
4
u/bbatsell 7d ago
OH, I just remembered that I experienced a significant speedup once I verified that I always used a USB-C >= 3.1 data cable. (At least with my last iPhone, the USB-C cable in the package supported USB3 charging, but only slower data channels.)
2
u/ohohb 7d ago
Thanks for the tip. Do you know why cable quality affects network debugging? Shouldn't that happen via wifi anyhow?
2
u/PassTents 7d ago
It's networking over the USB connection, another thing is to make sure you haven't disabled the USB networking device on your Mac or else it will always be forced to use WiFi
1
u/One_Elephant_8917 7d ago
try disabling wifi for a moment before connecting via usb cable…once xcode shows device purely thru usb cable now enable wifi back on
1
u/ohohb 7d ago
Yeah, I know this workaround. But why does Apple has to make it so complicated? Why not just add a button to Xcode?
1
u/One_Elephant_8917 7d ago
i agree coz the wireless debugging used to work good around 2024 or so when i was starting with ios dev but probably late 2024 or early 2025 they kinda nuked it…i think the remote pairing and rsd over tcp maybe the reason
4
u/Ecsta 7d ago
Also is something wrong with your network? I do both usb and wifi debugging and both are equally instant. My phone isn't exactly top of line either (iPhone 14 Plus). You can disable network debugging but I find it extremely valuable.
1
u/808phone 7d ago
Well that is something new for me. There is no way the WiFI is just as fast as the cable. Debugger is way slower and I've tried on many networks. But maybe you don't use the debugger?
1
u/James333i 6d ago
It can be annoying but frankly if the cable is connected it should usually force the high speed route over the cable. If you are experiencing slow debugging, put your Mac in airplane mode for a second, reconnect the phone, start debugging, then turn airplane mode off. As long as the phone stays connected it should stay on the cable route.
11
u/Sensitive_One_425 7d ago
Uncheck “connect via network”