---
title: "How do you fix \"Failed to prepare device for development\" in Xcode?"
description: "Xcode cannot prepare your iPhone for debugging. Update Xcode, enable Developer Mode, unlock and trust the device, then re-pair it in the Devices window."
url: "https://bugsee.com/answers/swift/failed-to-prepare-device-for-development/"
---

# How do you fix "Failed to prepare device for development" in Xcode?

Usually Xcode is too old for the device's iOS version, or the device is locked, untrusted or has Developer Mode off. Update Xcode, unlock the device, and re-pair it.

Xcode has to copy support files for the device's iOS version and start a debug connection. The step fails when any part of that handshake is missing.

- Version mismatch: a device on a newer iOS than your Xcode supports needs a newer Xcode (or its matching beta). Check Xcode > Settings > Components.
- Developer Mode: on iOS 16 and later, turn on Settings > Privacy & Security > Developer Mode and restart the device.
- Trust and lock state: unlock the device, tap Trust when asked, and keep the screen on during the first connection.
- Pairing: open Window > Devices and Simulators, remove the device, reconnect it and let Xcode pair again.
- Connection: try another cable or port, or connect by cable first before using wireless debugging.
- Last resort: restart the device, quit Xcode and delete the device's folder in ~/Library/Developer/Xcode/iOS DeviceSupport so Xcode rebuilds it.

Free disk space matters too, because the device support files for a new iOS version are large.

## Related questions

- [How do you symbolicate an iOS crash log?](https://bugsee.com/answers/swift/symbolicate-an-ios-crash-log/)
