iPhone not connected

I have my iPhone connected to Xcode. It used to work just fine recently. I see it in the Devices and Simulators section, but when I try to compile my app, it says:

D's iPhone 6S is not connected. Xcode will continue when D's iPhone 6S is connected.

In the Devices and Simulators I see it as disconnected.

I tried restarting the phone, turning it's wifi on and off. It's connected to the same wifi network, I tried restarting Xcode, nothing. I run Xcode 9, Beta 6 at the moment. Does anyone has similar issue and hopefully know how to solve it?


Solution 1:

Troubleshooting:

  1. plug in your iPhone.
  2. Open Xcode
  3. go to window -> Devices and Simulators
  4. Right click on your device
  5. click Unpair Device and unplug it.
  6. restart Xcode
  7. restart your iPhone.
  8. Connect your iPhone via USB
  9. run your app
  10. then unplug it, and it should run via the wifi again.

Set up

  1. Window -> Devices and Simulators

enter image description here

  1. Choose your device from the list.

enter image description here

  1. Tick the box for "connect via network."

enter image description here

Solution 2:

In Window > Devices and Simulators, right click on your iPhone and "Connect with IP address", then enter the iPhone IP address and you're connected.

Solution 3:

Turn off WIFI on Mac, and also on your iPhone too. Then turn on WIFI again on both devices.

I frequently face this issue since I don't use USB cable to build the app to my iPhone. So this is my usual way to resolve the connection problem.