Jenkins - Xcode build works codesign fails

前端 未结 11 2360
夕颜
夕颜 2020-11-30 19:14

Below is my build script (not using xcodebuild plugin).

  1. Build step works
  2. I have created a separate keychain with the required certs and private keys
11条回答
  •  攒了一身酷
    2020-11-30 19:59

    Here what worked for me:

    1. I created a new keychain and copied all entries from "login" to it, named it "jenkins_ios"
    2. Made new keychain default.
    3. Added a new "Execute shell" step in Jenkins config, it should be the first step beforecode signing, containing the following:

    KEYCHAIN=/Users//Library/Keychains/jenkins_ios.keychain
    security -v list-keychains -s $KEYCHAIN
    security -v unlock-keychain -p  $KEYCHAIN
    security set-keychain-settings -t 3600 -l $KEYCHAIN
    

    Last step is really important, as default unlock timeout may not be enough long for your project to build properly (exactly this happened with our project, as it is huge and build step took about 5-7 minutes, and keychain became locked at the moment it was required for codesign).

提交回复
热议问题