2

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!!!

Mr.Javed Multani
  • 12,549
  • 4
  • 53
  • 52
zhan bobo
  • 41
  • 1
  • 1
  • 5

5 Answers5

8

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.stack.imgur.com/VLwMY.jpg

Jamil Hasnine Tamim
  • 4,389
  • 27
  • 43
1

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!!!

zhan bobo
  • 41
  • 1
  • 1
  • 5
  • Congrats! But may be I told you in my comment section about that! Happy coding. – Jamil Hasnine Tamim Mar 23 '18 at 20:10
  • The same problem occurs again when I update my device to latest iOS beta version. I install my apps by using TestFlight via iTunes Connect. (But you should join apple developer program first before using iTunes Connect services) – zhan bobo May 06 '18 at 05:25
  • Yes you must have developer account! – Jamil Hasnine Tamim May 07 '18 at 05:11
  • this is what it ended up being for me. I updated my XCode 3 months previous but apparently the most up to date iOS version didn't like it and it was too old. C'est la vie! Updated and restarted and it worked. – agrippa Jul 31 '20 at 08:48
0

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.

Mr.Javed Multani
  • 12,549
  • 4
  • 53
  • 52
0

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.

KAR
  • 3,303
  • 3
  • 27
  • 50
0

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

Abhijith
  • 3,094
  • 1
  • 33
  • 36