下面是我的构建脚本(不使用 xcodebuild 插件)。
- 构建步骤工作
- 我创建了一个带有所需证书和私钥的单独钥匙串,它们在钥匙串访问中可见
- 钥匙串命令在脚本中不会失败
- security list-keychains 将这些显示为有效的钥匙串
就像解锁命令并没有真正成功一样。当我尝试从命令行通过
codesign -f -s "iPhone Developer: mycert" -v sample.app/ --keychain /Users/Shared/Jenkins/Library/Keychains/JenkinsCI.keychain
我明白了
CSSM_SignData returned: 000186AD
sample.app/: unknown error -2070=fffffffffffff7ea
虽然我不确定我是否正确地从命令行模拟,因为你充其量可以
sudo -u jenkins bash
xcodebuild ONLY_ACTIVE_ARCH="NO" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED="NO" -scheme "MySchemeName" CONFIGURATION_BUILD_DIR="`pwd`"
security list-keychains -s /Users/Shared/Jenkins/Library/Keychains/JenkinsCI.keychain
+ security default-keychain -d user -s /Users/Shared/Jenkins/Library/Keychains/JenkinsCI.keychain
+ security unlock-keychain -p jenkins /Users/Shared/Jenkins/Library/Keychains/JenkinsCI.keychain
+ security list-keychains
"/Users/Shared/Jenkins/Library/Keychains/JenkinsCI.keychain"
"/Library/Keychains/System.keychain"
+ security default-keychain
"/Users/Shared/Jenkins/Library/Keychains/JenkinsCI.keychain"
+ codesign -f -s '$IDENTITY_GOES_HERE.' -v sample.app/
sample.app/: User interaction is not allowed.
任何帮助是极大的赞赏。