Deploying a React Native App with Fastlane - Part 1a

 Auto-Increment build numbers

This is a part of a series of posts about deploying a React Native application with Fastlane.

Since the whole Fastlane and React Native ecosystem is constantly evolving, I’ll try to keep this post up to date to reflect the latest changes. Last Update: 2016/03/30


We’ll use the setup from part 1. If you haven’t read it yet or haven’t set up a Fastlane project, please do so now.

Using the approach above still leaves you incrementing the build or version number manually in Xcode each time you want to deploy your application. This can be done by Fastlane, too.


Fastlane comes with a lot of actions. We’ll need increment_build_number and if you want commit_version_bump for this guide.

increment_build_number will automatically increment the build number in all required Xcode files by one.

commit_version_bump checks that only the relevant files have changed, so it won’t commit anything else by mistake, then creates a new commit.

After adding both actions to our fastlane/Fastfile, it should look like this:

fastlane_version "1.68.0"

default_platform :ios

platform :ios do

  desc "Submit a new Beta Build to Apple TestFlight"
  desc "This will also make sure the profile is up to date"
  lane :beta do
    match(type: "appstore")

      xcodeproj: './ios/AwesomeProject.xcodeproj'

      scheme: "AwesomeProject",
      project: './ios/AwesomeProject.xcodeproj'

      message: "Deployed new build #{lane_context[SharedValues::BUILD_NUMBER]}",
      xcodeproj: './ios/AwesomeProject.xcodeproj'



That’s it! Just make sure you have a clean git status before deploying, else commit_version_bump will fail (as mentioned above).


Now read this

FreeNas Server #1: Die Einzelteile

Here is an english version of this article. Dies ist eine Serie von Beiträgen über den Bau eines eigenen FreeNAS Servers. Teil 1: Die Einzelteile Teil 2: Auspacken Teil 3: Zusammenbau Auf der Suche nach einer ordentlichen Storage Lösung... Continue →