Skip to content

Fastlane

Fastlane is a popular tool for automating the build and release process for iOS and Android apps. Patchwing can be integrated with fastlane to automate releasing and patching.

Follow the setup instructions on the fastlane website to install fastlane (ios, android).

This section assumes that you are using fastlane on CI to release your app. If you are running fastlane locally (on your development machine), you can skip to the Using fastlane locally.

A working example of this setup can be found in our fastlane_demo repository.

To get started, follow this guide to set up fastlane with certificate management, code signing, and submitting to the App Store/TestFlight.

You will notice that our demo app’s Fastfile has both deploy and release_patchwing lanes. The deploy lane comes from the guide linked to above. The release_patchwing lane is our custom lane that uses the patchwing_release action in place of build_app to build an ipa, create a Patchwing release, and submit it to the App Store/TestFlight.

Note that this change from build_app to release_patchwing is the only change needed to add Patchwing to your fastlane workflow.

To patch your app, you can use the patchwing_patch action. You can see an example of this in the patch_patchwing lane in the Fastfile.

Follow this section if you have patchwing installed on the machine that will be running fastlane. This section assumes that you have patchwing installed on the machine that will be running the fastlane commands. If you have not already installed patchwing, you can do so by following the Getting Started instructions.

If you are not already using fastlane with your project, navigate to your app’s ios directory in your project and run fastlane init. You will be prompted to answer several questions. For this guide, we will choose to manually add lanes to the Fastfile.

Run the following command to install the patchwing fastlane plugin, which exposes the patchwing_release and patchwing_patch actions.

bundle exec fastlane add_plugin patchwing

Open the Fastfile in the fastlane directory and add the following lane:

lane :release_patchwing do
  patchwing_release(platform: "ios")
  upload_to_testflight
end

To run this, execute the following command:

bundle exec fastlane release_patchwing

If you would like to provide additional arguments to the release command, you can do so using the args parameter. For example:

patchwing_release(platform: "ios", args: "--no-codesign -- --build-name=1.0.0")

Open the Fastfile in the fastlane directory and add the following lane:

lane :patch_patchwing do
  patchwing_patch(platform: "ios")
end

This will patch the iOS release with the version number detected in the compiled app and patch the release with that version.

As with patchwing_release, you can provide additional arguments to the patch command using the args parameter.

patchwing_patch(platform: "ios", args: "--allow-native-diffs -- --build-name=1.0.0")