The Greenhouse Developer Hub

Welcome to the Greenhouse Developer Hub. You'll find comprehensive guides and documentation to help you start working with Greenhouse as quickly as possible, as well as support if you get stuck. Let's jump right in!

Documentation      Community Forum

Building iOS apps

In this tutorial you'll find detailed instructions for how to set up an iOS project in Greenhouse.

What This Guide Covers

This tutorial guides you through setting up your iOS project in Greenhouse.

The tutorial covers how to:

First steps

All you need to setup your project in Greenhouse is a web browser. But as you are already reading this, then I guess we can agree that you have one anyway. Greenhouse doesn’t require any kind of additional software from your side and you don’t even have to write any tedious configuration files full of technical boilerplate. We’ll scan your repository and from what you have there our builders find everything they need. You’ll just have to confirm what configuration you want to build.

But let’s get our hands dirty and see how the process works in detail.

The first time you log in to Greenhouse you’ll be presented with an empty dashboard that encourages you to “Add an app to get started!” Let’s get going by clicking on “add new app”.

That's how your dashboard looks like after you've signed up.

That's how your dashboard looks like after you've signed up.

Clicking the add new app card on the dashboard will open a new project creation flow that asks for your Git repository URL and authentication type for the repository. You can read more about setting up your Git repository from Specify Git repository.

Select configuration

As soon as you submit a repository, either public or private, Greenhouse takes a first look at it by listing the branches in this repository. The next step for you is to select the branch you want Greenhouse to scan for projects from. To do this you just have to select a branch from the dropdown. If you’ve chosen the branch, you can hit the green “select branch” button to proceed (note that you can change the branch later).

Clicking on the “select branch” makes Greenhouse to scan the repository from the specified branch. This includes cloning the repository, looking for projects from it and searching for the configurations.

All these actions can be monitored real-time from your browser via the live log window.

If you are using Cocoapods to manage the dependencies of your project, please refer to the Cocoapods section before continuing to read this section!

Once the project scanning has finished, you need to do the following

  • Select a project or a workspace - Projects are are containers for code, resources and different build settings. Workspaces are containers of different projects.

  • Based on the previous selection of project or workspace, you will need to select either a Target (projects) or a Scheme (workspaces)

Now that you are done with the build configuration, all that is left to provide the corresponding code signing files.

Signing files

You you might want to skip over to running your first build, if you already know how to provide your signing certificate and provisioning profile

Signing Certificate

Feel free to skip this section if you know how to export your signing certificate

First, we will find your signing certificate.

Open up Keychain Access by searching for it in Spotlight. In the Categories submenu on the left sidebar select My Certificates

Adding a signing certificate.

Adding a signing certificate.

The name of the certificate should start with iPhone Developer or iPhone Distribution:

Once you have located your signing certificate, select File -> Export Items from the OSX menu bar.

Exporting signing certificate.

Exporting signing certificate.

This will prompt you to save the signing certificate.

Saving signing certificates.

Saving signing certificates.

Be sure to leave the file format filled as Personal Information Exchange (.p12), as saving the certificate with the .cer extension will not include your private key.

Finally, you will be prompted for the certificate export password. The password is not actually mandatory and you can leave as blank, but it is recommended to use a strong password.

That’s it. Now all you need is the corresponding provisioning profile.

Provisioning Profile

Feel free to skip this section if you know how to find the corresponding provisioning profile for your application

Select the appropriate provisioning profile from Apple Developer portal. Download it and save it somewhere.

That’s it. If you successfully downloaded your signing certificate that should be everything you need. Now you can upload both of these files. We check that the provisioning profile and signing certificate match. And will let you know if something goes wrong.

Scanning projects.

Scanning projects.

Running your first build

That’s it!

Running your first build.

Running your first build.

Now there’s only one more step left to build your iOS app with Greenhouse and that’s clicking the “save” button!

This action will show you the projects dashboard where you can see the app you just added already being built.

Building your application.

Building your application.

After git clone Greenhouse will automatically find the name and icon of your app from the repo and updates your project accordingly. To see the progress of your build, just click the “View build” you’ll be shown the build overview, where you can see the real time logs of your build.

Build log.

Build log.

Testing

Setting up testing in Greenhouse is 100% automatic. When you submit your repository, we scan the selected configuration for tests, and if there are any tests present, we run them for every push.

Greenhouse currently only supports running XCTests. Additionally, the tests must be a part of your scheme in Xcode, otherwise we cannot detect and run them automatically.

The test report screen shows you a simple overview of all passed and failed tests including the failure reason so you can quickly identify what’s broken.

Test view.

Test view.

It provides specific information about where the error occurred, including the stacktrace, so you can zoom in fast on the underlying problem in your code.

Build log.

Build log.

Publishing

Greenhouse supports publishing your iOS applicatios to several distribution channel.

Build versioning

To make your build version management easy, Greenhouse exports two environment variables that you can use in your build scripts. You can read more about it from Incrementing iOS app version.

Building iOS apps

In this tutorial you'll find detailed instructions for how to set up an iOS project in Greenhouse.