2

I am trying to build an app onto my iPhone using Xcode 14.

The app builds correctly and launches on an Simulator no problem. However, when I attach my iPhone 13 in the code device window it comes up as 'iPhone has recently restarted'. When I then run the app I get an error stating: 'The run destination iPhone is not valid for Running the scheme. iPhone has recently restarted Xcode will continue when iPhone is unlocked.'

The phone has not recently restarted and is fully unlocked.

I saw this was a common issue with Xcode 9, but none of the suggestions for that issue are resolving things on Xcode 14 (e.g. unpair and repair the device). Anyone know how to solve this?

Charlie S
  • 4,366
  • 6
  • 59
  • 97
  • 1
    Do you run on iPhone using cable or wifi ? And is network connection share enabled on iPhone ? – Ptit Xav Oct 16 '22 at 10:02
  • I run using cable. And yeah share is enabled on iphone. – Charlie S Oct 17 '22 at 09:10
  • 1
    Try without share as the share connection will run through the cable at the same time as xCode connection. – Ptit Xav Oct 17 '22 at 10:09
  • I get the error "destination iPhone is not valid…" when the deployment target has a higher iOS version than the device. And I get the message "Xcode will continue when iPhone is unlocked" often when the iPhone is actually unlocked. This problem is then solved by disconnecting and reconnecting the cable. – Reinhard Männer Oct 21 '22 at 08:59
  • Does this answer your question? [Xcode says my "iPhone has recently restarted" and won't run](https://stackoverflow.com/questions/47985316/xcode-says-my-iphone-has-recently-restarted-and-wont-run) – Max MacLeod Mar 16 '23 at 12:18

2 Answers2

11

This started to happen to me recently. It is solved every time for me by disabling VPN on the phone.

camazing
  • 126
  • 3
-1

Use Xcode 14.1 Beta 3 it will fix the issue but it is not very stable version.

user16930239
  • 6,319
  • 2
  • 9
  • 33