我正在尝试在Jenkins上运行自动化的xcodebuild,但是遇到了以下错误:
不允许用户交互。 命令/usr/bin/codesign执行失败,退出码为1。
我已经参考了"User interaction is not allowed" trying to sign an OSX app using codesign和其他类似的主题,但是没有一个解决方案能够正确地解决这个错误。
这是我已经尝试过的:
I have allowed all items to access the keychain, and I have specifically added codesign to the "always allow" list (as done here https://dev59.com/cmIj5IYBdhLWcg3wfVJ8#22637896)
I have set the keychain to not automatically lock with a timeout, both through Keychain Access's settings, and through the command
security set-keychain-settings -t 3600 -l <KEYCHAIN>
I have tried calling
codesign --sign <CODE SIGN IDENTITY> --force ...
before the project compiles (more specifically, this solution https://dev59.com/cmIj5IYBdhLWcg3wfVJ8#20208104), and although this successfully builds the project I don't think that codesigning before compiling is correct or reliable. (edit: this also failed when run from jenkins)
这是我正在执行的命令:
security unlock-keychain -p <PASSWORD> <KEYCHAIN>
xcodebuild -scheme <SCHEME> -workspace <WORKSPACE> -derivedDataPath <BUILD DIRECTORY> -configuration <CONFIGURATION> "CONFIGURATION_BUILD_DIR=<BUILD DIRECTORY>" "CODE_SIGN_IDENTITY=<CODE SIGN ID>" "PROVISIONING_PROFILE=<PROVISIONING PROFILE>" clean build
有趣的是,在本地构建项目时,使用上述命令可以正常工作,但尝试在ssh(和jenkins)上运行完全相同的命令会导致错误。
提前感谢您的帮助!
/usr/bin/codesign
的权限? - Opal