Upload the IPA to TestApp.io from Xcode Cloud

This guide provides steps to upload your iOS application's IPA file to TestApp.io using a post-build script in Xcode Cloud.

Prerequisites

Before you begin, ensure you have the following TestApp.io environment variables:

  • TESTAPPIO_APP_ID
  • TESTAPPIO_API_TOKEN

These values can be found in your TestApp.io portal under App -> Integrations -> Releases.

Environment variables for TestApp.io inside Xcode Cloud workflow

TA-CLI Configuration

For detailed information on TA-CLI parameters, refer to the TestApp.io CLI documentation. Adjust the script parameters like --git_release_notes, --git_commit_id, --notify, etc., as required for your setup.

Script Setup

Create a directory named ci_scripts at the root of your project.

Inside ci_scripts, create a file named ci_post_xcodebuild.sh.

Copy and paste the following script into ci_post_xcodebuild.sh:

if [ "$CI_PRODUCT_PLATFORM" = "iOS" ]; then
    echo "Uploading to TestApp.io"

    # Set the install directory
    export INSTALL_DIR=$(pwd)

    # Download and install TestApp.io CLI
    curl -Ls https://github.com/testappio/cli/releases/latest/download/install | bash

    # Make the CLI executable
    chmod +x ${INSTALL_DIR}/ta-cli

    # Find the .ipa file in the specified directory
    IPA_FILE=$(find "$CI_AD_HOC_SIGNED_APP_PATH" -name "*.ipa" -print -quit)

    # Check if an .ipa file was found
    if [ -z "$IPA_FILE" ]; then
        echo "No .ipa file found in $CI_AD_HOC_SIGNED_APP_PATH"
        exit 1
    fi

    # Publish using the found .ipa file
    ${INSTALL_DIR}/ta-cli publish --api_token=$TESTAPPIO_API_TOKEN --app_id=$TESTAPPIO_APP_ID --release="ios" --ipa="$IPA_FILE" --git_release_notes=true --git_commit_id=true --archive_latest_release=false --notify=true --source="Xcode Cloud"
fi

Ensure the script is executable by running chmod +x ci_scripts/ci_post_xcodebuild.sh in your project directory.

Usage

After setting up the script, it will automatically execute in Xcode Cloud's post-build phase for iOS platform builds, uploading the IPA to TestApp.io.

Xcode Cloud post script

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 🎉