Customize Fastlane configurations for iOS builds
Configure Fastlane settings for iOS builds to control build behavior.
Read time 2 minutesLast updated 16 hours ago
Build Automation relies on Fastlane for building Xcode projects. This document describes how to modify the behavior of Fastlane using the Fastlane file format known as a Gymfile. All of the configuration options are very specific to Fastlane, so some basic familiarity with the toolset is recommended. This section uses a basic example of how you might configure your project to build with multiple profiles currently. The following example assumes you are building an app with an application identifier of
"com.unity3d.buildautomation.base""com.unity3d.buildautomation.base.stickers"Add required files
This setup currently requires adding three extra files to your repository:File #1: A JSON options file that controls the paths to your custom Fastfile/Gymfile and which lanes in the Fastfile should be run
This file can be placed anywhere in the repository but is placed atAssets/ucb_xcode_fastlane.json"Assets/ucb_xcode_fastlane.json"(JavaScript) { "fastfile": "Assets/ucb/Fastfile", "gymfile": "Assets/ucb/Gymfile", "lanes": { "pre_build": "use_stickers_profile", "post_build": "" } }
File #2: A custom Fastfile to install the provisioning profile and update the provisioning settings in the Xcode project
This file can be placed anywhere in the repository, but it needs to match the path of the “fastfile” specified inucb_xcode_fastlane.jsonAssets/ucb/Fastfile(Ruby) lane :use_stickers_profile do |options| profile_path = File.join(options[:project_dir], 'Assets/ucb/Stickers.mobileprovision') FastlaneCore::ProvisioningProfile.install(profile_path) update_project_provisioning( xcodeproj: 'Unity-iPhone.xcodeproj', target_filter: 'Unity-iPhone-Stickers', profile: profile_path ) end
File #3: A custom Gymfile to define the application identifier to provisioning profile mapping as part of customizing the export options
This file can be placed wherever you want in the repo, but it needs to match the path of the “gymfile” in ucb_xcode_fastlane.json above. For available options, see the fastlane docs. In this example, the “com.unity3d.buildautomation.base.stickers” application identifier should map to a UUID of1e33640e-9a55-4357-a632-ca6c48a53a96Assets/ucb/Stickers.mobileprovisionAssets/ucb/Gymfile(Ruby) export_options( provisioningProfiles: { "com.unity3d.buildautomation.base.stickers" => "1e33640e-9a55-4357-a632-ca6c48a53a96" } )
Update Advanced Settings
All that’s left is to update the Advanced Settings for your build target in the dashboard.- Navigate to the Unity Dashboard
- Select DevOps > Build Automation > Configurations.
- Navigate to the iOS build target.
- Select Edit.
- Navigate to the Edit Advanced Options tab.
- Under the Platform specific settings (iOS) option, set the Custom Fastlane Configuration Path, which is the path relative to the project’s root. In this example, it is set as “Assets/ucb_xcode_fastlane.json”.

Customize Fastlane Configurations for iOS Builds