Paul Calnan
Published March 24, 2014

This seems to happen whenever someone on the team updates the provisioning profile and commits the change to the .xcodeproj file. The build fails and Xcode complains that it can't find a provisioning profile identified by a UUID.

To fix it, I have to stop what I'm doing, open Preferences, click the right Apple ID (I have one for each client), click the team, click View Details, click the refresh button, and then close out the action sheet and the Preferences dialog. Not the end of the world, but it gets old after a while.

To get around this issue, I wrote an AppleScript to automate the process. It's a bit fragile, as it's using Accessibility and System Events to poke around in the Preferences dialog. It probably will break in a later version of Xcode (it works in Xcode 5.1).

To use the script save it to your computer and set the appleID variable to your Apple ID. I use FastScripts to bind the script to ⌥R while in Xcode.

The script: