Setting Up Xcode 9 Server

The remote setup

Due to the simple setup, getting started is really easy and can be done within a couple of hours.

The first thing you need is a Mac where your builds can run so that you can simply push new commits to your repo and go back to fixing bugs or working on new features! After you’ve signed up for a Mac with MacStadium, download Xcode 9 either from the Mac App Store or through Apple’s Developer website.

Once you’ve downloaded Xcode 9 and unpacked the special .xip file, open Xcode to have it install its dependencies like command line tools and SDKs in the correct places.

Since Xcode Server no longer depends on macOS Server, you can simply go into Xcode’s settings and click on Server & Bots. Once you enable the Xcode Server through the toggle in the upper right corner and enter your user password, Xcode will setup everything needed to be accessible from your copy of Xcode running on your development machine like SSL certificates for secure communications...

Server & Bots Screen

...and the API server allowing you to kick off new builds on the remote Mac in one of our data centers.

Starting API server screen

Once the modal dialogue disappears, you’re setup. There are more options, but the defaults should suit everyone well out of the box. Since Xcode 9 Server is now successfully setup you can close the Remote Desktop session and focus entirely on your local copy of Xcode.

The local setup

Open Xcode’s settings and navigate to the second tab called “Accounts.”

Accounts tab

Click the plus sign in the bottom left corner and then select Xcode Server.

Xcode Server

You will be asked to enter an IP address, which you can find in your installation confirmation email from MacStadium.

Enter IP Address

(You can also use a DNS queryable URL if you’ve added a subdomain to your TLD with your Mac’s IP address like ci-mini.example.com)

Username and password

Once you’ve provided the correct credentials and clicked "Add," the dialogue box will disappear and more information about your version of Xcode Server will be displayed, like the API Server version and available SDKs for iOS, macOS, tvOS and watchOS.

Xcode server info

Setting up a Xcode bot

Now that you’ve setup the build server and added it to your Xcode account you can go to Products -> Create bot in the status bar.

You’re able to provide a name to your Xcode Bot allowing you to distinguish between multiple bots for different jobs.

Create a new bot screen

The next steps of the Xcode bot creation will take you through the version control or source control settings of your bot and will allow you to define the build configuration.

Configure screen


Another great feature of Xcode bots are the possibility to have certain ones run at certain times every day allowing you to create a bot for example that pushes out a new beta build of your app to beta tests at night automatically.

Schedule bot integrations

If you prefer to have tests run on certain simulators you can either have it test your application on all available iOS simulators or define certain ones that it should test with.

Choose devices

The following step asks you to decide wether you’d like Xcode to manage its own certificates or if you’d like to provide certain Development and Distribution certificates and the matching provisioning profiles.

Certs & Profiles screen

After you’ve decided on how to have Xcode Server sign your application it allows you to pass custom arguments to xcodebuild, the command line tool which will build and test your application. (In order to learn more about xcodebuild open a terminal window and type man xcodebuild.)

Variables screen

You’re also able to run custom scripts before and after the build. These can be used to setup dependencies like git submodules or to trigger a package manager.

Once you’ve set everything up the way you’d like it you can view your Xcode Server bot and it’s results in the Report navigator of your Xcode projects sidebar.

Report navigator

Getting started with Xcode Server has never been easier if some effort is put into it upfront. Beta tests and release overhead can be decreased greatly, giving you more time to focus on your apps code and shipping new features quicker.

Due to the first party integration into your development environment Xcode Server is sleek and gives you the ability to get everything done from writing code to automatically releasing it to your users from your native IDE without the need for another dependency or a website that you have to visit.