'Failed to prepare device for development. XCode 13.2.1, iOS 15.1
After upgrading the mac OS and XCode to 13.2.1 and iPhone to 15.1, the device stopped connecting to the mac. It kept showing the error as
Failed to prepare device for development.
Solution 1:[1]
This answer helped me where you:
- Open XCode and device manager
- Connect the device
- Shutdown the device while being connected
- Power on the device
- Wait till the device is processed by XCode in devices and simulator window
Solution 2:[2]
Re: Xcode 13.2.1 and iOS 15.4
You may need to update to the latest version of Xcode. If you just updated your phone OS, then Xcode may not support the latest OS. You can find Xcode 13.3.1 (or higher) on the App Store. You'll need to update to Monterey as well though.
Solution 3:[3]
Following solution work for me
- First check compatibility version for xcode with iOS version from following https://developer.apple.com/support/xcode/
- Now check the list of devices support to your Xcode from 'Device Support'
- 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
- 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
- From above Github page, select device version & download zip file
- Now extract file & you will get the folder for your iOS version
- 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
- 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
- Now connect your iPhone device with macbook (through cable), xcode will detect your device & you can run your application
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Kaushil Ruparelia |
Solution 2 | |
Solution 3 | Khirish |