Skip to main content

TeamCity

To automatically deply your Android or iOS Apps to Sauce Labs Mobile App Distribution by using TeamCity, follow the steps below:

  1. In Sauce Labs Mobile App Distribution, click the Profile icon in the top-right corner and select My Profile.

    User menu with My Profile highlighted
  2. On the My Profile page, go to the API Key section and click the copy icon to copy the API key. You can also copy it from API Credentials in the top navigation bar.

    API Key section on the My Profile page
  3. In TeamCity, add an environment variable as a New Parameter into the Build Configuration.

    build configuration
  4. Name the parameter env.TESTFAIRY_API_KEY and give it the value you copied from the Sauce Labs Mobile App Distribution My Profile page, and Save.

     add environment variable
  5. Add a Build Step to the Build Configuration you wish to deploy from.

    add build step
  6. Make sure to select a Command Line build step.

    command line build step

    Copy the following command into the Custom script text field:

    curl https://app.testfairy.com/api/upload -F api_key=${env.TESTFAIRY_API_KEY} -F comment="TeamCity build" -F file=@android.apk
    note

    Replace the -F file=@android.apk argument with a path to your own APK or IPA.

For a complete list of available options, visit the Sauce Labs Mobile App Distribution Upload API documentation.