Prepare your iOS App to Azure Pipelines

Dmitriy Toropkin
Mac O’Clock
Published in
4 min readMay 22, 2020
Photo by Gustas Brazaitis on Unsplash

Hello! Today I want to talk about the detailed configuration of automation of work with builds of iOS applications using Azure.

What we can do with Azure Pipelines? Its supports Continuously build, test, and deploy to any platform and cloud.

He has a free tariff, which may be of interest to developers. It include: 1 Microsoft-hosted job with 1,800 minutes per month for CI/CD and 1 self-hosted job with unlimited minutes per month. What does that mean? You can simultaneously perform an operation on one of your projects and there is a 1800 minute limit on all your tasks (including unit test, build, deploy to AppStore).

I will not tell how to register there and create my own project. I will tell you about setting up your project for Azure on the example of his two projects

When you connected your GutHub Project (you can connect private rep too) you must configure your configuration.

First example. Just run tests.

First create config file with name azure-pipelines.yml in the root of your repository

Empty config for Azure

Agent pool

Then you need to select the appropriate agent pool. What it does mean? Because we set this for iOS app it need macOS environment. We can use specific macOS version:

Or we can set latest macOS and it update version auto:

Its support different OS: you can set ubuntu with ubuntu-latest or Windows Server 2019 windows-2019. You can read about this in this link

Triggers:

Triggers its field for trigger your action. You can set various actions on your branches (include or exclude branches). I will not dwell on this topic, you can read about it here if you use GitHub. I personally use trigger on Master and develop branch:

Actions:

As part of the first project, I will tell you how to run tests. Its really simple:

What does it mean? Let’s tallk in more detail

Steps? Its just array of your tasks (action with project).

Actions — enter a space-delimited list of actions. Valid options are build, clean, test, analyze, and archive.

Scheme — valid scheme for your project. You can see this in Xcode

sdk — available sdk for action (like build, test, etc). Now (22 May 2020) available iphoneos, iphonesimulator, macosx, appletvos, appletvsimulator, watchOS, watchsimulator. You can allways check this in your local Mac terminal with xcodebuild -showsdks:

Result of xcodebuild -showsdks command

configuration — the Xcode project or workspace configuration to be built. You can see this in your Xcode project

Configuration of project

xcWorkspacePath — relative path from the root of the repository to the Xcode workspace or project. You can use different Xcode project or workspace and use one main for Azure.

signingOption — method of signing the build. Available options are Do not code sign, Project defaults, manual and auto. Im used auto cause its just framework without sign.

xcodeVersion — its really simple.

Anyway you can read about arguments in this link

Conclusion

And now its auto get your Pull Request from master and develop branches and run test.

Azure logs
GitHub connected to Azure when merge

Initially, I wanted to write about both projects in one article, but it would be too big. In the next article I want to tell how to configure not just project unit tests, but also its build and delivery in the TestFlight. It will be really longread article without burning details from this article (like creating files, pool agent etc).

You can contact with me: ToropkinD@gmail.com

Check our simple log library for collect logs from your user: https://github.com/ESKARIA/AdvancedLogger.git

--

--