latest_testflight_build_number

Fetches most recent build number from TestFlight

Provides a way to have increment_build_number be based on the latest build you uploaded to iTC.
Fetches the most recent build number from TestFlight based on the version number. Provides a way to have increment_build_number be based on the latest build you uploaded to iTC.

latest_testflight_build_number
Supported platforms ios, mac
Author @daveanderson
Returns Integer representation of the latest build number uploaded to TestFlight

2 Examples

latest_testflight_build_number(version: "1.3")
increment_build_number({
  build_number: latest_testflight_build_number + 1
})

Parameters

Key Description Default
api_key_path Path to your App Store Connect API Key JSON file (https://docs.fastlane.tools/app-store-connect-api/#using-fastlane-api-key-json-file)
api_key Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#using-fastlane-api-key-hash-option)
live Query the live version (ready-for-sale) false
app_identifier The bundle identifier of your app *
username Your Apple ID Username *
version The version number whose latest build number we want
platform The platform to use (optional) ios
initial_build_number sets the build number to given value if no build is in current train 1
team_id The ID of your App Store Connect team if you're in multiple teams *
team_name The name of your App Store Connect team if you're in multiple teams *

* = default value is dependent on the user's system


Lane Variables

Actions can communicate with each other using a shared hash lane_context, that can be accessed in other actions, plugins or your lanes: lane_context[SharedValues:XYZ]. The latest_testflight_build_number action generates the following Lane Variables:

SharedValue Description
SharedValues::LATEST_TESTFLIGHT_BUILD_NUMBER The latest build number of the latest version of the app uploaded to TestFlight
SharedValues::LATEST_TESTFLIGHT_VERSION The version of the latest build number

To get more information check the Lanes documentation.


Documentation

To show the documentation in your terminal, run

fastlane action latest_testflight_build_number

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 latest_testflight_build_number

To pass parameters, make use of the : symbol, for example

fastlane run latest_testflight_build_number parameter1:"value1" parameter2:"value2"

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.


Source code

This action, just like the rest of fastlane, is fully open source, view the source code on GitHub


Back to actions