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.
- Open the project in Xcode.
- Select the project file in the navigator to show the project editor.
- Choose the app target from the target list.
- Click the General tab.
- In the Signing section, locate the Team dropdown and select the client’s team (or “None” then re-select their team).
- Now select the test target (usually named
YourAppTestsorYourAppUITests). - Click its General tab.
- In the Signing section, set the Team dropdown to the same client team.
- Press Shift+Cmd+K to clean the build folder.
- 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.
- With the app target selected, open the Build Settings tab.
- Search for
DEVELOPMENT_TEAM. - If a value appears (a 10-character team ID), double-click it and delete the value so it shows “$(inherited)” or leave it blank.
- Repeat for the test target.
- 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.
- In the app target’s Signing & Capabilities tab, ensure Automatically manage signing is checked.
- If a warning appears about missing profiles, click the Fix button or toggle the checkbox off and on.
- Repeat for the test target.
- 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.
- Close Xcode.
- Open Terminal and run:
bash
rm -rf ~/Library/Developer/Xcode/DerivedData - 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.
- 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 excludexcuserdataandDerivedDatavia.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.
Parts of this guide are adapted from content licensed under CC BY-SA 3.0; this article is shared under the same license.
