Provisioning Profile variable missing in .pbxproj


As suggested in this:

I opened the project.pbxproj of my project and searched for statement like this -


Strangely there was no variable defined for provisioning profile. I ensured that the setting was automatic under the build settings in xCode. I checked few other projects as well, such a statement was missing. What is causing this? Also if I manually want to add the statement PROVISIONING_PROFILE = ""; where should I place it in the project.pbxproj file.


Look for the section that begins with XCBuildConfiguration. You will need to add it for each build config in your project:

/* Begin XCBuildConfiguration section */
    8C822CD8279123D91163DD34 /* Release */ = { 
        isa = XCBuildConfiguration;
        buildSettings = {

                CODE_SIGN_ENTITLEMENTS = "";
                CODE_SIGN_IDENTITY = "iPhone Distribution: Company Name, Inc";
                "CODE_SIGN_IDENTITY[sdk=iphoneos4.2]" = "iPhone Distribution: Company Name, Inc";
                PROVISIONING_PROFILE = "";
                "PROVISIONING_PROFILE[sdk=iphoneos4.2]" = "";
                SDKROOT = iphoneos;
                TARGETED_DEVICE_FAMILY = "1,2";
        name = "Release";
By : wottle

The absence of PROVISIONING_PROFILE is the equivalent of Automatic -- having this value set to anything but empty (the value would be a UUID) indicates you intend to use the specific provisioning profile who's UUID matches the value of PROVISIONING_PROFILE.

In most cases, you want to use the Automatic setting which would manifest as either the empty PROVISIONING_PROFILE line or not having that line present. Automatic allows you to update, download, and install newer versions of your provisioning profile without having to update your build configuration each time you add a new test device, enable a new entitlement-based service, or simply reissue the existing profile.

Provisioning profiles are stored on-disk as .mobileprovision, the default sort order is alphabetic. When using Automatic, the following rules are used to select profile to sign with -- the first profile that matches wins:

  • Profiles with an explicit AppId (com.mycompany.mydivision.myapp) precisely matching the current project's AppID
  • Profiles with a wildcard (com.mycompany.mydivision.*) AppId matching the longest component of the reverse-DNS styled project AppID
  • Profiles that are pure wildcard (*)

If you must use a specific profile, do keep in mind that each time you edit a provisioning profile on the Certificates, Identities, and Profiles tool you will download a new version of the provisioning profile -- this profile's UUID will be different and as such you will need to update your build settings each time you make a change. If you work with a development team, simply adding a new developer's certificate to the provisioning profile will cause a new UUID to get generated and may cause code signing errors for one or more members of your team.

This video can help you solving your question :)
By: admin