Xcode 9 Wireless debugging not working

Viewed 11703

For some reason the wireless debugging does not work here. Here is what I've done:

  • Using newest Xcode 9
  • Using newest iOS 11 on my iPhone 7+
  • Both devices are in the same network
  • Connected the iPhone via Lightning, selected "Connect via Network" in the Devices & Simulator menu
  • Run an app on the iPhone while still connected via Lightning - everything works

But as soon as I unplug the phone, Xcode is no longer able to connect with the phone. I can ping the phone with the Mac, but even the "connect via ip" option in Xcode does not work.

Anybody got tips on how to get this working?

6 Answers

I had the same issue, but it was intermittent - i.e. sometimes the globe would not appear next to the phone name in Xcode Devices and Simulators window and when the phone was disconnected from the lighting cable, I could not debug to it from Xcode. My fix was much simpler, though - I just turned WiFi on and off both on the Mac and on the phone. After the devices reconnected to the network wireless debugging was available again. This seems to be an issue with the network communication (regardless whether the device can be pinged or not).

Make sure System Preferences->Internet Sharing is enabled using USB ports:

Sharing is caring

I was able to find a solution to this on another stack overflow question: How do you perform wireless debugging in Xcode 9 with iOS 11, Apple TV 4K, etc?.

You can also check this answer: "Connect via network" wireless debugging not working Xcode 9

Near the bottom, from "IOS DEV". Briefly, the solution ended up to be to unpair my phone, disconnect and re-pair. After that Xcode automatically added it with the globe. As an FYI, I was able to ping my iPhone using the network utility prior to the un-paring but was still unable to get the phone to connect. good luck.

Restarting xcode is the only thing that fixed this intermittent connectivity problem for me.

I realized this can also happen if my Mac is connected to a VPN. I had to:

  1. Kill the VPN connection
  2. Turn the computer's wifi off and back on
  3. Open Devices and Simulators
  4. Plug the device in and the globe icon should appear.
  5. Unplug the device and make sure the globe icon is still there.
  6. Run the app via network!

Wireless debugging mysteriously stopped working for me until I turned off my VPN client. I now believe that I had the VPN turned off when I was trying it out the first time, but then the VPN auto-connected after my computer restarted sometime later.

Related