Xcode server and continuous integration for iOS

Upon setting up Xcode server on Yosemite 10.10 I ran into a couple of curious issues that were causing frustration and didn't seem well documented. This won't be well documented but at least here are a couple of hints should things go wrong...

First up was git. As is usually the case I stated with a local repository and only later decided to use Xcode Server. Once I enabled Xcode Server it seemed to work. But upon adding the remote git repo I ran into strange errors. It repeatedly said the repo already existed on the server but also said there was no functioning remote repo. I'd chosen to connect to the repo via ssh:// and it turns out there was a conflicting entry in my known hosts file. With that entry removed all proceeded as planned. Moral of this story is if you have issues connecting to git from Xcode be sure to try it from the command line and see if there are any errors that aren't being surfaced.

The next issue was after the first run all the simulator builds failed. The error was something like this:

Bot Issue: error. Uncategorized.
Issue: Test target myTest encountered an error (Timed out waiting 120 seconds for simulator to boot, current state is 1. If you believe t.

Some googling pointed to this bug and others like it. I was using SSH for git but surely Xcode talking to Xcode Server, not the Jenkins or other integrations I'd been reading on the web, would know how to talk to the other side. Upon remotely screen sharing with the server I noticed the _xcsbuildd user was logged in along side my session. Not having a password for this user I went to an admin user and reset the password. With the password reset I was able to login and see that a Time Machine message about the backups being rotated was on the screen. This had prevented all but the first iPhone 4 simulator run from completing. With that issue out of the way the next simulator run ran cleanly.

Category: