Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Xcode will not run your app on a connected iPhone or iPad

ErrorFailed to prepare device for development

Short answer

Xcode could not set the device up as a run target. It is nearly always one of three things: Developer Mode is off on the iPhone, the pairing or trust was lost (for example after an OS update), or your Xcode does not yet support the device's OS. Check what Xcode sees, then fix the one that fits.

  • Applies to Xcode 26, iOS 26, macOS 26
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    List the devices Xcode's own tooling can see, with their state, and check which Xcode is active. This shows whether the device is paired and whether Xcode is current.

    xcrun devicectl list devices
    xcodebuild -version
  2. 2Match what you see, then jump to its fix

    1. 1The device appears in Xcode but cannot be used as a run destination, and Developer Mode is missing or off in SettingsDeveloper Mode is turned off on the deviceFix
    2. 2No Trust This Computer prompt appears, or the device was fine until iOS was upgradedThe pairing or trust is missing, or the OS was updated since pairingFix
    3. 3The device runs a newer iOS than the installed Xcode, or a new device model that Xcode does not recogniseYour Xcode has no support for the device's OS yetFix

What does the error look like?

  • Failed to prepare device for development
  • Trust This Computer

Cause 1 of 3

Developer Mode is turned off on the device

1Check

On the device open Settings > Privacy & Security and look for the Developer Mode switch under Security. It only appears after you start pairing or after a previous pairing.

xcrun devicectl list devices

2Fix

Turn the Developer Mode switch on, tap Restart in the alert, and after the restart confirm the second alert (swipe up, tap Enable, enter the passcode). Then reconnect and run again.

# on the device: Settings > Privacy & Security > Developer Mode > on, restart, confirm

3Verify

Run the app from Xcode again; the device is accepted as a run destination.

xcrun devicectl list devices

Confirmed by developer.apple.com

Did this fix it?

Cause 2 of 3

The pairing or trust is missing, or the OS was updated since pairing

1Check

Open Device Hub (Xcode > Open Developer Tool > Device Hub) and select the device. Problems are shown in the canvas. Apple states that after an OS upgrade you need to pair the device again.

xcrun devicectl list devices

2Fix

Connect the device with a cable, unlock it and tap Trust when asked. In Device Hub select the device and click Pair if the button is there. If you dismissed the trust dialog, restart the device. After an OS upgrade, unpair (Control-click the device, Unpair) and pair again.

# Device Hub: select the device > Pair, or Control-click > Unpair then pair again

3Verify

The device shows under Available in the Device Hub sidebar and in the run destination menu.

xcrun devicectl list devices

Confirmed by developer.apple.com

Did this fix it?

Cause 3 of 3

Your Xcode has no support for the device's OS yet

1Check

Compare the OS on the device with what the installed Xcode ships. Apple delivers hardware support updates between Xcode releases, and platform support must be installed for the target platform.

xcodebuild -checkFirstLaunchStatus; echo $?

2Fix

Update Xcode, or install the newer components for the Xcode you have selected. If the run destination shows a Get button, click it to install platform support.

xcodebuild -runFirstLaunch -checkForNewerComponents

3Verify

Reconnect the device and run the app again.

xcrun devicectl list devices

Confirmed by developer.apple.com

Did this fix it?

How do I stop it coming back?

  • After every iOS update, open Device Hub and check the device before the next run; re-pair if it asks.
  • Check that Developer Mode is still on after the update, since it only shows in Settings when the device is paired.
  • Keep Xcode on the release that matches the iOS version your test devices run.
  • Use the command line check above in CI machines that run on real devices.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Related fixes

Mobile apps

App record creation fails because you lack permission

You cannot add a new app in App Store Connect as a Developer or limited user

Only the Account Holder, an Admin or an App Manager can create an app record, and Apple blocks it until the Account Holder has signed the latest agreement.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.