Using a non-default keychain in Xcode
After a long time of research, I concluded that it cannot be done.
in the Build setting under Code Signing -> Other code signing Flags, create a flag "--keychain keychain-name.keychain"
The codesign tool requires an absolute path to the keychain.
Use an additional "Run Script Build Phase" to call the codesign tool with the custom keychain. The embedded script should look like:
codesign -s 'your-identity' --keychain "${SRCROOT}/path/to/keychain" "${TARGET_BUILD_DIR}/${WRAPPER_NAME}"