# Xcode: Failed to prepare device for development / iPhone is not available. Please reconnect the device

**Code:** `Failed to prepare device for development` · **Category:** iOS · **Seen on:** iOS

Xcode couldn’t set up the device — usually the device’s iOS version is newer than Xcode supports, Developer Mode is off, or pairing/trust is broken.

## Meaning

Each Xcode version supports iOS up to a certain release (needs device support files). iOS 16+ also requires Developer Mode enabled on the device.

## Common causes

- Device iOS newer than this Xcode supports
- Developer Mode not enabled (iOS 16+)
- Device not trusted/paired
- Locked device or cable issues

## Quick fix

1. Update Xcode
2. Enable Settings → Privacy & Security → Developer Mode and restart
3. Unpair/re-pair (Devices and Simulators), trust the computer

## Detailed fix by platform

### Shell

1. 

```swift
xcrun devicectl list devices
xcrun xctrace list devices
```


## How to diagnose

1. **Versions** — Xcode vs iOS version
2. **Developer Mode** — On?
3. **Pairing** — Trusted?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/ios/failed-to-prepare-device-for-development)
