Deploying an iOS app using Bitrise to the Testflight

Hello everyone, in this blog post I will show you a brief way to start deploying your apps using Bitrise for your IOS apps. We will use the magnificent workflow feature, auto signing, etc.

This is the simple diagram you can follow along:

I think these are the foundational steps to start with your build, you can play with these steps to complete your build. On Bitrise they have the identical names shown on this image so feel free to add them to your build and start playing with them.

My favorite thing about Bitrise is that it is very easy to set up your build, with a few clicks and drops and your build is ready to go!

Summary

So this is what happens when you start your build on Bitrise followed by this workflow provided here:

  1. This Step makes sure Bitrise has access to your repository and is thus able to clone your code to virtual machines. The Step saves the provided private key of your SSH key pair to a file and then loads it into the user’s ssh-agent with ssh-add.
  2. The checkout process depends on the checkout properties: the Step either checks out a repository state defined by a git commit or a git tag or achieves a merged state of a pull/merge request. The Step uses two solutions to achieve the merged state of the pull/merge request: auto-merge in the case of a merged branch or diff file (provided by the Git service) and manual merge otherwise. Once the desired state is checked out, the Step optionally updates the submodules. In the case of pull/merge requests, the Step checks out a detach head and exports the achieved git state properties.
  3. This step will use the pod install or pod update command to install required Cocoapods.
  4. This step downloads and installs the Apple Code signing certificates and provisioning profiles.
  5. This step automatically manages your IOS provisioning profile for your Xcode project.
  6. This step will automatically manage your code signing assets, archives, and export a .ipa file in one step.
  7. This step will upload binaries (.ipa / .pkg files) to App Store Connect.
  8. This step will send Microsoft teams messages to the channel.

Step 1 – Creating the Apple service connection

Go to your personal setting on Bitrise and connect your apple service connection. In order to do that go to the Appstore > Users and Access > Keys and create an API key.

After setting up the Apple service connection time to tell Bitrise to use that connection for code signing purposes. Go to your Apps and select the current App, after that go to the Teams section and select your newly created API connection. You can test the connection here just to be sure.

Bitrise has an auto code-signing capability, so we don’t have to do the signing process manually.

Go to the Bitrise > Workflow Editor > Code Signing. You can add your provision profiles and matching certificates to that field, and in your workflow, you can use the “Certificate and profile installer” step to install them to your Bitrise Docker machine.

it will check your AppStore for the needed provision profiles and certificates and automatically match them for your deployment. Also, you can add multiple workflows, so this way you can create a workflow for app-store deployment and another one for development usage.

Step 2 – Creating the Pipeline

You can follow this image to create your pipeline. There are numerous steps to add to your pipeline on Bitrise, you don’t have to manually create these steps since they are already written.

Feel free to add or remove any steps to complete your pipeline. Every step has its own setup requirements.


Step 3 – Triggering the Pipeline

Go to your App > Workflow > Triggers section and you will see 3 different sections.

Push section is for defining your branches so whenever there is a new push on the given branch the pipeline will work, the same goes for the pr. But in order to make tagging section work, you should add tagging to your git push command and that tag has to be on the remote repository of the current git repo. You can follow this link to understand that mechanism better. “https://devcenter.bitrise.io/en/builds/starting-builds/triggering-builds-automatically.html#triggering-builds-with-git-tags


Referances