title: OTHER_CODE_SIGN_FLAGS keychain flag ignored?
body: <p>I have just learned about the possibility to use OTHER_CODE_SIGN_FLAGS to specify the keychain which includes the cert needed for building and signing an app. But unfortunately I cannot get it to work.</p>
  
  <p>My script looks something like this:</p>
  
  <pre><code>#!/bin/bash
  TARGET="MyProject"
  CONFIGURATION="Release"
  SDK="iphoneos"
  IDENTITY="iPhone Developer: John Doe (XX22RR22O)"
  KEYCHAIN="/Users/username/Library/Keychains/someKeyChain.keychain"
  PASSWORD=""
  
  security unlock-keychain -p ${PASSWORD} ${KEYCHAIN}
  xcodebuild -target "${TARGET}" -configuration ${CONFIGURATION} -sdk $SDK CODE_SIGN_IDENTITY="${IDENTITY}" OTHER_CODE_SIGN_FLAGS="--keychain ${KEYCHAIN}"
  </code></pre>
  
  <p>But that fails:</p>
  
  <pre><code>Check dependencies
  [BEROR]Code Sign error: The identity 'iPhone Developer: John Doe (XX22RR22O)' doesn't match any valid certificate/private key pair in the default keychain
  </code></pre>
  
  <p>But if I switch to the keychain first it works but that is not useable on a build server where multiple builds could happen simultaneously:</p>
  
  <pre><code>#!/bin/bash
  TARGET="MyProject"
  CONFIGURATION="Release"
  SDK="iphoneos"
  IDENTITY="iPhone Developer: John Doe (XX22RR22O)"
  KEYCHAIN="/Users/username/Library/Keychains/someKeyChain.keychain"
  PASSWORD=""
  
  security unlock-keychain -p ${PASSWORD} ${KEYCHAIN}
  security default-keychain -s ${KEYCHAIN}
  xcodebuild -target "${TARGET}" -configuration ${CONFIGURATION} -sdk $SDK CODE_SIGN_IDENTITY="${IDENTITY}" OTHER_CODE_SIGN_FLAGS="--keychain ${KEYCHAIN}"
  </code></pre>
  
  <p>Hope you guys can help
  -Morten </p>