Skip to main content

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 in the Sauce Labs Mobile App Distribution Settings page.

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

saucelabs_appdist(
api_key: "your_api_key",
ipa: "./path/to/app.ipa",
comment: "Build #{lane_context[SharedValues::BUILD_NUMBER]}",
)

Parameters

KeyDescriptionDefault
api_keyAPI Key for Sauce Labs Mobile App Distribution
ipaPath to your IPA file (iOS)
apkPath to your APK file (Android)
symbols_fileSymbols mapping file
upload_urlUpload API URL for Sauce Labs Mobile App Distributionhttps://app.testfairy.com
testers_groupsArray of tester groups to be notified[]
commentAdditional release notes for this uploadNo comment provided
auto_updateAuto-upgrade users (on/off)off
notifySend email to testers (on/off)off
optionsArray of options[]
customCustom options string""
timeoutRequest timeout in seconds
tagsCustom tags for builds[]
metricsArray of metrics to record[]
folder_nameDashboard folder name""
landing_page_modeLanding page visibility (open/closed)open
upload_to_saucelabsUpload to Sauce Labs (on/off)off
platformPlatform override""
community_tokenCustom URL token for the landing page""
app_descriptionDescription text to display on the landing page""
note

If your server's security settings require users to login before downloading, you must set landing_page_mode: "closed". Otherwise the upload will fail with error code 156.

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:

KeyDescription
statusUpload status (ok on success)
build_idID of the uploaded build
project_idID of the project
app_nameName of the uploaded app
app_versionVersion of the uploaded app
file_sizeSize of the uploaded file in bytes
build_urlURL for the sessions of the newly uploaded build
download_page_urlURL of the download page
app_urlDirect download URL for the build
invite_testers_urlURL to invite testers to this build
icon_urlURL of the app icon
optionsConfigured options for this build
platformPlatform (iOS/Android)
tagsTags associated with the build
metadataMetadata associated with the build
has_testfairy_sdkWhether the app includes the TestFairy SDK
symbols_download_urlURL to download symbols file (if uploaded)
landing_page_urlURL of the build's landing page
build_specific_landing_page_urlLanding page URL specific to this build
attachmentsAttachments associated with the build
landing_page_modeLanding page visibility (open or closed)
app_descriptionDescription 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.

You can find the plugin on RubyGems and GitHub.