It happens to all of us: your Apple Developer Membership is up, you renew it for $99 per year and you think you can get back to work. But no. The friendly folks over there made sure that nothing lasts forever – including your Provisioning Profiles.
The above error is easy to fix and only involves 57 steps per app. The abridged version:
- head over to the Apple Member Center
- find the Provisioning Profiles section
- click the ones saying “invalid” or “expired”
- edit and regenerate them
- back in Xcode, refresh your profiles
The principle has been the same for a while, but every year the position of those items changes a bit. Here are some screenshots for the few seconds that remain in July 2014. It’ll probably be all outdated as soon as I hit publish. But until then, here goes:
Head over to http://developer.apple.com and hit Member Center at the top right. Find something like Certificates, Identifiers and Profiles:
It’s a link that takes you to a section similar to this:
Select Provisioning Profiles (under iOS or Mac Apps, depending on your app) and you’ll see a long list of all profiles you’ve ever created. Pay attention to anything that’s not green in the left hand column, indicating expired or invalid profiles:
Find the profile in question and hit Edit. For Development Provisioning Profiles, you’ll find that your Development Certificate is no longer selected. Simply select it, add (or remove) any devices for this profile, then click Generate at the bottom. The next screen will offer you to download said profile – but since we’re using Xcode 5 or 6 we can ignore this step.
Distribution Profiles behave much the same: your Distribution Profile is deselected. Simply select it and hit generate. Again ignore the generous download offer and select Done instead.
All those little red and yellow symbols should look green and calm like this:
I know what you’re thinking: “Hey, I’ve got 30+ profiles sitting there – isn’t there a way to renew all of them in one fair swoop?” – Of course there isn’t, don’t be ridiculous!
Back in Xcode
Now that the profiles are fixed, let’s tell Xcode about them. Head over to
Xcode – Preferences – Accounts – select the account in question – select View Details.
On the bottom left corner of that window you’ll see something like a refresh icon. Click that and Xcode will communicate with the Member Center and pull in those new profiles.
When Xcode has finished, hit “done” to close that window and head over to your target, select Build Settings and find the Code Signing section (you can search for it if that list is a little long and confusing for your taste).
Reselect your provisioning profile and – in theory – Xcode should now deploy your app correctly.
Notice that I said “in theory” – because sometimes this doesn’t work. In which case, you can try the following options:
- Build – Clean
- restart Xcode
- close your project, then restart Xcode
- remove the app from your device, restart Xcode and re-deploy
- find a different hobby because profiles take all the fun out of developing with Xcode
Idea for a bumper sticker: Honk if you hate Provisioning Profiles!