362

I have updated to Xcode 12.3 beta. device version is 14.2, but Xcode complaining:

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

Failed to prepare device for development

iPhone directly connected to MacBook. I have tried all mumbo jumbos on the web. but no success any idea?

enter image description here

Unable to prepare DEVICE for development

Please check the connection to the device, and review all errors in the Devices and Simulators window.

6
  • 7
    Did the mumbo jumbos include restarting your device and making sure it has enough free space? Nov 23, 2020 at 19:19
  • 120 Gb available Nov 23, 2020 at 20:07
  • 1
    I've had a couple of similar issues, but they've all gone away after some combination of macOS/iOS restarts and/or disconnecting/connecting the device. I assume you've already tried those. No other ideas, sorry! Nov 23, 2020 at 20:13
  • P.S. If you're jailbroken, try it in jailed state. It could be the developer profile isn't trusted. Jul 20, 2021 at 1:03
  • 3
    I got this error on Xcode 13.1 when my iPhone Xs MAX updated to iOS 15.3.1. Updating to Xcode 13.2.1 solved the problem. (Restarting the device and my Mac, disconnecting/reconnecting, deleting the device, deleting the app, etc. all did not work for me.) I think Xcode has to stay "ahead" of your iOS version. It would be nice if the error message told you to update Xcode! Feb 22, 2022 at 17:59

48 Answers 48

664

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

9
  • Restarting didn't quite work for me (started happening after updating iOS device to 14.4 18D52), but the below comment suggesting to uninstall, clean the build folder & repair did: stackoverflow.com/questions/64974291/…
    – Vixxd
    Mar 2, 2021 at 4:35
  • This worked for me, with the additional step of having to have Xcode re-trust the device. I just followed the prompt on the device and entered my device passcode.
    – Kai
    Mar 9, 2021 at 14:36
  • Restarting helped for Xcode 12.4 (12D4E) with iPhone iOS 14.4.1 (18D61). A message will appear before running the app on the device: "[...] Copying cache files from device [...]", but this is fine.
    – user5924595
    Mar 19, 2021 at 8:07
  • 12
    Restarting device not working for me, Xcode 13, ios 15 Mar 10, 2022 at 10:27
  • 1
    Restarting the device does not work for me, latest Xcode 13.2.1. Since latest iOS update (15.4.1). WARNING! THINK TWICE about updating your test phones to latest iOS. This has permanently broken this for me. Can't run to any iOS 15.4.1 devices. Already filed Apple radar: feedbackassistant.apple.com/feedback/9989952 Apr 20, 2022 at 23:25
246

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.

18
  • 8
    This worked perfectly fine for me, Im on Xcode(V 13.1), my iPhone(OS 15.4.1) -- I downloaded device support version 15.4 from the link you provided -- It worked like a magic --- Thank you very much
    – DevT
    Apr 6, 2022 at 15:01
  • 11
    Worked like a charm. It's mind-blowing that such a common task (I am a developer and just updated my iPhone) requires this much manual labor! Apparently, Apple doesn't give a damn about developers... sigh...
    – Aidin
    Apr 22, 2022 at 22:05
  • 4
    Finally it worked! I'm so annoyed that my perfectly up-to-date XCode didn't have the device support for my perfectly up-to-date iPhone! It only had support for iOS up until 15.2, which is very silly, in my opinion.
    – turiyag
    May 4, 2022 at 21:54
  • 1
    great answer!. worked for me. xcode 13.1 and iOS 15.4.1 May 24, 2022 at 5:08
  • 1
    Dear user @Rajni gujarati your answer worked like a swiss watch. I've had this issue with XCode 13.2.1 and iOS 15.4.1. Thank you very much for your answer.
    – R3muSGFX
    May 30, 2022 at 19:51
91

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.

16
  • 3
    All I did was clean build folder, restart both Mac and phone, then it worked
    – bobobobo
    Dec 16, 2020 at 23:18
  • 1
    Why tho why tho why? Thanks it worked for me.
    – sam k
    Dec 27, 2020 at 5:16
  • 1
    The only steps necessary are these three. || Delete the app from the phone || ⌘ + shift + K -> clean build folder || Unpair device (from cmd + shift + 2 window) Dec 30, 2020 at 11:02
  • 1
    ^ I also only had to replicate the steps outlined by @MarcusZiadé above
    – Vixxd
    Mar 2, 2021 at 4:36
  • 2
    Having this same problem with Xcode 13.2.1 and iOS 15.4 on an iPhone 8 device. Anyone have a solution to this problem with these versions? I tried the solution in this answer in a few different combinations. I haven't fixed the problem.
    – daniel
    Mar 25, 2022 at 14:06
34

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

