Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# Customise this file, documentation can be found here:
# All available actions:
# can also be listed using the `fastlane actions` command
# Change the syntax highlighting to Ruby
# All lines starting with a # are ignored when running `fastlane`
# If you want to automatically update fastlane if a new version is available:
# update_fastlane
# This is the minimum version number required.
# Update this, if you use features of a newer version
fastlane_version "1.106.2"
default_platform :ios
# Note: this fastfile assumes the ios build is generated in the following folder: `./builds/ios/`
platform :ios do
before_all do
# set SLACK_URL from environment variable directly instead ;)
# ENV["SLACK_URL"] = ""
# Here's a way to set `ITSAppUsesNonExemptEncryption` from command line using `PlistBuddy`
# There's probably a way to do this in unity as well (or it's already done in latest unity versions?)
sh 'cd .. && /usr/libexec/PlistBuddy -c "Add :ITSAppUsesNonExemptEncryption bool false" builds/ios/Info.plist || true'
sh 'cd .. && /usr/libexec/PlistBuddy -c "Set :ITSAppUsesNonExemptEncryption bool false" builds/ios/Info.plist'
sh 'cd .. && /usr/libexec/PlistBuddy -c "Add :NSCameraUsageDescription string unused" builds/ios/Info.plist || true'
sh 'cd .. && /usr/libexec/PlistBuddy -c "Set :NSCameraUsageDescription string unused" builds/ios/Info.plist'
desc "Runs all the tests"
lane :test do
# TODO: run unity tests? That would be awesome
desc "Increments build number based on latest testflight build using Appfile app_identifier"
lane :increment do
xcodeproj: 'build/ios/Unity-iPhone.xcodeproj',
build_number: latest_testflight_build_number(
app_identifier: CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
) + 1
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") # more information:
# passing workspace parameter as unity generates its ios build in a different folder
scheme: "Unity-iPhone",
workspace: 'builds/ios/Unity-iPhone.xcworkspace',
# sh ""
# You can also use other beta testing services here (run `fastlane actions`)
desc "Deploy a new version to the App Store"
lane :release do
# match(type: "appstore")
# snapshot
# passing workspace parameter as unity generates its ios build in a different folder
scheme: "Unity-iPhone",
workspace: 'builds/ios/Unity-iPhone.xcworkspace',
# will release the game, watchout!
deliver(force: true)
after_all do |lane|
# This block is called, only if the executed lane was successful
message: "Successfully executed."
error do |lane, exception|
# slack(
# message: exception.message,
# success: false
# )
# More information about multiple platforms in fastlane:
# All available actions:
# fastlane reports which actions are used
# No personal data is recorded. Learn more at
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment