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
94k 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

I succeeded after everything updated to the new latest version.

  • iOS on my device
  • Xcode
  • Mac OS
Post not yet marked as solved Up vote reply of hige Down vote reply of hige
  • forgot to leave each version..

    iOS =15.3.1 (iPhone SE 2ndGen),Xcode =Version 13.2.1 (13C100),Mac OS =Monterey version 12.2.1 (21D62)
Add a Comment

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 :)

  • Thank you, this is the only fix that worked for me.

Add a Comment

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

  • Ios:16.4 Xcode:14.1 Benim için işe yaradı.

Add a Comment

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.

  • I am so with you... and unfortunately 20 reboots later, 'reboot everything' still doesn't work for me. To make matters worse the few times I've gotten it to work over the past few years, it then STOPS working again pretty quickly.

Add a Comment

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.

I had the same issue with Xcode 14, and a device running iOS 15.7. Two different macs (running the same config), tried rebooting both and the device, nothing worked. What fixed the issue was installing Xcode 13.4.1 and preparing the device with it.

Guys solution is 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

1: Check /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/ (for directory name of your iOS version). EG: 16.4.1 2: If the directory is missing download support files for 16.4.1 (your iOS version) from https://github.com/filsv/iPhoneOSDeviceSupport and place it in the above path. 3: Restart Xcode.

Worked for me with ios 16.4.1(a), xcode 14.2, macos 13.3.1

This problem occurred for me when my iphone automatically updated from 16.1 to 16.4.1(a)

This error shows because of iPhone OS version is not supported by Xcode that's why this warning popped up, so check which max ios version is supported by Xcode which you are using.

In my case, the Xcode version is 13.1 and my iOS version is 15.4 so what I did, First downloaded device support version 15.4 from here (Download according to your device version) and added this to my Xcode.

steps to add the file in Xcode:-

  1. Go to Applications > Right click on Xcode and Select Show Package Contents > Contents > Developer > Platforms > iPhoneOS.platform > DeviceSupport.

  2. Extract your device support file to DeviceSupport Folder.

  3. Restart Xcode and unplug and plug in your device.

As seen on StackOverflow post by Rajni