Bitrise CI pipeline allows you to build and upload both Android & iOS apps to TestApp.io to notify your testers for testing and feedback.
iOS
We will demonstrate with our sample project testappio-ios-sample-app to integrate TestApp.io with Bitrise CI.
1. Clone the project repository and checkout the integration-bitrise branch:
git clone https://github.com/testappio/ios-sample-app.git
git checkout integration-bitrise
2. Configure the iOS project for Fastlane:
- Install Fastlane.
- Create a
./Gemfile
file in the root directory of your project with the following content:
source "https://rubygems.org"
gem "fastlane"
- Run
bundle update
and add both the./Gemfile
and the./Gemfile.lock
files to version control. - Initiate Fastlane by running the following command in the iOS project folder:
bundle exec fastlane init
- Follow the wizard; it will create a
./fastlane/Appfile
file with your Apple ID and team. - Initiate Match by running the following command:
bundle exec fastlane match init
- Follow the instructions and provide the new empty git repository when asked; it will create the Matchfile.
Generate the certificate and provisioning profile by running the following command:
bundle exec fastlane match adhoc
- Provide a matching password for encrypting the certificates and profiles in the GIT repository.
- Add the
testappio
plugin for Fastlane by running the following command:
bundle exec fastlane add_plugin testappio
3. Select provisioning profiles in Xcode:
The newly created certificates and profiles should now be possible to select inside your project. Open Xcode and go to Signing & Capabilities
.
4. Setup Bitrise:
- Configure
MATCH_PASSWORD
the secret parameter in Bitrise. - Go to your Bitrise project page, then Workflow, and add a Secret parameter
MATCH_PASSWORD
. - Configure
GITHUB_API_TOKEN
secret parameter in Bitrise CI. - Navigate to Tokens to generate a Personal Access Token, and create a
GITHUB_API_TOKEN
secret in Bitrise CI. This is for accessing the private certificates' repository. - Add secret parameters for
testappio
Fastlane plugin. - Add
TESTAPPIO_API_TOKEN
andTESTAPPIO_APP_ID
to Bitrise secret parameters. You can grab them from your App -> Integrations.
5. Run the pipeline:
Create the lane by creating ./fastlane/Fastfile
with the following content:
default_platform(:ios)
platform :ios do
desc "Build the adhoc and upload to TestApp.io"
lane :beta do
match(type: "adhoc")
gym(export_method: "ad-hoc")
upload_to_testappio(
release_notes: "My release notes here...",
git_release_notes: true,
git_commit_id: false,
notify: true
)
end
end
More info on the Fastlane plugin: https://help.testapp.io/fastlane-plugin/#testappio-actions
have your lane in place; copy the upload_to_testappio
action and put it into your pipeline after the IPA export.
6. The Bitrise pipeline:
Create or update bitrise.yml
a file under your project root folder. Or update your bitrise.yml
accordingly, if you have the bitrise.yml
file stored and managed on bitrise.io.
---
format_version: '11'
default_step_lib_source: 'https://github.com/bitrise-io/bitrise-steplib.git'
project_type: ios
app:
envs:
- FASTLANE_XCODE_LIST_TIMEOUT: '120'
- opts:
is_expand: false
FASTLANE_WORK_DIR: .
- opts:
is_expand: false
FASTLANE_LANE: ios development
- opts:
is_expand: false
TESTAPPIO_NOTIFY: 'true'
- opts:
is_expand: false
MATCH_SKIP_CERTIFICATE_MATCHING: 'true'
workflows:
primary:
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6: {}
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
# write your script here
echo "machine github.com login $GITHUB_API_TOKEN" >> ~/.netrc
- fastlane@3:
inputs:
- lane: $FASTLANE_LANE
- work_dir: $FASTLANE_WORK_DIR
meta:
bitrise.io:
stack: osx-xcode-13.2.x
machine_type_id: g2.4core
trigger_map:
- push_branch: main
workflow: primary
7. Commit and push the change to trigger the Bitrise pipeline.
Android
Sample project we used for following instructions, android-sample-app
.
1. Clone the project repository and checkout the integration-bitrise branch:
git clone https://github.com/testappio/android-sample-app.git
git checkout integration-bitrise
2. Configure the Android project for Fastlane:
- Install Fastlane.
- Create a
./Gemfile
file in the root directory of your project with the following content:
source "https://rubygems.org"
gem "fastlane"
- Run
bundle update
and add both the./Gemfile
and the./Gemfile.lock
to version control. - For more details please see Setup Fastlane.
3. Init Fastlane:
In the Android project folder, run:
bundle exec fastlane init
And follow the wizard; it will create ./fastlane/Appfile
with the required information.
4. Setup Bitrise:
- Add secret parameters for
testappio
Fastlane plugin. - Add
TESTAPPIO_API_TOKEN
andTESTAPPIO_APP_ID
to Bitrise secret parameters. You can grab them from your App -> Integrations.
5. Run the pipeline:
Create or update bitrise.yml
file under your project root folder. Or update your bitrise.yml
accordingly, if you have the bitrise.yml
file stored and managed on bitrise.io.
---
format_version: '11'
default_step_lib_source: 'https://github.com/bitrise-io/bitrise-steplib.git'
project_type: android
app:
envs:
- FASTLANE_XCODE_LIST_TIMEOUT: '120'
- opts:
is_expand: false
FASTLANE_WORK_DIR: .
- opts:
is_expand: false
FASTLANE_LANE: android beta
workflows:
primary:
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@6: {}
- fastlane@3:
inputs:
- lane: $FASTLANE_LANE
- work_dir: $FASTLANE_WORK_DIR
meta:
bitrise.io:
stack: linux-docker-android-20.04
machine_type_id: elite
trigger_map:
- push_branch: main
workflow: primary
6. Commit and push the change to trigger the Bitrise pipeline.
Feedback & Support
Developers built TestApp.io to solve the pain of app distribution for mobile app development teams.
Join our community for feedback and support.
Happy releasing 🎉