Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode error: Failed to prepare device for development

A simple phone restart will fix it

I have had to come back to this SO question twice in the past couple weeks. First time, I did have to update my Xcode and iOS versions, which fixed the issue. Now, the issue has returned, but there are no updates. I tried disconnecting and reconnecting my phone from my laptop, but to no avail.

What fixed it the second time was merely restarting my phone. I am curious if that would have fixed it the first time too, without needing to have updated.

I know this is just echoing the other answers here, but at the very least, I would recommend just starting with a simple phone restart and seeing if that fixes your problem. Here is the specific screenshot that I encountered, in case yours is the same (pro tip: you can open up the "Devices and Simulators" window by going to Window -> Devices and Simulators shift-command-2).

Errors were encountered while preparing your device for development. Please check the Devices and Simulators Window


Exact same problem here, this solved the issue for me:

  • Delete the app from the phone
  • Clean the Build Folder with: + shift + K
  • Delete derived data
  • Unpair device (from + shift + 2 window)
  • Disconnect iPhone
  • Restart iPhone
  • Restart Mac
  • Trust

After this, it worked for me.


I restarted my iPhone(14.2); now both Xcode 12.3 beta and 12.2 can run app on my device.


I could not get the phone to authorize until I had the paired Apple Watch trust the computer as well. A more helpful error message could be imagined.

Both the iPhone and the paired Apple Watch must trust the computer before the phone can be successfully prepared for development.


What worked for me was to go to Xcode Devices and Simulators window, then ...

  • right click on the Connected device, and select "Show Provisioning Profiles" menu item, then delete all the provisioning profiles,
  • right click on the Connected device, and select "Unpair Device" menu item
  • Unplug and reboot the phone