Fastlane ios and gitlab ci - read this

I have spent four weeks on making an automated ios deployment to testflight working.

Heres what I have learned.

Tools and versions

Install rbenv on your runner. Trust me. I got version 1.2.0

Then I installed ruby version 3.2.0 via rbenv.

Then fastlane. This might be interesting according to some issues.

Fastlane version 2.219.0

Get an API Key

Get the appstore connect api key and store it in the gitlab ci secrets.

We will then echo it into key.json.

Gitlab runner

Set the CreateSession to true in the launchsettings of the runner. This is because we need access to the keychain.

Keychain stuff

Keychain is the main problem with all of this. Its such a big problem and hard to understand why something fails.

But to get things as stable as possible we will always create a new keychain. At every run well import our certificates at start.

Lets talk about match.

Match init. Create a match file, setup the git storage with credentials so that it wont fail. Don‘t rely on inputs from the cli.

Match should work without passing credentials to stdin.


Could not download WWDR certificate

This apparently can happen sometimes. Try it again.

Do not rely on the default keychain