47

I am making an app in Xcode 9.2 and trying to run it on my iPhone (5S running iOS 11.2.1), Xcode compiles the application fine (I can run it in the simulator) but it does not run on my iPhone.

When I try to run it on my iPhone it just says "iPhone has recently restarted" and "Xcode will continue when iPhone is unlocked." Now, my phone has not recently restarted and I tried unlocking the phone and restarting it but neither works. I also tried restarting Xcode.

Is anyone else getting this "recently restarted" error? Is there anything I can do about it?

Max MacLeod
  • 26,115
  • 13
  • 104
  • 132
brettfazio
  • 1,136
  • 10
  • 25

5 Answers5

95

Unpair the device and pair it again from xcode -> Window -> Devices will solve this issue.

Posted as answer after the confirmation from @brettf.

RJV Kumar
  • 2,408
  • 1
  • 19
  • 28
32

if you using vpn services, then you need to turn off vpn. It will help

Artsem Sharubin
  • 388
  • 3
  • 10
  • 4
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 08 '22 at 00:40
10

If you're using a VPN on your iPhone that may be causing the problem - at least it was for me. Things went back to normal once I turned off my iPhone VPN.

I didn't have a problem while a VPN was enabled on my Mac, but it may be worth turning that off as well if you still have issues when the iOS device VPN is turned off and the device still won't connect correctly.

Trev14
  • 3,626
  • 2
  • 31
  • 40
  • Can confirm disabling VPN on device resolves this. The Xcode error alert is misleading. Have submitted FB12061987 to Apple requesting correction. http://feedbackassistant.apple.com/feedback/12061987 – Max MacLeod Mar 17 '23 at 10:41
2

Just to clarify:

  1. Unplug device

  2. In Xcode, windows -> devices and simulators

  3. Right-click the device shown in the left pane. Select 'Unpair device'

  4. Plug in device

  5. Follow the prompts on the iPhone and Mac

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
0

I just encountered this problem for Xcode 12(both release and beta version), the unpair and repair solution does not resolve, so I reset all settings(Settings -> General -> Reset -> Reset All Settings), and then the problem solved.

tomisacat
  • 506
  • 4
  • 12