Unity Cloud Build 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.cloudbuild.base"
and a stickers extension with an app identifier of "com.unity3d.cloudbuild.base.stickers"
.
This setup currently requires adding three extra files to your repository:
This file can be placed anywhere in the repository but is placed at Assets/ucb_xcode_fastlane.json
in this example. Supports the following properties (all of which are optional, if you do not use a property remove it entirely):
fastfile - a path to your custom Fastfile, relative to the root of your repository.
gymfile - a path to your custom Gymfile, relative to the root of your repository.
lanes - lanes within the Fastfile referenced above.
pre_build - lane to run before the actual Xcode build steps.
post_build - lane to run after the actual Xcode build steps.
These paths are all relative to the root of the project.
Example "Assets/ucb_xcode_fastlane.json"
:
(JavaScript)
{
"fastfile": "Assets/ucb/Fastfile",
"gymfile": "Assets/ucb/Gymfile",
"lanes": {
"pre_build": "use_stickers_profile",
"post_build": ""
}
}
This file can be placed anywhere in the repository, but it needs to match the path of the “fastfile” specified in ucb_xcode_fastlane.json
above.
If you’ve configured pre_build/post_build lanes, an options hash is passed to those lanes when they run containing: project_dir - root of the repo this project is building from. build_target - build target identifier for this build. output_directory - final output directory where the Xcode project will build to.
In this example, we are installing the provisioning profile at “Assets/ucb/Stickers.mobileprovision” in the repo, and updating the “Unity-iPhone-Stickers” target in the Xcode project to use that profile.
Example Assets/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
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.cloudbuild.base.stickers” application identifier should map to a UUID of 1e33640e-9a55-4357-a632-ca6c48a53a96
(which is the UUID of the provisioning profile at Assets/ucb/Stickers.mobileprovision
).
Example Assets/ucb/Gymfil
:
(Ruby)
export_options(
provisioningProfiles: {
"com.unity3d.cloudbuild.base.stickers" => "1e33640e-9a55-4357-a632-ca6c48a53a96"
}
)
All that’s left is to update the Advanced Settings for your build target in the dashboard.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.