How do I set the identity preference in the keychain that Xcode will use?

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?"

+6
source share
1 answer

I think it's too late, but in Xcode 9, in "Build Settings" -> "Code Signing Identity" , with "Code Signing Style"=Manual/Auto , now there are two drop-down lists from which you can choose for both Goals: a) one of the developers / distribution of iOS profile type, b) KeyChains identifier for the developer / distributor.

What worked for me:

  • use the same or two different Provisioning profiles for debugging and Release (created and exported from my site by the developer account and imported into Xcode)
  • set "Code Signing Style" to "Manual"
  • Select the imported PP for two purposes.
  • establish a) and b) lists for the developer / distributor identifier whose certificate was included in the PP (s) created in 1)

Now I can launch the debugging target, usually with Xcode, using the "Run" button, and at the same time archive and export the release target with the PP distribution.

0
source

Source: https://habr.com/ru/post/916340/


All Articles