Xcode says my "iPhone has recently restarted" and won't run
Asked Answered
B

5

49

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?

Barina answered 27/12, 2017 at 1:25 Comment(0)
P
96

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

Posted as answer after the confirmation from @brettf.

Panacea answered 27/12, 2017 at 16:21 Comment(8)
This works also for iOS 11.2.5 on Xcode 9.2, but you must disconnect the cable first. Otherwise Xcode will just crash.Thermocline
This works also for iOS 11.2.6 on Xcode 9.2, but you must disconnect the cable first. Otherwise Xcode will just crash.Kenner
What if it's connected through Wifi? I've unpaired and now I need a cable to pair again.Sanctum
@CanPoyrazoğlu had the same situation, in Xcode -> Window -> Devices disabled 'Connect via network' option and it also solved the issueDinghy
@DimaCheverda so if I disable it there, can I enable it again without plugging it with a USB cable first?Sanctum
@CanPoyrazoğlu Not sure, the reason to do this is to completely disconnect an iPhone from XcodeDinghy
I faced all your solution, but this last time (Xcode 14.1 macOS ventura) I just restarted XcodeDangerfield
In my case disconnecting and connecting again the cable worked.Bandoleer
D
34

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

Dysphasia answered 30/6, 2022 at 12:34 Comment(1)
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.Jaynejaynell
S
13

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.

Stray answered 21/9, 2022 at 4:44 Comment(1)
Can confirm disabling VPN on device resolves this. The Xcode error alert is misleading. Have submitted FB12061987 to Apple requesting correction. feedbackassistant.apple.com/feedback/12061987Cassey
L
3

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

Lithesome answered 10/8, 2018 at 2:48 Comment(1)
Had this error in Xcode 14.3.1, but for an Apple Watch. These steps fixed it.Obscurant
S
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.

Santoyo answered 16/4, 2021 at 8:1 Comment(1)
OK but worth mentioning to readers that the reset will completely wipe all device data and settings.Cassey

© 2022 - 2024 — McMap. All rights reserved.