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.

Post not yet marked as solved Up vote post of lothsun Down vote post of lothsun
93k views
  • 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.

Add a Comment

Replies

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.
  • rebooting phone and mac has no effect. Also when I connect the phone, I don't get a stable USB connection. It keeps reconnecting every second. When I restart the usb deamon on the Mac I do get a stable USB connection: This is the command I use to restart the usb deamon: sudo killall -STOP -c usbd

  • The power cycling has to do with ah undocumented 'feature'. If I have have a low battery on my phone and try to plug it into my laptop, i also get the power cycling. It's because the phone is drawing too much current and either the mac or the iPhone calls it quits and retries. When I plug in with a full battery I don have any such issues.

    --pat

Add a Comment

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.

  • This issue drives me crazy.

    I have an iPad and an iPhone, this issue never ever occurs on iPad, but will occur on iPhone every 6-7 days.

    Remove the device from Devices and Simulators and re-add it does not work for me.

    I don't know it the bug of Xcode or of iOS. If you check the Developer in Settings on iPhone, you will see it's missing.

    That means that I need to reboot my iPhone every 6-7 days when it occurs.

  • it acually worked... bruh something strange is going on here

  • Not worked for me. I tried each possibility that was mentioned. but no luck. I have Xcode 13.2.1 and iOS 15.5 on my mobile device

Add a Comment

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.

  • iOS* 15.3 beta

  • Same Issue Here, and still ongoing. Above all Ideas doesn't work. Did you solve this issue?

Add a Comment

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

  • iOS 15.3 "Unable to prepare … for development." None of the possible solutions above works for this issue on my iPhone and iPad?

Add a Comment

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.

All reboot, restart, unpair, etc. approches were to no avail. Re-installing XCode to a previous version worked.

  • I was going to try your suggestions, but I found a version of XCode on the Apple Developer site that was Beta, and reading the synopsis I noticed that it was the version that had the compatible SDKs, so for me, it was resolved by downloading the Beta version of XCode and using that. The Beta version co-exists with the prior release version in the Applications folder on the Mac.

Add a Comment