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.
Installation
Section titled “Installation”Follow the setup instructions on the fastlane website to install fastlane (ios, android).
Using fastlane on CI
Section titled “Using fastlane on CI”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.
Patching
Section titled “Patching”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.
Using fastlane locally
Section titled “Using fastlane locally”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.
Use the Patchwing plugin
Section titled “Use the Patchwing plugin”Run the following command to install the patchwing fastlane plugin, which
exposes the patchwing_release and patchwing_patch actions.
Update Fastfile to release
Section titled “Update Fastfile to release”Open the Fastfile in the fastlane directory and add the following lane:
To run this, execute the following command:
If you would like to provide additional arguments to the release command, you
can do so using the args parameter. For example:
Update Fastfile to patch
Section titled “Update Fastfile to patch”Open the Fastfile in the fastlane directory and add the following lane:
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.