Circle CI

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

KeyDescriptionEnv Var(s)Default
api_tokenYou can get it from https://portal.testapp.io/profile/tokensTESTAPPIO_API_TOKEN
app_idYou can get it from your app page at https://portal.testapp.io/appsTESTAPPIO_APP_ID
releaseIt can be either both or Android or iOSTESTAPPIO_RELEASE
apkPath to the Android APK fileTESTAPPIO_ANDROID_PATH
ipaPath to the iOS IPA fileTESTAPPIO_IOS_PATH
release_notesManually add the release notes to be displayed for the testersTESTAPPIO_RELEASE_NOTES
git_release_notesCollect release notes from the latest git commit message to be displayed for the testers: true or falseTESTAPPIO_GIT_RELEASE_NOTEStrue
git_commit_idInclude the last commit ID in the release notes (works with both release notes options): true or falseTESTAPPIO_GIT_COMMIT_IDfalse
notifySend notifications to your team members about this release: true or falseTESTAPPIO_NOTIFYfalse

Check TA-CLI for more info


Setup Circle CI project

Add two project environment variables:

Project SettingsEnvironment VariablesAdd Environment Variable

TESTAPPIO_API_TOKEN=
TESTAPPIO_APP_ID=

These values can be found in App → Integrations → Releases


iOS

Circle CI provides macOS executors for CI/CD pipelines and has Fastlane installed already, which means you don't need to install Fastlane in your pipeline.

Using Fastlane (Build & Upload)

If you haven't yet, set up Fastlane and add the TestApp.io plugin.

Setup Fastlane →

fastlane add_plugin testappio

In Circle CI's config.yml, add bundle install, e.g.

# ...
    steps:
      # ...
      - run: bundle install
      - run: bundle exec fastlane adhoc --verbose
# ...

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".

Circle CI will build your project and upload your IPA file to TestApp.io for distribution.

Without Fastlane

version: 2.1

orbs:
  ios: circleci/ios@1.0.0

jobs:
  build-and-upload-ios:
    macos:
      xcode: "15.4" # Specify the Xcode version you need
    environment:
      release_notes: ""
      git_release_notes: true
      git_commit_id: false
      notify: true
    steps:
      - checkout

      # Build and archive the iOS app
      - run:
          name: Archive iOS app
          command: |
            xcodebuild -workspace YourWorkspace.xcworkspace -scheme YourScheme -sdk iphoneos -configuration Release archive -archivePath build/YourApp.xcarchive

      - run:
          name: Export IPA
          command: |
            xcodebuild -exportArchive -archivePath build/YourApp.xcarchive -exportPath build/ -exportOptionsPlist ExportOptions.plist

      # Upload to TestApp.io
      - 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="ios" --ipa=./build/YourApp.ipa --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-ios

Android

Using Fastlane (Build & Upload)

If you haven't yet, set up Fastlane and add the TestApp.io plugin.

Setup Fastlane →

fastlane add_plugin testappio

In Circle CI's config.yml:

# ...
    steps:
      # ...
      - run: bundle install
      - run: bundle exec fastlane android beta --verbose
# ...

Without Fastlane

Create .circleci/config.yml file under your project directory and copy the below snippet.

version: 2.1

orbs:
  android: circleci/android@1.0.3

jobs:
  build-and-upload:
    executor:
      name: android/android-machine
    environment:
      release_notes: ""
      git_release_notes: true
      git_commit_id: false
      notify: true
    steps:
      - checkout

      # For a debug build:
      - run:
          name: Assemble debug build
          command: |
            ./gradlew assembleDebug

      # For a 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/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.

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!