zhan bobo
zhan bobo

Reputation: 51

iPhone can't be detected in Xcode

I try to install app on the iPhone(iOS 11.2.6) and iPad using Xcode 9.2. It seems Xcode can't connect to the iPhone.

After build success, it stuck on tips as below

error tips

when goes to window -> devices and simulators

error info

Help/Suggestion.

Many THX!!!

Upvotes: 3

Views: 12436

Answers (5)

Abhijith
Abhijith

Reputation: 3394

If you recently installed/updated Xcode, make sure you install command line tool.

Upvotes: 0

Jamil Hasnine Tamim
Jamil Hasnine Tamim

Reputation: 4448

Xcode and the GDB connection is quite temperamental. The device and your Mac can become unsynchronised with each other. My checklist for this sort of thing:

  1. Restart Xcode.
  2. Delete the .app from your iOS device, do a Clean then Rebuild.
  3. Disconnect, reconnect device.
  4. Restart iOS device (90% of the time it fixes things)
  5. If all else fails, restart your Mac (unlikely but it did fix an issue once for me).

From question: Error : The service is invalid

Data remove process: https://www.macworld.com/article/2364290/ios/four-ways-to-delete-ios-apps.html

  • Or please check your iphone and xcode update version of OS!

Do you sign in with your dev account with xcode? Example image given below: enter image description here

You can try also with network connection: https://i.sstatic.net/VLwMY.jpg

Upvotes: 8

zhan bobo
zhan bobo

Reputation: 51

Finally, I figure it out how to solve it. I have two iPhones, one is running iOS 11.2.2. It can be detected in Xcode 9.2. Another one running iOS 11.2.6 can't be detected in Xcode 9.2. I tried all the solutions above, it still not work. After I upgrade the iPhone running iOS 11.2.2 to iOS 11.2.6. When I connect this iPhone to Mac, Xcode take a little while on "preparing debugger support on iPhone". Then anything just works fine. All devices can be connected in Xcode 9.2. It seems some conflicts occur between two different devices running different iOS minor versions respectively.

Anyway, thanks to everyone who give me suggestions. Many THX!!!

Upvotes: 1

KAR
KAR

Reputation: 3361

In Xcode 9 and above you can run app without connecting it to mac.

  1. First set the device lock in iPhone.
  2. Then connect it to xCode and go to Window -> Device and Simulators.
  3. Select your device from left side list and check Connect via Network checkbox.
  4. Then disconnect the device and Go to settings and Enable Network sharing from Sharing setting.
  5. Connect your iPhone to wifi of your mac and run the app.

It will work in Xcode 9 and above.

Upvotes: 0

Mr.Javed Multani
Mr.Javed Multani

Reputation: 13236

Please follow the steps:

  • Delete derived data
  • Disconnect the iPhone or Device which you are trying to installation of app.
  • Restart the Xcode.
  • Connect the Device
  • Clean + Build
  • Run the app.

Make sure you are using latest version of Xcode which is supporting the iOS 11.2.6.

Upvotes: 0

Related Questions