Why this happens
Xcode attempts to code-sign the app for the selected run destination. When the destination is a physical iPhone or iPad, Xcode looks for a code-signing identity named “iPhone Developer” (the legacy name for a development certificate) in your login keychain. If you haven’t enrolled in the Apple Developer Program, or if Xcode hasn’t downloaded and installed a certificate for your team, the identity is missing and the build fails with:
codesign error: code signing identity 'iphone developer' does not match any code-signing certificate in your keychain. once added to the keychain, touch a file or clean the project to continue.
Modern Xcode versions (13+) use “Apple Development” and “Apple Distribution” identities, but older projects or legacy build settings may still reference the old “iPhone Developer” name. The error can also appear after a macOS upgrade that clears the keychain, or when opening a project on a new Mac without syncing certificates.
How to fix it
1. Switch to a Simulator (immediate workaround)
If you only need to run the app in the Simulator, change the run destination:
- Click the scheme selector in the Xcode toolbar (shows the current device name).
- Choose any Simulator entry (e.g., “iPhone 16 Pro”) instead of a physical device.
- Build and run again.
The Simulator does not require a code-signing certificate, so the build succeeds immediately.
2. Enable automatic signing for device testing
To run on a real device you need a valid development certificate:
- Open the Project navigator and select the project root.
- Choose your app target, then open the Signing & Capabilities tab.
- Check Automatically manage signing.
- Select your Team from the dropdown (add your Apple ID in Xcode → Settings → Accounts if missing).
- Xcode will request and download a development certificate, then store it in your keychain.
- Connect your iPhone, select it as the run destination, and build.
If Xcode reports “No profiles for ‘com.your.bundle.id’ were found”, click Register Device or Create Profile in the same pane.
3. Clean up stale identities (if certificates exist but error persists)
Sometimes old or revoked certificates linger in the keychain:
- Open Keychain Access (Applications → Utilities).
- Select the login keychain and My Certificates category.
- Delete any certificates labeled “iPhone Developer” or “Apple Development” that are expired, revoked, or duplicated.
- In Xcode, go to Settings → Accounts, select your Apple ID, click Manage Certificates, and use the + button to download fresh certificates.
- Clean the build folder (Product → Clean Build Folder) and rebuild.
How to prevent it
- Keep Automatically manage signing enabled for all debug builds.
- Use a single Apple ID / team across all your Macs and let Xcode sync certificates via the Accounts preference pane.
- Avoid manually importing
.ceror.p12files unless you fully understand the certificate chain. - After macOS upgrades, open Xcode → Settings → Accounts and verify certificates are still present; re-download if needed.
- Store your Developer Program credentials in a password manager so team membership can be restored quickly on new machines.
FAQ
Why does the error say “iPhone Developer” instead of “Apple Development”?
The project or its build settings (CODE_SIGN_IDENTITY) still reference the legacy identity name used before Xcode 11. Updating the setting to “Apple Development” or enabling automatic signing resolves the mismatch.
Can I test on a device without paying $99/year?
Yes. Since Xcode 7, a free Apple ID allows “Personal Team” provisioning for up to three devices. Enable automatic signing, select your free Apple ID as the team, and connect your device. The certificate expires after 7 days and must be refreshed by rebuilding.
The Simulator works but device build still fails after automatic signing. What next?
Check the Signing & Capabilities tab for a red error message. Common causes: bundle identifier already registered to another team, device not registered in the provisioning profile, or network issues preventing Xcode from contacting Apple’s servers. Click the “Fix Issue” button or the warning triangle for specific guidance.
Parts of this guide are adapted from content licensed under CC BY-SA 3.0; this article is shared under the same license.
