Skip to content
Fastlane Plugin - Use AppCenter API to get the latest version and build number for an App Center app
Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci initial commit Sep 4, 2019
.github/workflows allow access to env secrets Sep 29, 2019
fastlane Add specs (#3) Sep 11, 2019
lib/fastlane/plugin Add owner name validation (#4) Sep 29, 2019
spec Add owner name validation (#4) Sep 29, 2019
.gitignore
.rspec
.rubocop.yml initial commit Sep 4, 2019
.travis.yml
Gemfile Add specs (#3) Sep 11, 2019
LICENSE initial commit Sep 4, 2019
README.md adding option to specify less Sep 5, 2019
Rakefile initial commit Sep 4, 2019
fastlane-plugin-latest_appcenter_build_number.gemspec initial commit Sep 4, 2019

README.md

latest_appcenter_build_number plugin

fastlane Plugin Badge Gem Version

Getting Started

This project is a fastlane plugin. To get started with fastlane-plugin-latest_appcenter_build_number, add it to your project by running:

fastlane add_plugin latest_appcenter_build_number

About latest_appcenter_build_number

Use AppCenter API to get the latest version and build number for an App Center app

Example

You can fetch the latest version for a given app with the following command in your Fastfile:

version_number = latest_appcenter_build_number

this will use the environment variable APPCENTER_API_TOKEN to fetch the list of apps for a given owner account, and then prompt you for which one to use. This can also be specified as a parameter, e.g.:

version_number = latest_appcenter_build_number(api_token: "my-APPCENTER-api-token")

The parameters owner_name and app_name, or environment variables APPCENTER_OWNER_NAME, and APPCENTER_APP_NAME, can also be set:

version_number = latest_appcenter_build_number(
  api_token: "my-APPCENTER-api-token", # note that this will need to be generated from here: https://appcenter.ms/settings/apitokens
  owner_name: "owner-name",
  app_name: "My-Awesome-App"
)

You can then use version_number for whatever purpose you required, including updating the shortVersion or buildNumber of your Xcode project.

Replacing latest_hockey_build_number

If you're using this as a direct replacement for the old latest_hockey_build_number having migrated your apps to AppCenter, you should change instances of this:

latest_hockey_build_number(api_token: "my-HOCKEY-api-token", bundle_id: "com.example.my-awesome-app")

to this:

latest_appcenter_build_number(
  api_token: "my-APPCENTER-api-token", # note that this will need to be generated from here: https://appcenter.ms/settings/apitokens
  owner_name: "owner-name",
  app_name: "My-Awesome-App"
)

To find out your app_name correctly, head to https://appcenter.ms/apps?os=All. Your app_name will most likely be what's listed under the 'Name' column but with hyphens instead of whitespace.

To find out your owner_name correctly, head to https://appcenter.ms/settings/profile. Your owner_name will most likely be what's listed under the 'username' field.

Run tests for this plugin

To run both the tests, and code style validation, run

rake

To automatically fix many of the styling issues, use

rubocop -a

Issues and Feedback

For any other issues and feedback about this plugin, please submit it to this repository.

Troubleshooting

If you have trouble using plugins, check out the Plugins Troubleshooting guide.

Using fastlane Plugins

For more information about how the fastlane plugin system works, check out the Plugins documentation.

About fastlane

fastlane is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out fastlane.tools.

You can’t perform that action at this time.