Xcode 15, how to uncheck "Connect via network" for physical device?

This thread has been locked by a moderator; it no longer accepts new replies.

In Xcode 15, the checkbox for "Connect via network" is grayed out and cannot be unchecked. However, I would like to disable it because debugging via network is too slow for me.

Does anyone have an idea how I can disable this?

Answered by DTS Engineer in 771548022

Last week Apple published TN3158 Resolving Xcode 15 device connection issues that addresses this topic in depth.

IMPORTANT While this technote is associated with changes in macOS 14.4 and Xcode 15.3, both currently available as release candidates, installing these builds will not automagically fix all device connection problems. Read TN3158 for more backstory on this.

Because I want to separate the pre- and post-TN3158 discussion of this issue, I’ve locked this thread. If you have more to say on this subject, I’ve created a new thread for that discussion, namely Xcode 15.3 device connection issues.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Pre-TN3158 bugs

FB13198191 FB13203790 FB13204677 FB13208687 FB13210513 FB13211128 FB13231882 FB13246000 FB13256031 FB13267950 FB13278689 FB13350507 FB13380011 FB13474705 FB13513987 FB13601388

Revision History

  • 2023-03-05 Made major changes to reference TN3158.

  • 2024-02-09 Added more bug numbers.

  • 2024-01-09 Added more bug numbers.

  • 2023-11-09 Added more bug numbers.

  • 2023-11-08 First posted.

Boost

It is basically unusable. Im working on a hybrid app at the moment. RN with some parts being native modules. Given that metro also is handled throught wifi, things that would have taken a couple of seconds are now taking a couple of minutes. How is this considered to be an update? Just because of this, I have to give different estimates on when my tasks will be completed. Apple, please fix this nonsense ASAP.

I was hitting this problem and found Xcode kept trying to connect to other devices that it had used previously, even though I wasn't current debugging with them.

eg, it would try and connect to my personal phone and watch over the wifi network even though I wasn't using them and I had the test device connected via usb. As a workaround i tried two things (not sure about the second one, but it all seems pretty good at the moment).

First thing I think helps the most was go into Window | Devices And Simulators and set the Run Destination for all devices to Never and then go back to just the devices u want to debug to Auto or Always - hopefully this will stop Xcode trying to connect simultaneously to anything it has ever used.

I've also got both ethernet and WIFI running (can't get air drop to work over ethernet, despite Apple saying iOS 17 it does work, and the ethernet interface is much faster generally). So I've changed the priority of the services in System | Network so that ethernet is above WIFI

These two changes seem to help a lot and for me it's back to what it used to be

Basically unusable and unable to do any work on device anymore.

Debugging on Xcode 15 is extremely slow and completely unusable. It's kind of a shame. There is no way to force cable-only debugging. Disabling WiFi and Bluetooth on macOS and iOS does not solve the problem.

Filed feedback FB13380011.

Debugging is slow for me, like others reported, but this Feedback report specifically addresses when Xcode 15 completely hangs while launching an app for debug. It might shed some light on things, and includes a stack trace for Xcode.

This full freeze of Xcode (and the iOS app while connecting to the debugging process) occurs about once every dozen launches. The iOS app being launched hangs on the Launch Screen. Happens across projects, even new ones. When it occurs, Xcode has to be force quit and restarted; same for the iOS app. Then, things work again for awhile.

Hopefully this helps!

Just tried it on Xcode 15.1 Beta 3 (15C5059c) and iOS 17.1.1 (21B91), can confirm this is still an issue.

Let's strap in and be prepared to deal with this for quite a long time. Meanwhile, I want to offer a workaround that works for me 100% of the time, although judging by what we have been seeing in this thread, no workaround posted so far works for 100% of the people 100% of the time.

Background of my workaround:

  1. I noticed that when Xcode 15 and iOS 17 work together, they are pretty persistent in using the network as the debug method; as @eskimo said, the cable should be considered a virtual network, but in practice, Xcode 15 always prioritize my Wi-Fi
  2. The persistency is so prevalent, to the point that even when I turn off all networks on my iOS device, Xcode still tries to hunt the iOS device down over Wi-Fi
  3. Continuing from point 2, I found the only way to guide the stubborn Xcode to reconsider how it should connect to iOS is to quit Xcode and start it from scratch

