Search code examples
fastlanehockeyapp

How to find out the next buildnumber on Hockeyapp with Fastlane


We use Fastlane for our App build and we want to be able to do a consistent staging build on our CI server or on a local machine.

Since we publish all builds on Hockeyapp we thought about retrieving the highest build number for our app from the Hockeyapp API and then increase this by one.

How do I get access to the build number from Fastlane?


Solution

  • I actually found a way.

    There is a plugin for fastlane for this fastlane-plugin-latest_hockeyapp_version_number

    You can add this plugin with fastlane add_plugin latest_hockeyapp_version_number

    After that you get the latest version number with this call:

    build_number = latest_hockeyapp_version_number(
       api_token: "Your API Token, needs full access for your app on Hockey",
       app_name: "The App Name",
       platform: 'Platform', # iOS, Android, Mac OS, Windows Phone, Custom
       release_type: '0' # 0 = Beta (default), 1 = Store, 2 = Alpha, 3 = Enterprise"
    )