-->

Building iOS project with Jenkins on Ubuntu Linux

2020-02-19 08:44发布

问题:

I have installed Jenkins in Ubuntu and while I am trying to build an iOS app in Jenkins the below error occurs:

FATAL: Cannot find xcodebuild with the configured path /usr/bin/xcodebuild.

回答1:

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.



标签: ios jenkins