Fastlane
Upload a new build to Sauce Labs Mobile App Distribution using Fastlane and the fastlane-plugin-saucelabs_appdist plugin. You can find your API key under API Credentials in the top navigation bar, or in the API Key section of My Profile. See API Keys.
Installation
fastlane add_plugin saucelabs_appdist
Or add the plugin manually to your project's fastlane/Pluginfile:
gem 'fastlane-plugin-saucelabs_appdist'
Then run bundle install to fetch it.
Usage
- iOS
- Android
saucelabs_appdist(
api_key: "your_api_key",
ipa: "./path/to/app.ipa",
comment: "Build #{lane_context[SharedValues::BUILD_NUMBER]}",
)
saucelabs_appdist(
api_key: "your_api_key",
apk: "../build/app/outputs/apk/qa/release/app-qa-release.apk",
comment: "Build #{lane_context[SharedValues::BUILD_NUMBER]}",
)
Parameters
| Key | Description | Default |
|---|---|---|
api_key | API Key for Sauce Labs Mobile App Distribution | |
ipa | Path to your IPA file (iOS) | |
apk | Path to your APK file (Android) | |
symbols_file | Symbols mapping file | |
upload_url | Upload API URL for Sauce Labs Mobile App Distribution | https://app.testfairy.com |
testers_groups | Accepted for compatibility; ignored by Mobile App Distribution | [] |
comment | Additional release notes for this upload | No comment provided |
auto_update | Accepted for compatibility; ignored by Mobile App Distribution | off |
notify | Send email to testers (on/off) | off |
options | Accepted for compatibility; ignored by Mobile App Distribution | [] |
custom | Accepted for compatibility; ignored by Mobile App Distribution | "" |
timeout | Request timeout in seconds | |
tags | Custom tags for builds | [] |
metrics | Accepted for compatibility; ignored by Mobile App Distribution | [] |
folder_name | Dashboard folder name | "" |
landing_page_mode | Landing page visibility (open/closed) | open |
upload_to_saucelabs | Upload to Sauce Labs (on/off) | off |
platform | Platform override | "" |
community_token | Custom URL token for the landing page | "" |
app_description | Accepted for compatibility; ignored by Mobile App Distribution | "" |
If your server's security settings require users to log in before downloading, the landing page is always closed at install time, regardless of landing_page_mode. The upload itself does not fail. landing_page_mode only accepts open or closed; any other value fails the upload with error code 135.
Lane Variables
The saucelabs_appdist action stores the full API response in lane_context, which can be accessed in subsequent actions or lanes:
lane_context[SharedValues::SAUCELABS_APPDIST_UPLOAD_RESPONSE]
The response is a hash containing all fields from the upload API, including:
| Key | Description |
|---|---|
status | Upload status (ok on success) |
build_id | ID of the uploaded build |
project_id | ID of the project |
app_name | Name of the uploaded app |
app_version | Version of the uploaded app |
file_size | Size of the uploaded file in bytes |
build_url | URL of the project page in the dashboard |
download_page_url | URL of the download page |
app_url | Direct download URL for the build |
invite_testers_url | URL to invite testers to this build |
icon_url | URL of the app icon |
options | Always ''; present for compatibility only |
platform | Platform (iOS/Android) |
tags | Tags associated with the build |
metadata | Metadata associated with the build |
has_testfairy_sdk | Always false; present for compatibility only |
symbols_download_url | URL to download symbols file (if uploaded) |
landing_page_url | URL of the build's landing page |
build_specific_landing_page_url | Landing page URL specific to this build |
attachments | Always null; present for compatibility only |
landing_page_mode | Landing page visibility (open or closed) |
app_description | Description text displayed on the landing page |
Example:
response = lane_context[SharedValues::SAUCELABS_APPDIST_UPLOAD_RESPONSE]
puts response['build_url']
puts response['app_url']
puts response['landing_page_url']
Documentation
To show the documentation in your terminal, run
fastlane action saucelabs_appdist
CLI
It is recommended to add the above action into your Fastfile, however sometimes you might want to run one-offs. To do so, you can run the following command from your terminal
fastlane run saucelabs_appdist
To pass parameters, make use of the : symbol, for example
fastlane run saucelabs_appdist api_key:"your_key" ipa:"./app.ipa"
It's important to note that the CLI supports primitive types like integers, floats, booleans, and strings. Arrays can be passed as a comma delimited string (e.g. param:"1,2,3"). Hashes are not currently supported.
It is recommended to add all fastlane actions you use to your Fastfile.