The Travis 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
We will demonstrate with our sample iOS project testappio-ios-sample-app to integrate TestApp.io with Travis-CI.
β
fastlane">Configure iOS project for Fastlane
Install Fastlane
The below command works for most cases. If not, please read this - 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.
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.
π‘ Note: Please use the HTTPS Git repository address if you integrate with the Travis CI.
Generate the certificate and provision profile
bundle exec fastlane match adhoc
Following the instruction, it will generate certificates/profiles and store them in the Git repository specified in the previous step.
π‘ Note: Provide a matching password that is used for encrypting the certificates and profiles in the Git repository.
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.
β οΈ Note: Don't choose Automatically manage signing
Configure
MATCH_PASSWORDenvironment parameter in Travis CI
Go to Travis's repository Settings page, add an environment parameter MATCH_PASSWORD as below.
Configure FASTLANE_PASSWORD environment parameter in Travis CI
This is used for login your Apple ID to the Apple Developer's portal.
Configure GITHUB_API_TOKEN environment parameters in Travis CI
Navigate to Tokens to generate a Personal Access Token, and create a GITHUB_API_TOKEN environment parameter in Travis CI.
Using
testappioplugin for Fastlane
bundle exec fastlane add_plugin testappio
Add environment parameters for
testappioFastlane plugin
AddTESTAPPIO_API_TOKENandTESTAPPIO_APP_IDto Travis environment parameters.
Run the pipeline
Finally, create the
lane
Create: ./fastlane/Fastfile and copy the below 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
endMore info on the Fastlane plugin: https://help.testapp.io/fastlane-plugin/#testappio-actions
You may already have your lane in place; copy the upload_to_testappio action and put it into your pipeline after the IPA export.
The Travis pipeline:
Create: .travis.yml file under your project root folder. E.g.
language: swift osx_image: xcode13.3cache: bundler: trueinstall: - bundle install # install fastlane and its dependencies script: - echo "machine github.com login $GITHUB_API_TOKEN" >> ~/.netrc - bundle exec fastlane ios development # run the lane
Commit and push the change to trigger the Travis pipeline.
Android
We will demonstrate with our sample Android project testappio-android-sample to integrate TestApp.io with Travis-CI.
Add Travis environment parameters for ta-cli
a.TESTAPPIO_API_TOKEN
b.TESTAPPIO_APP_ID
Check the configuration for more info
Create .travis.yml file
language: android
jdk: openjdk11
dist: trustyenv:
- release_notes="My release notes here..." git_release_notes=false git_commit_id=false notify=truebefore_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.android/build-cachebefore_script:
- export JAVA_HOME=/usr/lib/jvm/java-8-oracle
- OLDPATH=$PATH
- export PATH=$JAVA_HOME/bin:$PATH
- echo yes | sdkmanager "build-tools;30.0.3"
- echo yes | sdkmanager "platforms;android-31"
- export JAVA_HOME=~/openjdk11
- export PATH=$OLDPATHscript:
- ./gradlew assembleDebug
- 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=$release --apk=./app/build/outputs/apk/debug/app-debug.apk --release_notes=$release_notes --git_release_notes=$git_release_notes --git_commit_id=$git_commit_id --notify=$notify --source="Travis CI"If you already have your Travis pipeline for testing/building your Android app, you could just put the below sections:
... env: - release_notes="My release notes here..." git_release_notes=false git_commit_id=false notify=true ... script: ... - 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=$release --apk=./app/build/outputs/apk/debug/app-debug.apk --release_notes=$release_notes --git_release_notes=$git_release_notes --git_commit_id=$git_commit_id --notify=$notify --source="Travis CI"
Related Setup Guides
Tip: Once your CI/CD pipeline uploads a build, team members using the TestApp.io mobile app receive a push notification and can install the build with a single tap. You can also create share links to distribute builds to external testers and clients.
Need help? Contact us β we're happy to assist!
