Basic Bitrise builds automation for iOS applications
Posted November 2, 2021 by ‐ 4 min read

Automated Builds
There are always point in the project when you seem to solve all architectural problems and are ready to improve your automation. In my project, this moment caught me at the stage when we all work remotely from our homes.
Previously we have dedicated “mac mini” for this prepuce. On this machine, we compile the new builds and upload them to TestFlight. We use Fastlane and Jenkins for this.
The main issue of such an approach is this machine always must be turned on and have all necessary certificates and provision profiles. Also, it took too much time to compile and upload. But the most issue is that sometimes it has to be rebooted manually. When we all work from the office it was not an issue, but right now it is huge problem. That’s why we stopped using this kind of automation and I pushed all new builds myself.
Why it is a problem to create builds and send them to TestFlight manually? Because during the working day I can provide up to 5 new builds for QA and especially on release days. And these builds with upload may take about 15-20 minutes each. And during this time I’m not able to continue my work on current tasks. And this is huge when you need to focus on urgent tasks, every hour is precious. With Bitrise you can push new changes and go to the next task without further ado.
In this quick tutorial, I will guide you through all steps for automation builds uploading to TestFlight for iOS applications. So let’s get started!
First of all, you need to register the account on bitrise.io. It is a pretty straightforward process so I believe you will have no issues with this.
After this Bitrise will propose you add your first application and will guide you through this process.

After you successfully create your app, you need to go to “Dashboard” -> “Workflow” and add some components. The main idea is to include such components with will increment “CFBundleVersion” in your “plist” file, create build and upload this build to “TestFlight”. All other necessary components are already inside the workflow so you need to add only those.
Implement Build number
Let’s go step by step and add the “Set Xcode Plist Value” component so we can automatically increment “CFBundleVersion”. Make sure you add this component after “Run CocoaPods install”.

To set up this component properly you need to fill in these variables:
- info.plist file path: “$BITRISE_SOURCE_DIR/[YourProjectName]/Info.plist”
- Plist key: “CFBundleVersion”
- Plist value: “$BITRISE_BUILD_NUMBER”
“$BITRISE_BUILD_NUMBER” you can setup in “Settings” section, just update “YOUR NEXT BUILD NUMBER WILL BE” with right number for you.
Create Xcode Archive
The next component in your workflow must be “Xcode Archive & Export for iOS”.

All you need to do is make sure you set up the “Select method for export” to the “app-store” option.
Deploy to TestFlight

Finally, you need to add the “Deploy to iTunes Connect - Application Loader” component. This component will upload your build to TestFlight.
To set up this component properly you need to fill in these variables:
- Bitrise Apple Developer Connection = “automatic”
- Apple ID: Email = [Your apple ID Email]
- Apple ID: Password = [Your apple ID Password]
- Apple ID: Application-specific password = [Your Application-specific password]
“Application-specific password” you can create using this link https://appleid.apple.com/>.
For this prepuce, you will probably should create a separate user account with a specific role. After all, you should get a Workflow structure like this:

Code Signing
Also, for successfully uploading your application archive to the TestFlight you need to set up “Code Signing” inside the “Workflow Editor” tab. You need to upload “PROVISIONING PROFILE” files and “CODE SIGNING CERTIFICATES ” for them. To make work archive uploading you should create an “app-store” Provisioning profile as well.
Successful Build
If you do all these steps properly and you have no issues during the workflow, you can expect a successful build each time you need it. Bitrise also provides you the ability to create builds automatically on pushing to the repository or by using a slack bot, so you can set up your CD more precisely for your needs.

If you need some specific components for your application you should check the Bitrise documentation page or try to connect to support if you have no success on your own.

Thanks for reading
Hope this small article will be helpful and you save your time implementing this basic automation for your project.
At Vysher, we use Bitrise as part of the Mobile development flow.
If you are interested in developing a project on iOS, you can write to andrey.vysher@gmail.com