96

I'm getting message "This operation can fail if the version of the OS on the device is incompatible with the installed version of Xcode. You may also need to restart your mac and device in order to correctly detect compatibility." when I try to run an Xcode iOS project on my iPhone 8. I'm using Xcode 13.2.1 and iOS 15.4 on my iPhone 8.

I've tried the different solutions given in other posts here on stackoverflow, but I haven't been able to fix the problem. This one seems to be the latest identical question, just with previous versions of Xcode and iOS.

This post in this forums gives the solution to restart the iOS device and I did that and also restarted the mac. My Mac has macOS Monterey 12.3. My Xcode, Mac, and iPhone 8 all have the most recent updates. That post gives an answer for the same problem but with iOS 15.2.

I have recently changed settings in my iPhone 8 in Accessibility. Could that affect anything?

I found this error in the Xcode console for my device. Does this say anything about my problem?

com.apple.analyticsd xpc error 08:10:31.756711-0500 analyticsd [XPC Server] managed connection recieved connection invalidated: Connection invalid

daniel
  • 1,446
  • 3
  • 29
  • 65

14 Answers14

269
  1. Check /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/ for directory name 15.4 (your iOS version).
  2. If the directory is missing download support files for 15.4 (your iOS version) from https://github.com/filsv/iPhoneOSDeviceSupport and place it in the above path.
  3. Restart Xcode.
