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.
Even if you don't own a Mac, you can work on iOS development on Ubuntu by using third-party tools (like a sandbox or a virtual machine).
In order to build iOS applications you will need to run the server on a macOS machine. You could install Jenkins directly on a Mac computer, but our preferred way is to have a small Mac mini machine* in our office devoted to these tasks.
Being an iOS developer, you know that using Xcode (IDE), you will be able to develop iOS mobile apps. However, Xcode only runs on a Mac computer. Thus, you need different ways to develop iOS applications on Linux. For developing an iOS app on Linux, you need virtualization software.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With