Changing manually $(AppIdentifierPrefix) property?
Asked Answered
B

3

9

I had application uploaded on apple store. Now I am developing update version. But instead on working on existing project, i created new project with different name. When i finished i changed name and bundle identifier to match existing app.

I tried uploading app to test flight but i got error

"Invalid IPA: The keychain-access-group in the embedded.mobileprovision and your binary don't match."

So I started browsing net for answers... What I have come up is to enable entitlements. I did, but to no avail... Then i edited entitlements, changing from this:

$(AppIdentifierPrefix)com.xxxx

to this:

12HJ2312.com.xxxx (the number is number of prefix from developer portal)

And it worked, i could upload. And the world was fine once again. Or was it? I still don't understand why I had to change this. From where is

$(AppIdentifierPrefix)

is red? I thought is is red from keychain, but it seems not, because in keychain is the same value I entered. So how can i see this value, and where does it draw its contents?

Babbler answered 4/7, 2013 at 15:1 Comment(0)
L
17

The app identifier prefix is specified in the provisioning profile you are using. Locate the provisioning profile in finder. To do that, in Xcode, go to Window>Organizer. In organizer, right click on the provisioning profile and select 'Reveal Profile in Finder'). Open the file in TextEdit or some other text editor and you will see something similar to this inside , somewhere in the middle (search for "Entitlements").

<key>Entitlements</key>
<dict>
    <key>application-identifier</key>
    <string>A1B2C3D4E5.com.example.*</string>
    <key>get-task-allow</key>
    <false/>
    <key>keychain-access-groups</key>
    <array>
        <string>A1B2C3D4E5.*</string>
    </array>
</dict>

The app identifier prefix in this case is A1B2C3D4E5

Lira answered 12/7, 2013 at 21:6 Comment(2)
a bit late, but a better answer to this is found in the following answer: https://mcmap.net/q/206562/-access-app-identifier-prefix-programmaticallyBronchiole
The command security cms -Di xx.mobileprovision will output these information as a plist file.Tigges
B
7

Just as a side note to Ahmed's answer:

The value of ${AppIdentifierPrefix} is "A1B2C3D4E5."

So OPs original issue is that

${AppIdentifierPrefix}.com.xxx evaluates to A1B2C3D4E5..com.xxx, which won't match what your profile says.

Bakelite answered 5/6, 2015 at 22:58 Comment(0)
P
4

This has changed in Xcode 5. Here's how I did it:

Open the Keychain Access app on your Mac. Look for the "iPhone Developer" certificate for developer builds, or the "iPhone Distribution" certificate for ad-hoc and App Store builds.

If there are multiple certificates, you can find which one you're using in Xcode by looking at the Code Signing Identity field in your project Build Settings. It will probably say "iOS Developer". Click on this and it will list the "Identities in Keychain". This should give you some indication of which identity you're actually using.

Back in Keychain Access, select the certificate (e.g. "iPhone Developer") and then click the "i" button at the bottom of the window. Another window will pop up after a couple of seconds with the certificate info. Look in the Details section and you'll see "Organizational Unit". If everything is normal, that ID value will be the same as your $(AppIdentifierPrefix), and should also be the same for both developer and distribution certificates. Also, the "iPhone Distribution" certificate should have this same ID right in the title.

Provincial answered 3/12, 2013 at 1:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.