Fix: Code Signing “No account for team” Error When Switching Developer Accounts in Xcode

Fix: Code Signing "No account for team" Error When Switching Developer Accounts in Xcode

Written by

in

Quick answer: The “No account for team” error occurs when Xcode still references the old team ID in build settings. Fix it by updating the Team setting in both the target’s General tab and the test target’s General tab, then clean the build folder (Shift+Cmd+K) and rebuild.

Why this happens

When you develop an app using your own Apple Developer account and later hand it off to a client with their own account, Xcode retains references to your original team ID in multiple places. The error Code Signing Error: No account for team "59xxxxxxxx" appears because the project’s build settings still point to your team ID even after the client selects their team in the Signing & Capabilities pane.

Xcode stores the team identifier in both the target’s General settings and the test target’s General settings. Simply changing the team in the main target’s Signing & Capabilities section doesn’t update the test target, and the build system continues looking for certificates and provisioning profiles associated with the old team ID. Since the client’s Xcode account doesn’t have access to your team’s certificates, the build fails.

This commonly happens in Xcode 9 through current versions when projects have both an app target and a test target, each maintaining independent team settings.

How to fix it

1. Update the team in both the app target and test target General settings

This is the most direct fix and resolves the majority of cases.

  1. Open the project in Xcode.
  2. Select the project file in the navigator to show the project editor.
  3. Choose the app target from the target list.
  4. Click the General tab.
  5. In the Signing section, locate the Team dropdown and select the client’s team (or “None” then re-select their team).
  6. Now select the test target (usually named YourAppTests or YourAppUITests).
  7. Click its General tab.
  8. In the Signing section, set the Team dropdown to the same client team.
  9. Press Shift+Cmd+K to clean the build folder.
  10. Build and run (Cmd+R).

Note: If the test target doesn’t show a Signing section, it may be inheriting settings. Still verify the Team dropdown matches.

2. Verify and clear stale build settings in Build Settings

If the error persists, the team ID may be hardcoded in the target’s Build Settings.

  1. With the app target selected, open the Build Settings tab.
  2. Search for DEVELOPMENT_TEAM.
  3. If a value appears (a 10-character team ID), double-click it and delete the value so it shows “$(inherited)” or leave it blank.
  4. Repeat for the test target.
  5. Clean build folder (Shift+Cmd+K) and rebuild.

This ensures no residual team ID overrides the General tab selection.

3. Regenerate provisioning profiles automatically

After updating the team, Xcode should fetch the correct profiles.

  1. In the app target’s Signing & Capabilities tab, ensure Automatically manage signing is checked.
  2. If a warning appears about missing profiles, click the Fix button or toggle the checkbox off and on.
  3. Repeat for the test target.
  4. Xcode will download or create development provisioning profiles tied to the new team ID.

4. Remove derived data and cached credentials (last resort)

If the above steps don’t work, stale derived data or keychain entries may interfere.

  1. Close Xcode.
  2. Open Terminal and run:
    bash
    rm -rf ~/Library/Developer/Xcode/DerivedData
  3. Open Keychain Access, search for the old team ID or certificates, and delete any expired or duplicate “iOS Development” / “iOS Distribution” certificates for that team.
  4. Reopen Xcode, reapply the team selection in both targets, and build.

How to prevent it

  • Set the correct team before adding test targets. When creating a new project, choose the final team in the project creation dialog so both app and test targets inherit it.
  • Use Xcode’s “Automatically manage signing” for both targets from the start; avoid manual profile selection unless required.
  • Share the project with a clean state. Before handing off, clean the build folder, commit only source files and project.pbxproj, and exclude xcuserdata and DerivedData via .gitignore.
  • Document the handoff steps. Include a README note: “After cloning, select your team in both the app target and test target General tabs.”

FAQ

Why does the error show my old team ID instead of the new one?

The error message displays the team ID that Xcode is currently trying to use for code signing. Because the test target (or a build setting) still references your original team ID, the build system looks for your certificates on the client’s machine, fails to find them, and reports the missing team by its identifier.

Do I need to revoke my certificates from the client’s machine?

No. The client should never have your private keys. The fix is purely configuration: point both targets at the client’s team so Xcode requests profiles from their account. Your certificates remain in your keychain and on Apple’s servers, unaffected.

Can I avoid this by using a shared team instead of separate accounts?

Yes. If the client adds you as a member of their Apple Developer Program team (App Manager or Developer role), you can both use the same team ID. Then the project’s team setting never needs to change. However, many clients prefer to own the account entirely, making the dual-target team update necessary at handoff.

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.