32
votes

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?

3
A generic final solution is to reboot the computer, have you tried it?Yun CHEN
@YunCHEN Yes, I tried a reboot of: the computer, the iPhone, and Xcode. None of the reboots have seemed to do anything.brettfazio
Unpair your device and try again.RJV Kumar
@RJVKumar This was successful. I can mark it as a correct answer if you post it as such.brettfazio

3 Answers

86
votes

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

Posted as answer after the confirmation from @brettf.

0
votes

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

0
votes

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.