Building iOS project with Jenkins on Ubuntu Linux

As of Xcode 11, there is not a way to run the Xcode build tools on an operating system other than macOS. The minimum system requirements can be found here.


The xcodebuild tool is part of the Xcode SDK from Apple — it's only available for download on Mac OS X.
You cannot simply use the official iOS tools to build on a computer that isn't running OS X.

This means that, if you have a Jenkins job which builds an iOS app, it must be built on a Mac.

This does not mean, however, that Jenkins must be installed on a Mac. Jenkins supports distributed builds, whereby you can have multiple machines, with different operating systems, and you can instruct Jenkins on which machine a certain build should run.

For example, as you already have a Ubuntu machine as your Jenkins master server, you can simply add a Mac as a build node. The Jenkins master would then communicate with the build node (Mac) via SSH. In the configuration for that build node, you should add a label, e.g. "xcode", to signify that the Xcode SDK is installed.

In the Jenkins job configuration, there is an option called "Restrict where this project can be run", where you can tell Jenkins that it may build this job only on a node with a given label. In this case, you would just enter "xcode", and the job would always be built on an appropriate Mac, rather than on the Ubuntu machine.

Tags:

Ios

Jenkins