Most of this blog is discuss the errors and how I resolve the errors when I try iOS project Continuous Delivery with Jenkins. The brief steps are:
Install Xcode plugin on Jenkins
New a ‘Freestyle project’ on Jenkins
Jenkins project configuration
- ‘Source Code Management’ on Jenkins
- ‘Build’ setting on Jenkins
Jenkins Project -> ‘Build Now’
CodeSign error: Code signing is required for product type ‘Application’ in SDK ‘iOS x.x’
I have stuck on this error for days and got it resolved by checking following configuration:
For XCode, Check if the account you logged on Xcode has been bound Certificate and Provisioning profiles on Apple Developer. The option ‘Automatically manage signing’ was enabled on my project and it doesn’t cause any issue (XCode version: 10.1)
For Fastlane, if the account was verified as #1, there won’t be any issue.
For Jenkins, I prefer to enable ‘Import developer profile’ option before run build with Xcode Plugin. Actually, the steps about how to upload the profile to Jenkins has been described in details on XCode Plugin page:
This plugin builds on top of Credentials Plugin to allow you to store your Apple Developer Profile (*.developerprofile) file. This file contains a code signing private key, corresponding developer/distribution certificates, and mobile provisioning profiles. You can create this file from your XCode. To upload the developer profile into Jenkins, go to “Manage Credentials” in the system configuration page, and select “Apple Developer Profile” from the “Add” button. To use this profile for signing, add “Import developer profile” as a build step before you run Xcode, and select the developer profile to import into the build machine. This build step will install the developer profile into the slave’s keychain.
Screenshots about Apple Developer Profile Export:
Screenshot about Apple Developer Profile Import:
For Jenkins/Xcode plugin, make sure the ‘Scheme’ or the ‘Target’ was defined properly.
Two schedules were defined in my project: one for real devices and another for the simulator.
Scheme names also can be found by the command: ‘xcodebuild -list’
Target ‘xxx’ (project ‘xxx’) has copy command from file_location1 to file_location2
Refer to the question on StackOverflow, the issue can be resolved by changing Build System to ‘Legacy Build System’
Note: I prefer “Jenkins Credential” than “Keychains and Provisioning Profiles Plugin” because the comment: ‘This plugin exposes the keychain passwords in the Compare Environment section.’ from Henry Yei.
Scan the QR code using WeChat