Changing manually $(AppIdentifierPrefix) property?

喜欢而已 提交于 2019-11-28 08:44:58

问题


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?


回答1:


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




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/17473443/changing-manually-appidentifierprefix-property

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!