fastlane tools integration

Bitrise is a hosted CI/CD solution where you can run your fastlane lane with the same commands you would use locally. Bitrise’s automated Steps provide extra functionality to your lane and speed up your builds.

Here is how you can benefit from integrating fastlane into Bitrise.

Setting up fastlane on Bitrise

Running fastlane on Bitrise is as simple as adding one Step to your Workflow and setting some options. Let’s see how!

Connect to Apple services

Do not forget to connect to Apple services if you use this Step in your Workflow. You can do so using API key or Apple ID or right through the Fastlane Step’s input fields.

  1. Add the Fastlane Step to your Workflow by clicking the + sign. Make sure it is inserted right after the Git Clone Step. Since fastlane is pre-installed on all Bitrise’s virtual machines, the Fastlane Step ensures that you can always use the required fastlane version.
  2. To code sign your project, you have a couple of options to choose from. Add one of Bitrise’s code signing Steps to your Workflow such as: Certificate and profile installer, iOS Auto Provision, and Fastlane Match. Alternatively, use fastlane match inside your fastlane lane instead of a code signing Step. Make sure you either use the Fastlane Match Step or set up fastlane match in your lane but don’t try to do both.
  3. Click the Fastlane Step to fill out the required fields.
  4. Add your lane in the fastlane lane input.
  5. Use Working directory field if the fastlane directory is not in your repository’s root. The working directory should be the parent directory of your Fastfile’s directory. For example, if the Fastfile path is ./here/is/my/fastlane/Fastfile, then the Fastfile’s directory is ./here/is/my/fastlane, so the Working Directory should be ./here/is/my.
  6. The Should update fastlane gem before run? option will be skipped if you have a Gemfile in the work_dir directory. If you don’t have a Gemfile and this option is enabled, then the Step tries to use and run the latest fastlane version.
  7. Set the Enable verbose logging? to yes if you wish to get more detailed logs on your failed builds.
  8. If the Enable collecting files to be included in build cache is set to yes, the Step adds the following cache items (if they exist):
    • Pods - Podfile.lock
    • Carthage - Cartfile.resolved
    • Android dependencies

That’s it! Start running your build so that Bitrise can run your lane.