Circle CI pipeline allows you to build and upload both Android & iOS apps to TestApp.io to notify your testers for testing and feedback.
Configuration
Key | Description | Env Var(s) | Default |
---|---|---|---|
api_token | You can get it from https://portal.testapp.io/settings/api-credentials | TESTAPPIO_API_TOKEN | |
app_id | You can get it from your app page at https://portal.testapp.io/apps | TESTAPPIO_APP_ID | |
release | It can be either both or Android or iOS | TESTAPPIO_RELEASE | |
apk | Path to the Android APK file | TESTAPPIO_ANDROID_PATH | |
ipa | Path to the iOS IPA file | TESTAPPIO_IOS_PATH | |
release_notes | Manually add the release notes to be displayed for the testers | TESTAPPIO_RELEASE_NOTES | |
git_release_notes | Collect release notes from the latest git commit message to be displayed for the testers: true or false | TESTAPPIO_GIT_RELEASE_NOTES | true |
git_commit_id | Include the last commit ID in the release notes (works with both release notes options): true or false | TESTAPPIO_GIT_COMMIT_ID | false |
notify | Send notifications to your team members about this release: true or false | TESTAPPIO_NOTIFY | false |
Check TA-CLI for more info
iOS
Circle CI provides macOS executors to CI/CD pipeline, and it has Fastlane installed already, which means we don't need to install Fastlane in our pipeline.
We will use the testappio-ios-sample-app project to demonstrate how to use our ta-cli
tool to upload your IPA file to TestApp.io
Setup Circle CI project
Setup two project environment variables as below.
Project Settings->Environment Variables->Add Environment Variable
TESTAPPIO_API_TOKEN=
TESTAPPIO_APP_ID=
Check the configuration for more info
Configure iOS project for Fastlane
- Install Fastlane
The below command works for most cases, however, if not, please see Setup Fastlane
bundle install fastlane
- Init Fastlane
In the iOS project folder
bundle exec fastlane init
And follow the wizard, it will create ./fastlane/Appfile
with your Apple ID and team etc.
- Init
Match
Fastlane match is a tool for generating all necessary certificates and provisioning profiles and storing them in a Git repository encrypted.
Create a private empty Github repository for storing certificates and provisioning profiles.
bundle exec fastlane match init
Follow the instruction, give the new empty Git repository when asked, and it will create the Matchfile
- Generate the certificate and provision profile
bundle exec fastlane match adhoc
You can use adhoc, development, and enterprise
Following the instruction, it will generate certificates/profiles and store them in the Git repository specified in the previous step.
- Select provisioning profiles in Xcode
The newly created certificates and profiles should now be possible to select inside our project.
Open up Xcode and go to Signing & Capabilities.
- Using
testappio
plugin for Fastlane
In our project folder:
bundle exec fastlane add_plugin testappio
- Upload IPA file to TestApp.io
Add an action, upload_to_testappio the lane looks like below:
# fastlane/fastfile
default_platform :ios
platform :ios do
before_all do
setup_circle_ci
end
...
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...", #TESTAPPIO_RELEASE_NOTES
git_release_notes: true, #TESTAPPIO_GIT_RELEASE_NOTES
git_commit_id: false, #TESTAPPIO_GIT_COMMIT_ID
notify: true #TESTAPPIO_NOTIFY
)
end
end
More info for Fastlane plugin: https://help.testapp.io/fastlane-plugin/#testappio-actions
- Add one step in the pipeline to install the plugin
In Circle CI'sconfig.yml
, addbundle install
, e.g.
# ...
adhoc:
macos:
xcode: 12.5.1
steps:
# ...
- run: bundle install
- run: bundle exec fastlane adhoc
# ...
-
Make sure that the codesign is configured to "manual" or the
gym
step of the Circle CI pipeline would fail with the error "no provisioning profile found" -
Push all the changes to the Git repository
Circle CI will build your project and upload your IPA file to TestApp.io for distribution 🎉
Android Project
We will use the testappio-android-sample project to demonstrate how to use our ta-cli
tool to upload your APK file to TestApp.io
Setup Circle CI project
Setup two project environment variables as below.
Project Settings->Environment Variables->Add Environment Variable
TESTAPPIO_API_TOKEN=
TESTAPPIO_APP_ID=
Check the configuration for more info
Create the Circle CI pipeline
Create .circleci/config.yml
file under to project directory and copy the below snippet.
version: 2.1
orbs:
android: circleci/[email protected]
jobs:
build-and-upload:
executor:
name: android/android-machine
environment: #You can change the following
release_notes: "My release notes here..."
git_release_notes: false
git_commit_id: false
notify: true
steps:
# Checkout the code as the first step.
- checkout
# And next run the debug build
- run:
name: Assemble debug build
command: |
./gradlew assembleDebug
- run:
name: upload to TestApp.io
command: |
export INSTALL_DIR=/tmp
curl -Ls https://github.com/testappio/cli/releases/latest/download/install | bash
$INSTALL_DIR/ta-cli publish --api_token=$TESTAPPIO_API_TOKEN --app_id=$TESTAPPIO_APP_ID --release="android" --apk=./app/build/outputs/apk/debug/app-debug.apk --release_notes=$release_notes --notify=$notify --git_release_notes=$git_release_notes --git_commit_id=$git_commit_id --source="Circle CI"
workflows:
default:
jobs:
- build-and-upload
If you already have the .circleci/config.yml
file, you could copy the build-and-upload
job to your pipeline.
If you want to choose the release
version job:
# And next run the release build
- run:
name: Assemble release build
command: |
./gradlew assembleRelease
- run:
name: upload to TestApp.io
command: |
export INSTALL_DIR=/tmp
curl -Ls https://github.com/testappio/cli/releases/latest/download/install | bash
$INSTALL_DIR/ta-cli publish --api_token=$TESTAPPIO_API_TOKEN --app_id=$TESTAPPIO_APP_ID --release="android" --apk=./app/build/outputs/apk/release/app-release.apk --release_notes=$release_notes --notify=$notify --git_release_notes=$git_release_notes --git_commit_id=$git_commit_id --source="Circle CI"
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 🎉