iPhone won't connect to Xcode over WiFi

Hello,


Just starting to learn Xcode and I can test the first chapter's app on my iPhone if it's conncted via USB-C. The book walks me through the part where I can allow Xcode to connect to the iPhone via WiFi, just checking "Connect via Network."


Yet Xcode cannot find my phone unless it's connected via USB. When I go to Devices that checkbox stays checked, unless I unplug the phone it which case that box doesn't even appear.


And yes, they are both on the same WiFi, it's the only one I have and it's up and running.


Any thoughs?

Replies

>The book walks me through the part where I can allow Xcode to connect to the iPhone via WiFi, just checking "Connect via Network."


What did the person you bought that outdated book from have to say when you asked them to $upport their product? Might as well get some of what you paid for, right? Does that book even know about Xcode 11.4.1? Pls. don't expect devForums to act as it's defacto support channel.


Do you have a paid Developer Program account or are you working with Xcode's free provisioning? Just curious...


In the mean time, via Xcode 11.4.1:

  • Disconnect your device and shut it off, then restart your (real mac, not a VM etc.) computer.
  • Open Xcode with the project you've already been able to build to your device.
  • Choose Window > Devices and Simulators, then in the window that appears, click Devices.
  • Turn your device on, cable it to your computer and confirm Wi-Fi is on, same network for both.
  • In the left column (Devices and Simulators), select your device, and in the detail area, confirm that 'Show as run destination' is checked, then check/select 'Connect via network'. Xcode pairs with your device ('connect via network' dissapears). Wait as necessary for any dialogs about xcode copying files from device.
  • Disconnect your device from USB.
  • Look at Xcode's build/run menu for your device, should be top of that list. Select it, hit ▶ (build/then/run), be patient.
  • Find the receipt for that book and send it back for a refund. Don't be tempted to replace it.
Post not yet marked as solved Up vote reply of KMT Down vote reply of KMT

We have some network debugging information in this Xcode help article.

I'm stunned it had to be done in that exact sequence (I had tried several similar but not identical approaches), but @KMT's solution worked perfectly for me (Xcode 12.5 beta 3).

reset network settings on the iPad helped for me:

general-> reset-> reset network settings

And I'm stunned how good and how arrogant KMT's answer is

There is an additional step that may be necessary, if you have access to your network configuration, you will need to disable client isolation on the WiFi access point. The exact configuration required will differ between network devices.

This setting blocks devices on the same access point from being able to communicate with each other. Changing it has security implications, especially for public/guest WiFi networks, so make sure you understand that first.