Fix: Unable to Build Chain to Self-Signed Root for Signer in Xcode

Written by

in

Quick answer: This warning appears when Xcode cannot verify your signing certificate’s trust chain because the required Apple Worldwide Developer Relations intermediate certificates are missing from your system keychain. Download and install the current intermediate certificates from Apple’s developer portal, then restart Xcode to restore automatic provisioning.

Why this happens

Xcode validates your signing identity by walking the certificate chain from your developer certificate up to a trusted root certificate in the system keychain. The chain typically includes an intermediate certificate issued by Apple’s Worldwide Developer Relations Certificate Authority. When that intermediate certificate is absent — common after migrating a project to a new Mac, after a clean macOS install, or when the system keychain was reset — Xcode cannot establish trust and emits the warning:

Warning: unable to build chain to self-signed root for signer

The app may then crash on launch because the code signature fails validation. The root cause is not your developer certificate itself, but the missing intermediate that links it to Apple’s root CA.

How to fix it

1. Install the missing intermediate certificates (most reliable fix)

Apple publishes the current Worldwide Developer Relations intermediate certificates on the developer website. Adding them to the System keychain restores the full trust chain.

  1. Open a browser and go to the Certificates, Identifiers & Profiles section of the Apple Developer portal.
  2. Start creating a new certificate (any type). On the Create a New Certificate step, Apple lists the required intermediate certificates with download links. As of this writing the links are:
    – Worldwide Developer Relations Certificate Authority (Expiring 02/07/2023)
    – Worldwide Developer Relations Certificate Authority (Expiring 02/20/2030)
    – Worldwide Developer Relations – G4 (Expiring 12/10/2030)
    – Developer ID – G2 (Expiring 09/17/2031)
  3. Download each .cer file.
  4. Double‑click each file; macOS will prompt to add it to the System keychain. Choose System (not Login) and authenticate.
  5. Open Keychain Access, select System → Certificates, and verify the four certificates appear with a green check mark and the text “This certificate is valid.”
  6. Quit and relaunch Xcode. The automatic provisioning flow should now succeed without the warning.

Tip: If you cannot reach the certificate creation page, you can also download the same intermediates from Apple’s PKI repository at https://www.apple.com/certificateauthority/.

2. Verify the correct root CA is trusted in Keychain Access

If the intermediates are present but the warning persists, the signer’s root CA may be marked as untrusted.

  1. Open Keychain Access (Applications → Utilities).
  2. Select System keychain, then Certificates category.
  3. Locate the certificate named Apple Root CA – G3 (or the current root used by Apple).
  4. Double‑click it, expand Trust, and set When using this certificate to Use System Defaults.
  5. Repeat for any Worldwide Developer Relations certificates that show a red “X” or “Not Trusted” status.
  6. Restart Xcode.

3. Clean derived data and rebuild

Stale build artifacts can cache the broken trust state.

  1. In Xcode, choose Product → Clean Build Folder (⇧⌘K).
  2. Delete the project’s DerivedData folder: ~/Library/Developer/Xcode/DerivedData/<ProjectName>-<hash>/.
  3. Rebuild and run on device.

How to prevent it

  • Keep the System keychain synchronized across machines: export/import the Apple Root CA and Worldwide Developer Relations certificates when setting up a new Mac.
  • Avoid deleting certificates from the System keychain unless you immediately replace them.
  • Use Xcode’s Accounts preference pane (Xcode → Settings → Accounts) to manage signing certificates; Xcode will automatically fetch missing intermediates when you download a profile.
  • After macOS upgrades, open Keychain Access once and confirm the intermediate certificates are still present and trusted.

FAQ

Why does the simulator work but the device crashes?

The simulator uses your Mac’s code signing environment directly, which may tolerate a partial chain. A physical device validates the signature against Apple’s roots at install time; a missing intermediate breaks that validation, causing dyld to abort the launch.

Can I fix this without the Apple Developer portal?

Yes. The intermediate certificates are public. Download them from Apple’s PKI page (https://www.apple.com/certificateauthority/) and install them into the System keychain manually.

Do I need to revoke and recreate my developer certificate?

No. The developer certificate is still valid. The issue is solely the missing intermediate certificates that connect your certificate to Apple’s trusted root. Installing the intermediates restores the chain without touching your identity.

Sources & credits

Parts of this guide are adapted from content licensed under CC BY-SA 3.0; this article is shared under the same license.