[Jenkins] 4. Integration with XCode

(1.) Go to Jenkins Configuration -> System Setting page, find 'Xcode Builder ', input your Team Name and Team ID.

next, input your Keychain Name and path, you can find login.keychain-db under bellow path, the password is the same as what to login your computer.

~/Library/Keychains

the Keychain Name is your Apple certification title in the Keychain Access App

(2.) Go to Jenkins Configuration -> Keychains and Provisioning Profiles Management page, upload your Login keychain and Provisioning Profiles

you can find login.keychain-db under bellow path, the password is the same as what to login your computer.

~/Library/Keychains

change your login.keychain-db file name to login.keychain, the Code Signing Identity is the same as your Apple certification title title: iPhone Distribution: Chih-Hao Chen (AD2LB8H35R)

upload provisioning profiles of your project, and input the folder path of where you keep the provisioning profiles.

(3.) Go to Your Project -> Configuration -> Build environment page, check Keychains and Code Signing Identities checkbox and select your keychain

next, check Mobile Provisioning Profiles checkbox and select your provisioning profiles

(4.) Go to Your Project -> Configuration -> Build page, insert XCode setting, input your Development team name and target name, the target name is the same as the target in your XCode project.

next,

  • input the Configuration column (Release or Debug)

  • input the Xcode Schema File column, if you don't use cocoapod in your project, it will be your target name, or......you should google it again.

  • check the Generate Archive? check box.

  • uncheck the Pack application, build and sign .ipa? check box. (for XCode 9 or later)

(5.) Go to Your Project -> Configuration -> Build -> Code signing & OS X keychain options page, check the Unlock Keychain? check box and select your keychain

(6.) Go to Your Project -> Configuration -> Build page, insert a Shell setting.

input below command to export ipa file or your project

  xcodebuild -exportArchive -archivePath ${WORKSPACE}/build/Release-iphoneos/PasswordKeeper.xcarchive -exportPath ${WORKSPACE}/build -exportOptionsPlist ${WORKSPACE}/ExportOptions.plist    

Parameters:

-archivePath: you can go to /Users/Shared/Jenkins/Home/workspace/yourProject directory to find yourProject.xcarchive

-exportPath: the output ipa file path

-exportOptionsPlist: at first time, you should manual build Archive by Xcode and export archive folder, you will find an ExportOptions.plist file in the folder. Copy the ExportOptions.plist to /Users/Shared/Jenkins/Home/workspace/yourProject directory

(7.) Finally, build your project and you will find the ipa file at the export Path

Last updated