Xcode will not run your app on a connected iPhone or iPad
Failed to prepare device for developmentShort 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.
Fix it fast
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 -version2Match what you see, then jump to its fix
- 1
The 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
No 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
The 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
- 1
What does the error look like?
Failed to prepare device for developmentTrust 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 devices2Fix
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, confirm3Verify
Run the app from Xcode again; the device is accepted as a run destination.
xcrun devicectl list devicesConfirmed by developer.apple.com
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 devices2Fix
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 again3Verify
The device shows under Available in the Device Hub sidebar and in the run destination menu.
xcrun devicectl list devicesConfirmed by developer.apple.com
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 -checkForNewerComponents3Verify
Reconnect the device and run the app again.
xcrun devicectl list devicesConfirmed by developer.apple.com
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
Cannot change the App Privacy answers in App Store Connect
Publish Your App Privacy Responses?
Only the Account Holder, Admin and App Manager roles can answer the App Privacy questions.
2 causes, each with a fixMobile 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 fixMobile apps
You cannot find the button to pull your app back from review
No 'remove this version from review' message appears on the version page
There is no button called Reject Binary.
3 causes, each with a fixMobile apps
Your Apple Account cannot sign in to App Store Connect
Sign-in to App Store Connect is refused for an account that should have access
App Store Connect does not open to every Apple Account.
3 causes, each with a fixMobile apps
Apple rejected the app under Guideline 4.3, Design: Spam
Guideline 4.3(b) - Design - Spam
Guideline 4.3 is Apple's duplicate rule.
5 causes, each with a fixMobile apps
App Store Connect rejects a screenshot because it has transparency
Images can't include alpha channels or transparencies.
App Store Connect does not accept screenshots that carry an alpha channel or transparent pixels.
2 causes, each with a fix