OS X Server (Mavericks): Xcode Part 1

Introducing a brand new service aimed at developers, OS X Server’s Xcode Service is all about providing, what Apple refers to as continuous integration.

Automated building, analyzing, testing, archiving and hosting your repositories are all part of the new Xcode Service.

Additionally there is an entire web interface providing access to all the test bots with their results, archives and the latest builds of your app. A nice touch is the Big Screen mode, allowing you to have a big status display in the office via Airplay and Apple-TV if you wanted to.

In Part 1, we will dig in and see how we go about setting it up. Part 2 will cover a bit more about the use of Web Interface for the service.

First steps

Fire up the Mac App store and grab OS X Server and Xcode. Once your downloads are done, launch OS X Server and go through the setup assistant. Upon completion, select Xcode in the sidebar.

‘Choose Xcode...’ and navigate to /Applications and select Xcode. This will trigger the Xcode setup. During this Xcode will launch and you might need to follow a prompt or two if you haven’t launched Xcode prior to selecting it in OS X Server.

Next you’ll see the main Settings display for the Xcode Service.

Getting in to the thick of it

Start by adding your Developer Teams, simply click on the Add.. button. You'll be prompted to sign in with your developer ID. It's important to note that you should sign in with a developer ID that has Admin or Agent rights on the Developer portal if you using an ID that is part of a registered developer company.   

If you're an iOS developer you would want to add a device. Simply plug in the device. It will show under the devices area. Click on Use for Development. If the device has a passcode, unlock and click 'Trust' else it will not show under Devices. 

Reaching this point, you have a configured Xcode service. From here you are able to further customise by adjusting permissions for who can view/create Bots. Time to flip the On switch!

Repositories

Part of the Xcode service is the ability to host your code repository. While it requires no further configuration and will function right out of the box. There are a couple of pitfalls worth noting.

Repository access is set to allow HTTP, HTTPS. Should you wish to make use of SSH, be sure to check under your Server's settings who is allowed to use SSH! Here's why...

The default value is set to only allow SSH for 'administrators'. The trouble is when the repository has SSH enabled, Xcode on your developer workstation will prefer SSH over HTTP and HTTPS.  If the account that you fill in on the workstation when connecting to the server is not an administrator, it will appear as if you are using an invalid password. Be sure to set administrators to all users if you plan to use SSH.

The second pitfall that you might run into, relate to permissions of a newly created repository when SSH is enabled. Default permissions dictate that 'Logged in users' can create repositories. With SSH enabled however, you need to be aware that when Xcode attempts to check out a repository, it will likely default to SSH, which has separate permissions to the defaults. Double clicking the repository in question will reveal that only the original creator can read/write via SSH. Another member attempting to check out this repository will see an error in Xcode stating that its not a valid Git repository!

In order to rectify this, click the edit button and tick the area marked in green, which allows view access for logged in users via SSH.