How does Xcode set EXPANDED_CODE_SIGN_IDENTITY?

I started getting a code error after the certificate expired. I have an updated certificate and it expired has been deleted. But for some reason, Xcode sets EXPANDED_CODE_SIGN_IDENTITY with an expired SHA-1 certificate. Where does he get this value? I suppose it should be cached somewhere, because there is no certificate with SHA-1 in the keychain that it is trying to use to sign the code. I searched the pbxproj file and did not find it, and the recursive grep, starting from the project root, did not give any results.

Here are some details about my configuration:

  • Xcode has no account
  • Instead of a developer account, I use an exported certificate from a team agent
  • Xcode Version - 6.1.1
  • OSX Version - 10.10.2

The project ID is set in Xcode as follows: enter image description here

When I check the keychain, he finds the correct person:

$ security find-identity -p code signing
Policy: Code Signing
  Matching identities
  1) F1326572E0B71C3C8442805230CB4B33B708A2E2 "iPhone Developer: XXX XXX (C395QGL4DK)"

In the output of the assembly, I see the wrong environment variable:

    export EXPANDED_CODE_SIGN_IDENTITY=9F5616A53464FC5C003847ED620357A7BC72ABB1

I tried to fix this as follows:

  • Remove certificate from Access Keychain Access and re-add it
  • Define a private key access control to allow all applications
  • Delete all provisioning profiles and re-add the one I'm using
  • Delete everything under ~ / Library / Developer / Xcode / DerivedData li>
  • Delete everything in ~ / Library / Caches / com.apple.dt.Xcode
  • Restart xcode
  • Reboot Mac

, . , , . , , . , . , , .

, Xcode , , .

+4
2

, : , ( , EXPANDED_CODE_SIGN_IDENTITY , ).

, dev, , .

+1

, jenkins , ... CODE_SIGNING_ALLOWED "" EXPANDED_CODE_SIGN_IDENTITY_NAME EXPANDED_CODE_SIGN_IDENTITY. - .

xcodebuild -project my.xcodeproj/ -sdk iphoneos \
CODE_SIGNING_REQUIRED=YES \
CODE_SIGNING_ALLOWED=NO \
CODE_SIGN_IDENTITY="My Identity" \
EXPANDED_CODE_SIGN_IDENTITY_NAME="My Identity" \
EXPANDED_CODE_SIGN_IDENTITY=<CODE_SIGN_IDENTITY>

security find-certificate -a -c "My Identity" -Z|grep ^SHA-1|cut -d " " -f3|uniq
0

All Articles