First steps with Azure DevOps as an iOS Software engineer

Thimo Bess
arconsis
Published in
4 min readJun 24, 2021
Photo by Ivan Bandura on Unsplash

In mobile development, especially when developing for Apple, you are dependent on Apple hardware, especially the BuildServer. Most companies buy cheap hardware, like a few MacMinis, to use for compiling apps.

But with that comes other costs that most don’t factor in. For example, you have to take care of the hardware, install software updates. For this, you usually need a person, who feels confident enough to take on these tasks.

We, at arconsis, had exactly this situation: We came to the point that the hard disks of our MacMinis were so full that it was not possible to install a new Xcode version in parallel. So another solution had to be found.

I started testing cloud solutions for this problem. One promising solution seemed to be Azure Devops.

So in the last few days I tested several build jobs using this platform. From iOS to Android, to Flutter and backend, I was able to set up relatively quickly after a short learning phase.

In this article, I want to share with you my experience that I have gathered with this platform. So let’s start ;)

First Pipeline

If you have experience with Gitlab, then it is relatively easy to create a repository with the associated pipeline(s) in Azure DevOps. Similar to Gitlab, the pipelines in Azure are configured with YAML files.
Something I like quite a bit is that Azure has an online editor for the YAML files, where you can put together the individual building blocks of a pipeline relatively easily.

Azure Pipeline Editor

After we have created our first repository and pushed a sample project into it, we can start configuring the pipeline.

As is common with iOS, we use Fastlane for iOS builds. The advantage here is that the entire process can also run on the developer’s machine.
The actual Azure pipeline then has to set all the necessary environment variables and then call the Fastlane script.

Environment Variables

I had some difficulties with the environment variables in the beginning, because I thought they could be used directly in Fastlane. However, the Azure environment variables are not the same as the normal variables.
Here I had to create a mapping or new environment variables for the pipeline and the pipeline step respectively.

Variable Group Settings

The next problem I encountered was that I needed to access a second Azure repository. My naive approach was to simply do a “git checkout”. However, to no avail as the pipeline or runner used did not have direct access to the other repo.
The solution for this was to do the authentication via SSH. For this you have to store the correct SSH key on the used runner.

YAML Definition: Installing SSH Key

After this was configured, I was one step further. However, I had not considered that the SSH key I generated has a passphrase. If you use a key without passphrase, it works directly without problems.

iOS Build Steps

Now that the SSH key has been installed on the runner, we can install Fastlane using Bundler.

YAML Definition: Bundler & Dependency Installation

Once we have all the dependencies installed, we can set the variables needed for Fastlane and then call our build lane.

YAML Definition: Execute Fastlane

As you can see above, the Azure variables “MATCH_PASSWORD”, “KEY_ID”, “ISSUER_ID” and “appleAuthKey.secureFilePath” are mapped to the appropriate Fastlane Environment variables here.
The variables are stored within Azure and do not need to be defined directly in the scripts. After all, we don’t want to store our private key and passwords in the scripts and thus in the Git repository.

After performing these steps, we should be able to run an iOS build of our app.

My Conclusion

Initially, you have to familiarize yourself with the Azure interface, but within a short time you can acquire the necessary knowledge and create your own build jobs in a very modular way.

Azure is definitely a possible platform if you need the flexibility to quickly set up the most diverse build processes, for example for iOS, Android, Flutter or backends.

Are you using Azure DevOps in your company or in your projects? Let me know in the comments below ;)

--

--