Steps to workaround:

  1. Start your regular debug session with a cable plugged in. Hopefully, a new version of Xcode already works for you without issue
  2. If it doesn't work, take your iOS device off the network and start debugging again. This can be turning off Wi-Fi, entering airplane mode, etc.
  3. When step 2 fails, quit Xcode completely, restart Xcode, and start debugging. We are leveraging Xcode's stubbornness to our advantage in this step; it should be trying a cable connection relentlessly now
  4. If your device has a backup network, such as cellular, it should be working now, and you can feel free to turn your network back on. If your device does not have a backup network, it will display an error message saying you need to connect to the internet to authorize the App, move to the next step
  5. If your device does not have a backup network, e.g. a Wi-Fi-only iPad, make sure you see an error message complaining about network authentication when trying previous steps; once you see the error message, you will know for sure that Xcode is trying to debug over the cable. You can safely turn the Wi-Fi back on and continue your debug session.

More data points for Apple debugging this issue:

  • In my setup, I connect my MacBook to a HP TB Dock G2 (https://support.hp.com/us-en/product/details/hp-thunderbolt-dock-g2-with-combo-cable/21816261), my iOS devices does not connect to my mac directly, they connect to it via the dock.

deverlof wrote:

Can you point more precise than "Xcode Release Notes"?

My point was that:

  • We don’t make official announcements here on DevForums.

  • If we do have anything official to say about this, the place to look for that would be the Xcode Release Notes.

So, if you’re being affected by the issue, I encourage you to monitor the Xcode release notes for updates. Then again, that’s nothing new (-: The Xcode release notes always make for an interesting read.

ps Sorry about not responding earlier. When you reply in the comments I’m not notified. It’s best to reply as a reply. For this and other tips, see Quinn’s Top Ten DevForums Tips.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Answered in https://stackoverflow.com/questions/77135232/checkmark-connect-via-network-in-physical-device/77506622#77506622

Get an Application Firewall such as LuLu and disable all connections for Xcode.

I had this issue and posted here earlier. I thought Apple rolled something out that fixes this, as I've not had this in a few weeks now. Currently running Version 15.0.1 (15A507) iPad 10.5 Pro iOS 17.1.1 (21B91). Not sure what changed to me, but debugging over USB is back to regular speeds and even wireless debugging is fast now. Not sure what happened so I expected all the recent messages here to be the same :/

My iPhone 15 Pro annoyed me by always connecting to Xcode automatically. This worked for me in getting of this device from the automatic perspective of Xcode:

Be sure the device is not connected with a USB cable. In the Devices and Simulators window, you should have some kind of a round "network" icon to the right of the device's name.

Right-click on the device and choose Unpair Device from the menu.

At least in my case, the iPhone 15 Pro disappeared from the Xcode sidebar and didn't appear again upon restarting Xcode.

When I actually wanted to connect this device to work with it, I connected it with a USB-C cable and Xcode worked perfectly with it.

Your mileage may vary.

Same, Xcode debugging on iOS 17 device is unusable. Works ok on older iOS devices though. - Apple, fix this.

How can we test offline functionality now? I used to just switch to airplane mode to mimic loss of network and then disable airplane mode again to be back online. What happens now, is that I loose the connection to the debugger and the console output, when doing so. It took me a while to even understand, that it is not my apps fault, that the connection to the debugger keeps on dropping and the apps gets killed, as if it would crash, but without any crash logs... Unfortunately I do not have enough hair left, which I could pull out over this issue.

I am not even talking about the annoyance, when waiting for the deugging session to finally start.

I am not able to do my work properly and haven't found a way around it yet, does someone have some sort of "trick" to debug offline mode?

How can we test offline functionality now?

Try this:

  1. Turn on Airplane Mode.

  2. Run your app from Xcode.

  3. Turn off Airplane Mode.

  4. Run your test as you did before (that is, do some networking, turn Airplane Mode on, make sure your app responds properly, turn it back off again, and so on).

This works because, when Airplane Mode is on, Xcode is forced to use the USB network interface in step 2, and it sticks with that interface throughout the debugging session.

Obviously this is less than ideal, so I’d appreciate you filing a bug about this case too. Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I have the same problem, the application will just not install on the device. It seems to work if I disable the Wifi and Bluetooth on the iPhone but as others have said this is not really a solution. I don't understand why the checkbox that would (probably ?) fix the issue is greyed out in XCode, what is the point of displaying it in the UI if we are not allowed to use it ?

Do we have any updates? Besides the two issues mentioned by @florian_buerger

Why is that checkbox greyed out? Why is debugging slow?

I'm also seeing an issue where debug session take a long time to configure the device and sometimes I get errors that I will attach once I get a screenshot of them.

Xcode 15, how to uncheck "Connect via network" for physical device?
 
 
Q