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.

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

I succeeded after everything updated to the new latest version.

  • iOS on my device
  • Xcode
  • Mac OS

OMG, this is so awful. I was able to plug in my iPhone directly into my laptop running Xcode and was able to run an app i'm building from Xcode no problem. I then tried my wife's iPhone, nothing. I mean....nothing. Both phones have the exact same version of iOS installed.

Rebooting the laptop, rebooting the phone, restarting everything, and still nothing. I keep getting the "Failed to prepare device for development, please unlock and reconnect your device", which I've tried countless times to no avail.

How can things be broken so bad?

Same thing. Everything is updated, rebooted, and reconnected. Still doesn't work. I hate it

Hey everyone,

For anyone still having this issue now, check this top answer on stackoverflow :

https://stackoverflow.com/questions/71618452/failed-to-prepare-device-for-development-with-xcode-13-2-1-and-ios-15-4-devic

Worked for me :)

I found solutions here, this is perfectly worked for me

  1. First check compatibility version for xcode with iOS version from following https://developer.apple.com/support/xcode/
  2. Now check the list of devices support to your Xcode from 'Device Support'
  3. To get into 'Device Support' :: Open Finder -> Applications -> Scroll to Xcode -> Right Click -> Show Package Contents -> Contents -> Developer -> Platforms -> iPhoneOS.platform -> DeviceSupport This is the list of devices folder support for your Xcode
  4. Now check for your iOS version from iPhone device :: Open Settings from iPhone -> General -> About -> Software Version

If the 'Device Support' folder does not contains the folder of your iPhone iOS Version, then you need to add respective folder from following link https://github.com/iGhibli/iOS-DeviceSupport/tree/master/DeviceSupport

  1. From above Github page, select device version & download zip file
  2. Now extract file & you will get the folder for your iOS version
  3. Copy this folder into Finder -> Applications -> Scroll to Xcode -> Right Click -> Show Package Contents -> Contents -> Developer -> Platforms -> iPhoneOS.platform -> DeviceSupport

Disconnect device (if connected), restart xcode

  1. Before connecting device, delete derived data from xcode & clean cache using cmd + shft + k. Then make sure to reset 'Location & Privacy' from device :: From iPhone device go to Settings -> General -> Transfer or Rest Phone -> Reset -> Reset Location & Privacy -> Enter passcode to continue
  2. Now connect your iPhone device with macbook (through cable), xcode will detect your device & you can run your application

check out following link

https://stackoverflow.com/a/72143610/15716725

Rebooting both devices does the trick for me, but would be nice for a fix so that all this rebooting doesn't have to constantly occur every time I want to work on one of my apps. Rebooting to fix issues is time consuming and annoying, rebooting to fix issues is such a "PC/Windows" thing to have to do. Part of the reason I love my Mac so much over my Windows PC was because I got away from stuff like this.

Hey, Apple Team... Are you EVER going to make this work reliably? Clearly this has been an ongoing issue for lots of developers. It's certainly been an ongoing issue for me.

It feels like your dev team is happy with the "Have you tried turning the computer off and on" answer for this... Which... would be embarrassing, even if it worked reliably.

It does not.

You own all the hardware and software. Please fix this so it works AT ALL RELIABLY.

SOLVED!!! It's matter of missing Provisioning Profiles in Developer Area. See Certificates, Identifiers and Profiles.

Working development environment:

  • macOS 12.5
  • Xcode 13.4.1
  • (iPhone 7) iOS 15.6

Yesterday (2022-09-13) updated to:

  1. macOS 12.6
  2. Xcode 14.0
  3. (iPhone 7) iOS 15.7

Result: Xcode 14.0 says about iPhone it "failed to prepare device for the deployment".

Downloaded Xcode 13.4.1 xip package, unpacked it (xip -x), copied to /Applications. Started Xcode 13.4.1, it immediately was able to work with my iPhone 15.7. Deployed project to it. Quit Xcode 13.4.1, opened Xcode 14.0, now it was able to work with the iPhone.

failed to prepare device for deployment
 
 
Q