~/Library/Developer/Xcode/UserData/Provisioning Profiles. For Xcode 15 and earlier, delete them from ~/Library/MobileDevice/Provisioning Profiles/. Quit Xcode first, run rm -rf ~/Library/Developer/Xcode/UserData/Provisioning\ Profiles/* in Terminal, and then rebuild your project.Why this happens
When you build, archive, or sign an app, Xcode evaluates local provisioning profiles stored on your Mac. Whenever you manually install a profile by double-clicking it, or when Xcode downloads profiles through your developer account, it writes .mobileprovision files into a local cache directory.
Over time, this directory accumulates stale, revoked, and expired profiles. When you update your app’s capabilities, add new test devices, or renew developer certificates, Xcode may continue resolving the old profile that matches your bundle identifier instead of generating or fetching a new one. This leads to build failures such as Provisioning profile doesn't include signing certificate or Provisioning profile does not support the selected capabilities.
Historically, older versions of Xcode provided an interface to view and delete profiles under Preferences > Accounts > View Details. Apple removed that management UI. Additionally, Xcode 16 relocated the provisioning profiles directory, meaning older file paths from previous documentation will not clear cached profiles on modern versions.
How to fix it
1. Delete cached profiles using Terminal
The fastest and most thorough way to clear all local profiles is via Terminal. Always quit Xcode before clearing these directories to prevent Xcode from locking files or rewriting cached metadata.
First, close Xcode completely (Cmd + Q).
For Xcode 16 and later, run this command in Terminal:
rm -rf ~/Library/Developer/Xcode/UserData/Provisioning\ Profiles/*
For Xcode 15 and earlier, run:
rm -rf ~/Library/MobileDevice/Provisioning\ Profiles/*
If you maintain multiple Xcode versions or want to purge both locations in one step, run:
rm -rf ~/Library/Developer/Xcode/UserData/Provisioning\ Profiles/* ~/Library/MobileDevice/Provisioning\ Profiles/*
Deleting these files does not harm your Apple Developer account. Xcode will automatically generate or download fresh profiles the next time you build or sign your app.
2. Inspect and delete specific profiles in Finder
If you are using manual signing and only want to delete a single expired or conflicting profile without losing your other project configurations, you can inspect the files in Finder.
- Quit Xcode.
- Open Finder.
- Press
Cmd + Shift + Gto open the Go to Folder dialog. - Paste the path corresponding to your Xcode version:
– Xcode 16+:~/Library/Developer/Xcode/UserData/Provisioning Profiles
– Xcode 15 and older:~/Library/MobileDevice/Provisioning Profiles - Press Return.
Because profiles have UUID filenames (such as a1b2c3d4-e5f6-7890-abcd-1234567890ef.mobileprovision), finding the right one by name alone is difficult. To inspect a profile’s contents, open Terminal and decode it with security:
security cms -D -i ~/Library/Developer/Xcode/UserData/Provisioning\ Profiles/YOUR_PROFILE_UUID.mobileprovision
Look for the <key>Name</key> and <key>ExpirationDate</key> tags in the XML output. Once you identify the offending profile, move that specific file to the Trash.
3. Force Xcode to regenerate fresh profiles
After clearing the directory, re-open your project in Xcode and prompt it to re-download or recreate valid profiles:
- Select your project in the Project Navigator and click your app target.
- Navigate to the Signing & Capabilities tab.
- If you use Automatically manage signing, uncheck the box and recheck it. This forces Xcode to contact Apple Developer servers and install a newly generated profile.
- If you use manual provisioning, go to Xcode > Settings > Accounts, select your Apple ID and team, click Download Manual Profiles, then re-select the updated profile under the Provisioning Profile dropdown.
Finally, clean your build folder by pressing Cmd + Shift + K before building again.
How to prevent it
- Stick to Automatically manage signing for standard development and testing targets whenever possible.
- Avoid manually dragging or double-clicking
.mobileprovisionfiles into Xcode unless required for Ad Hoc or Enterprise distribution. - When renewing certificates or modifying app entitlements on the developer portal, clear the provisioning profile folder immediately to stop Xcode from defaulting to the old profile.
- Never back up or sync the local
Provisioning Profilesdirectory across machines with tools like iCloud Drive or Time Machine migrations, as this reintroduces expired signing certificates.
FAQ
Will deleting local provisioning profiles delete them from my Apple Developer account?
No. Removing local .mobileprovision files only deletes local copies on your Mac. All profiles and identifiers configured in the Apple Developer portal remain untouched.
Where are provisioning profiles stored in Xcode 16 and later?
In Xcode 16, Apple moved local profiles to ~/Library/Developer/Xcode/UserData/Provisioning Profiles. Older versions stored them in ~/Library/MobileDevice/Provisioning Profiles.
Why does Xcode immediately re-create a profile after I delete it?
If Automatically manage signing is enabled in your target, Xcode contacts the Apple Developer portal and creates a new profile the moment you open the project or trigger a build. This is normal behavior and ensures your build has an up-to-date profile.
Parts of this guide are adapted from content licensed under CC BY-SA 3.0; this article is shared under the same license.
