In Part 1 we took care of all the prerequisites of preparing a clean Mac Mini as our Jenkins build server. Now we are ready to set up Jenkins and configure our jobs.

The Goal

It’s good to summarize what we want to accomplish here. I’m not going into the merits of a CI server and why you should have one. Just trust me, you need one. If you want to read on the basics, see this Xamarin guide.

We want to automate the BuildTestDeploy cycle for our Xamarin.iOS app, let’s call it MyProject from now on. It’s considered good practice to split up these tasks in separate jobs, both for maintainability and to limit job execution time. This way you can manage and track progress for each job separately. Separate jobs have its downsides too, but we will come to that. We are going to create 3 jobs:

  1. MyProject (Build)
  2. MyProject-testcloud (Test)
  3. MyProject-testflight (Deploy)

The MyProject job will trigger the jobs MyProject-testcloud and MyProject-testflight only when the build succeeds. This is what we call Downstream projects. Notice that we are deploying to TestFlight right after the build succeeds, we are not waiting for the Test Cloud tests to finish. This is because I want to deploy to TestFlight regardless of the Test Cloud results as TestFlight is used by our developers and manual testers.

Continue reading

You know how (technical) bloggers sometimes say that their blog is their personal memory dump? Sometimes you go searching for the solution to an issue and find the answer on your own blog! I bet this blog post is going to be one of those posts 🙂

Previously I wrote about issues when installing Java on Yosemite during a Jenkins install. I was installing Jenkins because I’m setting up a CI environment for our Xamarin.iOS app. The purpose of this CI environment is to build our Xamarin.iOS app, run the Xamarin.UITests on our Xamarin Test Cloud instance and upload the build to TestFlight for our internal QA and developers to play with.

I bought a nice Mac Mini for this purpose with OS X Yosemite installed. I started out with the Using Jenkins with Xamarin guide on the Xamarin website. This guide mentions a number of prerequisites, but I will try to be as complete as possible in describing the steps to get a Jenkins CI running with Xamarin.iOS, Xamarin Test Cloud and TestFlight.

Continue reading

Lately I’ve been diving into Xamarin test cloud (which is awesome BTW) using Xamarin.UITest, the c# frontend to Calabash.

Since I’m having some issues deploying our Xamarin.iOS app on a simulator, see http://forums.xamarin.com/discussion/9748/ios-simulator-application-terminated-when-testing-on-older-ios-versions, I tried to get the UI Tests running on an actual device.

It took some digging, but I got it to work using this code:

IApp app = ConfigureApp
                .iOS
                .EnableLocalScreenshots()
                .InstalledApp("com.example.yourappbundleid")
                .DeviceIp("192.168.1.1")
                .StartApp();

As a comparison, the way to run the tests on a simulator is like this:

IApp app = ConfigureApp
                .iOS
                .EnableLocalScreenshots()
                .DeviceIdentifier("E67C54DA-17B2-4EBC-AA08-FBF3FB571243") // iPhone 6, 8.1
                .AppBundle(PathToIPA)
                .StartApp();