When you connect a physical iPhone or iPad to Xcode, you may see “Failed to prepare device for development” and be unable to run your app. The message means Xcode could not complete the setup required to use that device for development. Common causes include an unsupported Xcode/iOS combination, an unstable connection, Developer Mode, stale pairing information, or damaged DeviceSupport data.
- Common causes
- Typical situations
- What to check first
- Fix 1: Use an Xcode version that supports the device OS
- Fix 2: Reconnect over USB with the device unlocked
- Fix 3: Restart Xcode, the device, and the Mac
- Fix 4: Rebuild Xcode DeviceSupport data
- Fix 5: Check trust and pairing
- Fix 6: Check signing and device registration
- Important notes
- Summary
Common causes
The most common causes are an Xcode version that does not properly support the iOS version on the device, an unreliable USB or wireless connection, a locked device, a trust or pairing problem between the Mac and iPhone, or corrupted device-support files on the Mac.
If the error appeared immediately after updating iOS, check your Xcode version first. A newer iOS release may require a newer Xcode release for reliable on-device debugging.
Typical situations
- The iPhone or iPad was recently updated to a newer iOS version.
- Xcode has not been updated for some time.
- The device is being connected to this Mac for the first time.
- Wireless debugging is unstable.
- Xcode starts preparing the device while it is locked.
- Old DeviceSupport or pairing data is still present.
What to check first
- Check the iOS or iPadOS version installed on the device.
- Check your Xcode version and make sure it supports that OS release.
- Open Window → Devices and Simulators in Xcode and inspect the device status.
- Unlock the device and respond to any “Trust This Computer” prompt.
- On iOS 16 and later, verify Developer Mode when required under Settings → Privacy & Security → Developer Mode.
Fix 1: Use an Xcode version that supports the device OS
Start by updating Xcode to a version that supports the iOS release installed on the device. If the iPhone was updated first while Xcode remained old, device preparation can fail. After updating Xcode, restart both the Mac and the device and try again.
Fix 2: Reconnect over USB with the device unlocked
If you are using wireless debugging, connect the device directly with a USB cable. Keep the device unlocked, open Devices and Simulators, and allow Xcode to finish preparing it. Apple has documented device-preparation problems with wireless connections in past Xcode release notes and recommended keeping the device unlocked and using USB when possible.
Fix 3: Restart Xcode, the device, and the Mac
Quit Xcode completely, restart the iPhone or iPad, and reconnect it. If the problem remains, restart the Mac as well. Temporary failures in the device services or pairing process can often be cleared this way.
Fix 4: Rebuild Xcode DeviceSupport data
If local device-support data is damaged, quit Xcode and remove or move the following directory so Xcode can recreate it:
~/Library/Developer/Xcode/iOS DeviceSupport
From Terminal, you can remove it with the following command after confirming you do not need the existing data:
rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport
Then launch Xcode, open Window → Devices and Simulators, connect the device by USB, and wait for Xcode to finish copying or rebuilding the required support data.
Fix 5: Check trust and pairing
Disconnect and reconnect the USB cable. If the device asks whether to trust the computer, choose Trust and enter the device passcode. If the connection still behaves inconsistently, try another USB port or a reliable Apple-certified cable.
Fix 6: Check signing and device registration
In Signing & Capabilities, make sure the correct development Team is selected. If you use automatic signing, verify that Automatically manage signing is enabled. Development devices must be registered for development profiles, and Apple notes that Xcode can register or enable connected devices automatically when automatic signing is used.
Important notes
Avoid relying first on unofficial copies of DeviceSupport files from unrelated Xcode versions. They may not work correctly with your Xcode and iOS combination. Updating to an officially supported Xcode release is the safer first step.
After deleting DeviceSupport data, the first device connection can take longer because Xcode may need to rebuild support information. Keep the device unlocked and connected until preparation finishes.
Summary
For “Failed to prepare device for development,” first verify that Xcode supports the iOS version on the device, then reconnect the unlocked device over USB. If the issue continues, restart Xcode, the device, and the Mac, inspect Devices and Simulators, rebuild DeviceSupport data, and check trust, signing, and device registration. Working through those checks in order usually isolates the cause quickly.