27

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.

4
  • 3
    You've saved so many hours!! Simply not having the watch on my wrist made me not see that prompt...
    – Victor
    Jan 17, 2021 at 21:18
  • Same problem here. Using XCode 12.5. This got rid of the message that it can't prepare the device for development. I didn't check my apple watch for a request for pairing. Now I have the problem that my phone iOS is 14.6 and XCode does not have the device support files. Don't know where to find them.
    – chmike
    Jun 18, 2021 at 8:51
  • Thank you! I'd spent hours trying every other possible solution but this is the one that worked.
    – Jon Cox
    Oct 23, 2021 at 12:27
  • Lol. Same here, they should think about adding some sound chime or something
    – iuliu.net
    Dec 10, 2021 at 12:26
12

If u are looking this because, your ios 15.7 device (latest for iPdas at the moment) show this error on xcode 14.0 (latest at the moment) it is a bug related with the xcode version.

Check Here.

enter image description here

Update

This issue is fixed in Xcode 14.0.1

3
  • 1
    Could you add details of how you know it's xcode 14 bug?
    – Jona
    Sep 21, 2022 at 18:01
  • 2
    @Jona Thread: developer.apple.com/forums/thread/714388 — Quote: Xcode 14.0.1 Release Candidate is now available for download, addressing this issue. If you continue to see issues using Xcode 14.0.1 with iOS 15.7, please let us know through Feedback Assistant, and post the FB numbers here. — Download page for Xcode 14.0.1 RC: developer.apple.com/download/applications — It's working for me; Xcode is building to iOS 15.7 now. Sep 23, 2022 at 20:25
  • 1
    I have iOS 15.7. When i updated from xcode 14.0 to 14.0.1 - it works for me! thanks o lot for advice Oct 13, 2022 at 19:51
10

In my case was to keep the iOS version with my Xcode version in sync.

Xcode 12.3 with iOS 14.3
1
8

Thanks Matt for hint: Updating device iOS to 12.3 beta fixed the problem.

if you updated you iOS to latest beta version, you should also use latest Xcode beta version.

1
  • why do apple always have them in reverse???? releasing dev tools first is a better arrangement Oct 25, 2023 at 15:20
8

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
3
  • Disclaimer: Not only did this not work for me but also nuked all the other provisioned apps on the device (obviously). Don't try this unless you're prepared for that to possibly happen.
    – Magoo
    Mar 23, 2022 at 10:39
  • Sorry to hear that ... but yeah that would delete all your developer provisioned apps. Given that this solution is a 100 to 1 compared to the accepted resolution, YMMW. A simple reboot did not help me, so I had to go nuclear. Looks like a few others had to as well.
    – Tache
    Mar 25, 2022 at 23:24
  • Unpair Device , worked for me
    – 郭介騵
    Apr 26, 2022 at 12:09
8

I tried most suggestions here. The only thing that ended up working was unpairing my phone in Xcode then unpairing my apple watch from my iPhone. Connects just fine now. iOS (14.3) Xcode (12.3)

3
  • 1
    Same thing here. Rebooting device and laptop, re-pairing phone, and even upgrading Xcode and iOS did not work.
    – jvhang
    Feb 1, 2021 at 15:46
  • same here with ios 14.4 and xcode 12.4. thanks a lot for this suggestion!
    – berlindev
    Mar 4, 2021 at 14:13
  • I don't think there is a way to go back to a previous version in iPhone. Is there?
    – daniel
    Mar 25, 2022 at 14:07
5

Exact the same problem with Xcode 12.3 beta ; for me, just have to: Disconnect the phone Restart the phone still on ios14.2

5

Solution: Update your Xcode to a newer release date than your iOS Release Date.

1
  • 4
    I had this problem on Xcode 13.1 with my iPhone Xs Max on 15.3.1. The unplugging/plugging back in and restarting the the phone and my Mac (OS 11.6.4 (20G417)) did not solve my problem. I updated Xcode to 13.2.1 and the problem went away. Feb 22, 2022 at 17:56
3

-> data cable off

-> data cable on

and it works :)

2
  • 1
    I don't understand, please elaborate Mar 24, 2022 at 9:55
  • I imagine people have tried this, prior to Googling this error..
    – FooBar
    Apr 11, 2023 at 19:08
3

just Clean the Build Folder with: ⌘ + shift + K

3
  • The most unhelpful solution ever!
    – 钟智强
    Mar 29, 2023 at 4:46
  • are you try it ? Apr 1, 2023 at 12:53
  • No, I am John. :-p , I had tried it eventually.
    – 钟智强
    Apr 5, 2023 at 6:23
2

