首页 > 解决方案 > codesign requires keychain password even after 'security unlock-keychain'

问题描述

I'm running xcodebuild in a script to archive and export my project. I'm code signing using a keychain file. In order to avoid the prompt to enter the keychain password, I'm using

security unlock-keychain -p <Password> <Keychain file>

This command finishes successfully without any output

Still, when I run xcodebuild, I'm getting prompted with

codesign wants to use the "myKeychain" keychain.

What am I missing? I'm running xcode 9.4.1

enter image description here

标签: xcodecode-signingkeychain

解决方案


问题是我unlock-keychain在构建之前发布了,而签名是在 45 分钟后发生的。解锁已过期。

这可以解决

security set-keychain-settings -lut 7200 <keychain>

我通过在签名之前发出解锁命令来解决它


推荐阅读