Xcode has an “Automatic Profile Selector” in the “Code Signature Identification” section of “Build Settings”.
The presence of two "iPhone Developer" certificates in the key chain is not displayed, as there is a way to manage Xcode preferences one over the other.
Codesign lists the following rules for identifying identities.
Identity is first seen as the full name of the keyword identification preference
Identity is located by searching for all keys for a certificate whose generic name (only) contains an identifier
- If there are multiple matches, the operation fails and the subscription fails.
If the identifier consists of exactly forty hexadecimal digits, it is instead interpreted as a SHA-1 hash
The fact that there are 2 partial matches on iPhone Developer suggests that Xcode has a different way of resolving identifiers.
I tried to create an identity preference in the certificate, which suggests entering "Location (URL) or email address". Not sure what the URL or email address should link to.
Used by “iPhone Developer” as the value instead (the keyring is happily accepted), but Xcode does not select the preferred certificate.
Is there a way to use the "Automatic Profile Selector", but is it allowed to "Identity Card?"
source share