Simeon
  • 3,347
  • 1
  • 12
  • 15
  • 8
    Thanks for this, which sorted everything. Once I downloaded the 15.4.zip file from the link above, I unzipped it in the Downloads directory, then moved the 15.4 folder to the DeviceSupport directory. I did that with the help of this article: https://medium.com/@nayananp/how-to-add-device-support-files-to-xcode-4a7609b2f534. I then used 'chown' and 'xattr' to make everything the same as regards file groups and owners. Then shut down Xcode, my Mac, and my phone. Once I restarted everything and plugged my iPhone back into my Mac, I could finally recompile and see the app on the phone! – Andy Duncan May 04 '22 at 15:54
  • works like a charm. Its a generic fix which can be used to solve such incompatibilities in future aswell. Thankyou – srv_sud May 14 '22 at 07:18
  • It's help to me. – flyer2001 May 18 '22 at 08:19
  • Great!! Solved it!! I needed iOS 15.5 and found it here: https://github.com/iGhibli/iOS-DeviceSupport/tree/master/DeviceSupport – Paulo Belo Jun 24 '22 at 18:57
  • I'm stuck on MacOS 11.6.7 as I use an old MacBook Pro (Late 2013) so I can't get Xcode 13, but downloading the 15.4 support files fixed everything for me and I'm back up and running again on my new iPad 9th gen (with iOS 15.5) I didn't need to do any chown-ing or xattr-ing, I just downloaded the 15.4 zip file, unzipped it, and moved it to the folder specified above and it all worked as soon as I started Xcode again. – Sean O'Connor Jul 05 '22 at 14:31
  • why can't Apple provide a better error message and post a solution in their forum -- I know, I know, ... my question is rhetorical. – mobibob Jul 06 '22 at 20:57
  • If this still doesn't work, restarting the phone like @stackich suggested will work... Cmon Apple... – gazcn007 Jul 22 '22 at 03:45
  • 4
    If you are on iPhone iOS version 15.6 it is enough to download the zip version 16.0 - no need to change anything there. – ksysha Aug 02 '22 at 15:34
  • 3
    I'm on 15.6 and downloading 16.0 did not work for me. I tried renaming it to '15.6' (another article I read suggested renaming for example 15.3.1 -> 15.3) but no success. – Gabriel Jensen Aug 09 '22 at 19:30
  • 5
    @GabrielJensen try 15.6 from here https://github.com/JinjunHan/iOSDeviceSupport – Vignesh Aug 17 '22 at 03:50
  • I wonder where these guys got the iOS zip files? I hope there's one single source of the truth – nashihu Aug 28 '22 at 12:34
  • 6
    Why would you need to download that from some github repository? Isn't there a "official" mechanism in xcode to download those files? – hannojg Sep 11 '22 at 12:01
  • Even if the files in your directory (for me, 15.6) are present, I replaced them with the ones from the GitHub repo, and it seems like this works for me! – Mark S Sep 21 '22 at 18:23
  • I am trying for iOS 16.0.3 with iPhone 11 and Xcode 13.2.1 but not working. If anyone can help it works. I tried with 16.0 -> 16.0.3 rename as well but not working. – KDOSHI Oct 12 '22 at 07:19
  • Getting this message in iOS 16.4.1 but can't seem to find the support files for these. – John Gorenfeld Apr 27 '23 at 08:36
  • @JohnGorenfeld the file for 16.4 is there. You can find it right on the top of the readme file (as this is the current version). iOS 16.4 - https://github.com/filsv/iOSDeviceSupport/raw/master/16.4.zip – Simeon Apr 28 '23 at 18:01
  • Ended up updating and it worked – John Gorenfeld Apr 30 '23 at 06:55
  • 1
    @hannojg because Apple will force you to update Xcode to support the new iOS version (e.g. You need Xcode 14.3 to support iOS 16.4), but sometimes the latest Xcode version requires a new version of Mac OS (e.g. Xcode 14.3 requires macOS 13.0). Still, this version of macOS might not support our Macbook (e.g. macOS 13 doesn't support MBP 16). It looks stupid to buy a new MBP just to support development on new iOS version right? Let alone the f**king compatibility issue on new macOS and/or Xcode. – Albert Zhong May 08 '23 at 01:54
  • @AlbertZhong Same problem. I have a very old intel Mac and can't update Xcode to 14.3 since I can't upgrade to Mac 13.0. This is not compatible with my 16.4.1 iOS. I followed this answer but I'm unable to download iOS 16.4 files. It says 'Safari can't open page'. Is it accessible for others? – NightFuryLxD May 18 '23 at 08:33
  • @NightFuryLxD try using the terminal "curl -OL https://github.com/filsv/iOSDeviceSupport/raw/master/16.4.zip" – Simeon May 18 '23 at 11:44
  • @Simeon, Didn't work. Error - `curl: (28) Failed to connect to raw.githubusercontent.com port 443 after 75439 ms: Couldn't connect to server`. – NightFuryLxD May 19 '23 at 05:52
  • @NightFuryLxD It seemed that you are behind a firewall or something that prevents you from connecting to github.com or githubusercontent.com. Try using a VPN, proxy, etc. – Albert Zhong May 25 '23 at 07:46
  • @AlbertZhong Probably. I asked my friend in a different network to download. Worked... thanks. – NightFuryLxD May 25 '23 at 16:37
  • was trying to debug this problem with chatgpt for 4 hours today, searched stackoverflow and this was the first thing i found and it solved my problem. stackoverflow still the GOAT – Alec Mather Jun 19 '23 at 01:13
  • 1
    I had a beta OS on my iPad (16.6), downloaded the 16.5 release version into the directory and it worked, Thanks it I have been trying to find a solution for this for a a long time – Ahmed ibrahim Jul 25 '23 at 21:44
  • my iphone is 16.6 and that's not available... KMN – David Villasmil Aug 18 '23 at 15:28
62

Solution : Reboot iPhone.

I have the latest version of :

  • iOS
  • Xcode

Still was not able to run the app on my device.

Solution that worked for me: simple iPhone restart

Rajneesh071
  • 30,846
  • 15
  • 61
  • 74
stackich
  • 3,607
  • 3
  • 17
  • 41
36

Following solution work 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
  5. 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
  6. From above Github page, select device version & download zip file
  7. Now extract file & you will get the folder for your iOS version
  8. Copy this folder into Finder -> Applications -> Scroll to Xcode -> Right Click -> Show Package Contents -> Contents -> Developer -> Platforms -> iPhoneOS.platform -> DeviceSupport
  9. Disconnect device (if connected), restart xcode
  10. 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
  11. Now connect your iPhone device with macbook (through cable), xcode will detect your device & you can run your application

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

Ryan M
  • 18,333
  • 31
  • 67
  • 74
khirish
  • 537
  • 1
  • 7
  • 9
17

for Xcode 13.2.1, and running on the device with iOS version 15.5 https://github.com/filsv/iOSDeviceSupport/blob/master/15.5.zip download this zip and extract it into

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/ for directory name 15.5 (your iOS version).

and restart the xocode

enter image description here

Javeed Ishaq
  • 6,024
  • 6
  • 41
  • 60
10

I installed iOS 16.0 beta and faced this message on Xcode.

This operation can fail if the version of the OS on the device is incompatible with the installed version of Xcode.

In my case, I enabled developer mode on the device, and it worked.

You can follow this path for activating developer mode on your iOS device.

Settings > Privacy & Security > Developer Mode

Artem Novichkov
  • 2,356
  • 2
  • 24
  • 34
Varol Aksoy
  • 131
  • 2
  • 3
5

For all of you having problem with iOS 15.7 on device. Apple is aware of it.

https://developer.apple.com/documentation/xcode-release-notes/xcode-14-release-notes

Xcode 14 cannot be used with iOS 15.7 for development. (99847608)

There is workaround for it

Workaround: Use Xcode 13.4.1 with iOS 15.7.

Hondus
  • 292
  • 1
  • 4
  • 16
3

I'm using Xcode 13.2.1 and iOS 15.4 on my iPhone 8

That's the problem. Your Xcode is incompatible with your iPhone system. Update to Xcode 13.3.

My Xcode, Mac, and iPhone 8 all have the most recent updates

No, they don't.

matt
  • 515,959
  • 87
  • 875
  • 1,141
2

Dowloading latest xcode beta version was the only solution for me:

https://developer.apple.com/download/all/

RicardoVallejo
  • 793
  • 7
  • 11
2

I had the same issue when upgraded my phone to ios 16.4. When I opened Window -> Devices and Simulators this message was displayed. As others have mentioned upgrading xcode made it work again:

Failed to prepare the device for development.
This operation can fail if the version of the OS on the device is incompatible with the installed version of Xcode. You may also need to restart your Mac and device in order to correctly detect compatibility.

The App Store app did not show any updates, I had to search for xcode to see an update-button, no automagic in this case.

kometen
  • 6,536
  • 6
  • 41
  • 51
1

My iPhone was 15.5, and I checked /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport, there is no such 15.5, then I noticed update notification for Xcode in AppStore, which is said Version 13.4.1 - Xcode 13.4.1 includes SDKs for iOS 15.5, ..., then I just need to execute Xcode update

http8086
  • 1,306
  • 16
  • 37
1

I actually downloaded the 15.5 version and renamed it as 15.6, I have also done this before when I was using the iOS 11.*** version, it worked in few of the cases.

Raj Kiran
  • 152
  • 1
  • 9
1

Apple has addressed this issue. See the following thread with a link to the Xcode 14.0.1 Release Candidate. Open the .xip file and then the run Xcode.app within. I was able to build my app on a device with iOS 15.7. I believe you have to be a paid Apple Developer to open the link.

https://developer.apple.com/forums/thread/714388

1

Previous fix (non-working)

The workaround from @Simeon is not working any more for iOS versions above 16.0

I would like Apple to do its job and create a stable fix. Apparently, they are entitled to make more money, not great pieces of software anymore.

Current fix

In order to fix this, the easiest (but clearly not the fastest nor the most efficient) is to delete and reinstall Xcode or its beta.

Assumptions

The issue essentially comes from the fact that one folder is missing in order to run later versions of iOS, and Xcode is not fetching them for i-don't-know what reasons.

All pieces of software and OS are up-to-date As you can see in the screenshot above, all pieces of software and OS are up-to-date.

The folder for iOS 16.4 is missing.

Nevertheless, the folder for iOS 16.4 is still missing.

SHANNAX
  • 322
  • 3
  • 5
0

I had the same problem so i had to update xcode to the latest version

Issue

xcode version was 14.0.1 - which supported iOS 16.0 (20A360), but my iphone is having 16.3.1 version.

Solution

Updated Xcode with 14.3

Quick learner
  • 10,632
  • 4
  • 45
  • 55