Changing manually $(AppIdentifierPrefix) property?

不打扰是莪最后的温柔 提交于 2019-11-29 14:45:10

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

smurfingonstackoverflow

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.

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.

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