I experienced this problem when using the iPhone's personal hotspot on my Mac. The fix was to disconnect the phone from the computer, then disconnect from the personal hotspot and reconnect again. Apparently this makes the mac use the wifi hotspot (and not the usb hotspot on the iPhone, which messes things up when debugging).

1
  • 1
    You don't even have to be using the personal hotspot, just having it turned on on the phone causes this error. THANKS - this has been bugging me for weeks.
    – Andy Dent
    Apr 3, 2021 at 10:24
2

As many people mentioned/suggested, restarting my iPhone solved the problem.

My setups are: Catalina 10.15.7, Android Studio 4.0, Flutter 2.01,and Xcode 12.4.

1
  • solved problem for me, simple restart phone :)
    – Mike
    Mar 19, 2021 at 22:18
2

I think having an apple watch paired to your iphone causes some issues.

I had trusted from my apple watch, but was still having this issue. Unparing my apple watch from my iphone was the only thing that worked for me:

  • unpair apple watch from iphone
  • unpair iphone from xcode

Restart both, and don't pair apple watch until the iphone is paired.

and, if you have any other problems, and are using flutter, run flutter doctor, and ensure you have cocoapods installed.

and once again, if Flutter issues, follow the details here to ensure you have your signing setup correctly

also, if things aren't working, then do a flutter clean, and then try again.

2

Updating Xcode is a fix because old versions of Xcode can't talk to new versions of iOS (see https://developer.apple.com/support/xcode/ for compatibility).

If you're stuck on an old version of Xcode you can use something like https://github.com/iGhibli/iOS-DeviceSupport or https://github.com/filsv/iPhoneOSDeviceSupport which installs the newer device support files into older versions of Xcode.

0
2

For me, the fix was going into Settings --> developer --> Clear Trusted Computers, then re-trusting your computer while Xcode is open.

Let Xcode do its thing with the "new" device and once its done I no longer saw the Failed to prepare device for development message, and was able to run successfully.

0
1

I just solved my issue removing the iPhone cable and putting it back.

1
  1. cmd + shift + 2
  2. Click the red cross to check error detail
  3. In most cases, the error message shows your xcode supported iOS version is lower than your iPhone's iOS version.
  4. Update your xcode.
1

If other answers don't work, try updating Xcode.

For me I was using Xcode 14.0.0. The release notes for 14.0.1 say

This update fixes an issue that prevents development with devices running iOS 15.7.

Indeed my phone is on iOS 15.7.

1

Go to:

  1. [Devices and Simulators Window](Cmd + Shift + 2):
  2. Look for a drop-down labeled Show run destination, It might be set to Never:
  • Change it to Always or Automatic.

That should fix it.

0

Nothing from the above listed helped me and also I have encountered this problem when the app was removed for a while. But turning off the phone for 10 mins solved the problem.

0

My Current Setting and Versions: XCode 12.4 and iOS 14.4

  • I had to update XCode since my iOS was updated. This fixed the compiler error in Unity and then the same message popped up during deployment. All I did was disconnect/re-connect.
1
  • It seems update in this version isn't mandatory, i'm using iOS 14.4 and Xcode 12.3 and it works fine. Maybe just need device support.
    – ytp92
    Feb 2, 2021 at 14:50
0

This solved the issue for me:

  • Delete the app from the phone
  • Clean the Build Folder with: + shift + K
  • Unpair device + shift + 2
  • Disconnect iPhone
1
  • This did not resolve the problem but good to know the shortcut for Unpairing devices Jul 17, 2023 at 1:54
0

Restarting the iPad works for me every time!

0

We encountered this error and determined it was due to a damaged iPhone cable. New cable, problem solved.

2
  • Not sure why someone downvoted you, we had the exact same problem, Device showed up on the list but we couldn't run the app and had this error message "Failed to Prepare...". Switched the cable to the exact same port and we saw the popup "Trust this Device" on the phone and XCode ran fine.
    – pauloya
    Oct 7, 2022 at 9:46
  • Thank you. I wasn't sure why I was downvoted either. The issue is real and I verified that the cable was actually damaged before posting my answer. I knew the answer could be helpful to others since a damaged cable can still mount a device and behave normally in certain ways, making it an elusive problem. In my case I could still transfer files from the device with other applications, so I didn't immediately think that the source of the issue with Xcode could be partial damage to the cable.
    – JD_dev
    Oct 8, 2022 at 18:08
0

I just had to unpair the phone from Xcode's Devices and Simulators screen and then tap Trust when connecting it to the computer to make my Watch work with Xcode

0

In my case, after updating iPhone to a newer iOS version then got this issue.

The solution is needed to update XCode to the latest version and everything is ok.

Not the answer you're looking for? Browse other questions tagged or ask your own question.