failed to prepare device for deployment

I have an iphone xs running public beta 13.5. I have tried running an app I've been working on on my phone and I keep getting a "Failed to prepare this device for deployment" error. I have tried with both the app store version of xcode as well as xcode beta 11.5 beta 2 (11N605f). I'm also using the free provisioning account.
Any help getting the app to deploy would be appreciated.

It seems restarting both devices a couple times resolved the issue.

Restarting once works for me! I was trying to install an app that I wrote to my iPhone device.
Reboot your iPhone device.
12

Could it be caused be incompatible iOS version ? My iPhone is iOS 14.6 and highest supported version by XCode is 14.5. But I downloaded XCode yesterday. It's a fresh install.

Had the same problem with IOS 14.6, Xcode 12.5.1 and the project designed to support IOS 14.1. My fix was to shutdown Xcode, reboot the iPAD, reconnect the iPad. All other steps failed to clear the inability to load the project on the test iPad. Hope this helps.

restart my iphone and mac works for me

Also happening to me. Restarting the Mac didn't help, restarting the iPad did help.

This is a very frustrating issue that is on-going. I have my iPad WiFi connected and it seems to occur more often if WiFi connected rather than USB-C connected, but due to Apple only providing 1 x USB-C on the iMac. WiFi connected is the only option.

To fix this I following the following process.

  1. In xCode Go into Window/Devices and Simulators. Select the device you are using
  2. It will likely show that the Device is unavailable or such error message.
  3. Power down the iPad. I found this causes the error message to go away
  4. Power back up the iPad. Devices and Simulators will then see the device and start to prepare it for use. WAIT until it finishes preparing the device and says it is ready.
  5. Try lunching the project to your device, it should now work ok.

Worse case, if this doesn't work, you then need to remove the device from Devices and Simulators and re-add it.

I find I need to do this about every 3-4 days or so. Quite a nuisance and something Apple needs to sort out.

Good luck.

Really odd for me but I went to the Devices screen (xCode -> Window -> Devices &..... ) It said that the device was not ready. I unplugged and replugged (which I had done before) but this time it worked. Sooooo oddd

Deleting the installed app from the iPhone, disconnecting, and building the project again worked for me

This happened to me after I upgraded to 15.3 beta update. None of the suggestions on this or other similar questions worked for me. I noticed that when I unpaired the phone and then plugged it back in, it went straight to the error. Finally, I uninstalled XCode and re-installed it. When I connected the phone after installing XCode, I saw that it was preparing the phone for development afresh (as opposed to going straight to the error). I don't know if it was necessary to uninstall XCode but that's what worked for me.

I had a same issue and I restarted my phone and reconnected then it worked!

My solution was disconnect my iPhone from bluetooth and wifi. Once he couldnt connect to Watch he was skipped from the connection flow. Hope it help someone. ;)

I encountered this when attempting to update Xcode 13.1 -> 13.2 and aborting the update. Restarting the Mac or iPhone did not resolve the issue. The solution was to finish the update of Xcode and it worked.

Hope this may be a partial answer for some.

I was having this issue big time with two of my iPad's. I was using Xcode 13.1 for one project because it uses SwiftRealm, which is not compatible with 13.2.1 (due to a compiler version issue). But having read some of the responses here, I decided to try to see if these iPads would be able to get updated for developer use if I used the Devices window on Xcode 13.2. Indeed that worked for both of them!

(I also have some kind of issue where Xcode asks me over and over for access to my Downloads folder. I always agree, but it doesn't seem to matter much.)

So then I went back to 13.1 to see if I could now download the app that uses RealmSwift onto the iPads. Though they are both iPad Air 2's, it worked great with one, but the other is giving me an obscure error where it says it is unable to download it because of some version mismatch, which it wanted me to report to Apple if the message was not correct. And when I retried it, it went back to saying that iPad could not be prepared for development.

Then, with this second iPad, I went back to the 13.2.1 Xcode, which was perfectly fine with downloading code to it, after I agreed that it could access the Downloads folder (again). And when I went back to 13.1, this time the second iPad worked as well.

So now they are both working with my 13.1 app, at least for the moment. Surely something is flaky here, but I can't quite fully describe it.

failed to prepare device for deployment
 
 
Q