codesign requires keychain password even after 'security unlock-keychain'
Asked Answered
F

1

6

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

Feeze answered 20/7, 2018 at 20:39 Comment(0)
F
0

The problem was that the I issued the unlock-keychain before the build, and the signing was happening like 45 minutes later. The unlocking expired.

This can be solved with

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

I solved it by issuing the unlock command right before the signing

Feeze answered 27/9, 2018 at 17:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.