Reputation: 491
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.
Upvotes: 21
Views: 20582
Reputation: 2486
There is an opensource xcodebuild
replacement made by Facebook called xcbuild
. Running on MacOS, Linux and Windows.
https://github.com/facebook/xcbuild
But then again, Apple could see that you're not building on Mac hardware and wont allow your app to be on the appstore.
Upvotes: 1
Reputation: 11
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.
Upvotes: 1
Reputation: 111625
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.
Upvotes: 67