This would very much depend on how you have your project's build configuration setup, if you are inheriting build configurations from other .xcconfig files, and any automation you may have in place that dynamically rewrites your project's .pbxproj file. That said, Xcode also can get itself confused while it attempts to straighten up the .pbxproj and could have left something lingering.
- Quit Xcode.
- Navigate to your source files, and look for your
.xcodeproj
(not the .xcworkspace
but the actual Xcode Project file itself).
- Right click on it and select 'Show Package Contents'.
- In your text-editor of choice (I use BBEdit or the free version TextWrangler), open
project.pbxproj
- Search the entire
pbxproj
file for PROVISIONING_PROFILE
I suspect that you'll have an entry in one or more XCBuildConfiguration
blocks that resemble this:
/* Begin XCBuildConfiguration section */
7D433CD8275123D91263DAA4 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = "";
CODE_SIGN_IDENTITY = "iPhone Distribution: Your Name Here";
// Other settings would go in here
PROVISIONING_PROFILE = "";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = "Release";
};
One of these configuration blocks may contain multiple PROVISIONING_PROFILE
settings or you might just find the one line that exactly matches the UUID specified in your error. That would look like PROVISIONING_PROFILE = "xxxxxxxxxx";
In either case, take care to backup your .pbxproj file (it is in source control, right?) then delete the offending line(s) which will revert you back to Automatic Profile Selection, finish searching for other instances of that same offending line, save all of your changes, quit your text editor and reattempt the command-line build.
If you have intentionally set a specific UUID for the PROVISIONING_PROFILE
setting in the past, do be sure to reverify your code sign settings in Xcode as you could easily undo an intentional setting by removing all instances of PROVISIONING_PROFILE
and falling back to the Automatic mode.