Thursday, February 11, 2016 [Tweets] [Favorites]

Using Xcode Bots

I’ve been using Xcode’s continuous integration feature for a few months now. Overall, I’m glad that I took the time to set it up. However, it’s been much more difficult to use than I expected, so I want to document some of the issues that I encountered, as well as the benefits:

I chose Xcode’s continuous integration instead of something like Jenkins because, coming from the makers of Xcode, I thought it would be easier to set up and less prone to breakage. This may well be true, but it’s not been anywhere near as simple as I’d hoped.

See also: Xcode CI, The missing manual and the Swift CI that uses Jenkins.

Update (2016-02-12): The workaround to get Xcode 7.2.1 bots working (via @CocoaKevin):

sudo /Applications/Xcode.app/Contents/MacOS/Xcode

However, I’m now seeing a bug where Xcode reports the bot integration as still running long after it’s finished (and the trigger has run).

I got multiple suggestions that setting Xcode Server to send e-mails to a Gmail account helps, but it didn’t for me.

12 Comments

I would encourage you to check out BuddyBuild, a new service that aims to take all this pain out of the hands of developers. We've been using it at my day job for months, having heretofore operated with a Jenkins service and an Xcode Server-based setup we were never able to get to work properly, and it has been beautiful.

Your experience with Xcode server seems to be quite the same as some other developers who talked about it at some CocoaHeads presentations. And the conclusion is that it's a pain to set up but sometimes it works.

Also, the UI of Xcode server in Server.app is quite bad from a layout perspective IMHO. And finally, considering that moving to a newer version of Server.app had the interesting consequences of losing all the Xcode server settings, this is quite frustrating.

Thanks for sharing your experience with Xcode server. I think I'll stick around with Jenkins for a while. ;)

We also tried bots when they updated them this past summer. They might be fine for focused, single product environments, but when you're in the consulting business and have many concurrent projects running, it quickly becomes completely unreliable.

I'd recommend using something like CircleCI in the meantime.

For people using other CI products, how is the integration with Xcode? Can you click on a failing test or error and have it jump to the right part of the source file?

With respect to random SMTP failures, I set up OpenSMTPD on my dad's router box last year and now just point all the various devices that want to send status emails (e.g. our UPS management card and InterMapper) to it. Then I setup a Gmail account on my family's domain to act as the source for all the emails. I only listen on the local network and don't require authentication. Here's the entire configuration file:

listen on localhost
listen on 192.168.2.1

# If you edit the file, you have to run "smtpctl update table aliases"
table aliases file:/etc/mail/aliases

# sudo /usr/local/libexec/opensmtpd/makemap credentials
table credentials db:/usr/local/etc/mail/credentials.db

accept from any for domain "rileys.us" \
relay via "tls+auth://gmail@smtp.gmail.com:587" \
auth as hpn.sabi.net@rileys.us

/usr/local/etc/mail/credentials contains: gmail hpn.sabi.net@rileys.us:.

This has drastically improved reliability of status delivery. If the router box dies, I've got external monitoring for it and a spare router box with some printed instructions for my dad, but luckily have not needed it yet :-)

Thanks for sharing your experience. I wrote a bit high level blog post comparing Jenkins & Xcode Server https://medium.com/@hello_paja/self-hosted-ci-for-ios-mac-development-f273606ca767#.iyno63nfo

Darren Peacock

Is anyone able to get Xcode server to work with an Enterprise developer account?
https://forums.developer.apple.com/message/72040#72040

It seems this bug has been present since OSX Server 5.

I submitted a support ticket to Apple about getting an Enterprise developer account to work with Xcode server and the response was "you're experiencing an issue which has no known solution".

We used to have XCode Server working with an enterprise account. The current server build broke that. Now we use Team City for that :)

Had no issues with GIT + SSH keys in XCode Server tho. Easy to setup - just put the keys in your .ssh folder like normal, and it'll use it when you set them up.

I find XCS to be good and very easy to setup, but REALLY REALLY limited in function. TC is harder to setup (not a lot), but is so much more flexible. Just need the time to move stuff over to it now.

And don't Jenkins. Just. Don't.

I highly recommend TeamCity. Coupled with fastlane, CI becomes an absolute breeze.

[…] Lite, Script Debugger, SourceTree, Hopper, Base, Paw, Soulver, and OmniFocus. I plan to switch from Xcode bots to a third-party continuous integration […]

Stay up-to-date by subscribing to the Comments RSS Feed for this post.

Leave a Comment