XCode has an "Automatic Profile Selector" under "Code Signing Identity" in "Build Settings".
Having 2 "iPhone Developer" certificates in the keychain,doesn't appear like there is a way to steer XCode's preference of one over the other.
Codesign lists the following rules for resolving identities.
The identity is first considered as the full name of a keychain identity preference
The identity is located by searching all keychains for a certificate whose subject common name (only) contains the identity
- If there are multiple matches, the operation fails and no signing is performed
If identity consists of exactly forty hexadecimal digits, it is instead interpreted as the SHA-1 hash
The fact that there are 2 partial matches on "iPhone Developer" suggests that XCode has a different way of resolving identities.
Tried creating an Identity Preference on a certificate which prompts to enter "Location (URL) or Email Address". Not sure what the URL should refer to or the email.
Used "iPhone Developer" as the value instead (keychain happily accepted) but XCode doesn't pick the preferred certificate.
Is there a way to use the "Automatic Profile Selector" yet have it resolve on an "Identity Preference?"