iOS workflow
This page presents a use case for using Codemagic to export a Godot project for iOS. We will not cover the syntax, structure, or functionality of a codemagic.yaml
file.
- You can skip the tutorial and grab the yaml files in Overview
- To learn how
codemagic.yaml
files work, see Creating codemagic.yaml. - To better understand what we'll do here, take a look at Workflow Configuration if its not already done.
- To learn how to configure your Godot project and repository, see Process Overview.

Image by Codemagic, used under CC BY-ND 4.0 license. See gallery
Requirements
- A text editor
- Workflow Configuration file. (See Workflow Configuration)
Apple tools such as XCode required for Godot iOS export are pre-installed on the Codemagic machine we will use(Apple Silicon M2 Mac mini).
- You can find the full list of tools and software installed on Codemagic machines in Codemagic Integrations.
- Also, check the list of other tools installed on the machine we will be using throughout the tutorials in Other pre-installed tools on macOS machines.
As explained in Project Configuration, you should configure your project for export as if you were exporting it on your local machine.
- Learn more about how to export a Godot project to iOS with Exporting for iOS.
Configuration
We need to create a new workflow in which we will define its own specific variables. Add the following code to your codemagic.yaml
file, right after the definitions
section:
workflows:
godot-ios-workflow:
name: iOS Export
max_build_duration: 120
instance_type: mac_mini_m2
working_directory: /Users/builder/Downloads
environment:
xcode: latest
vars:
<<: *godot_variables
OUTPUT_FILE: test.ipa
EXPORT_PRESET: iOS
Make sure your workflow now looks like this:
definitions: ...
workflows:
godot-ios-workflow: ...
Do you remember the Workflow Configuration file ?
We use the <<
and *
operators to reuses its sections.
- Learn more about reusable sections in a
codemagic.yaml
file with Reusing sections - For more details on the reused variables, see Minimal Configuration
Here a description of variables we defined:
Variable | Description |
---|---|
OUTPUT_FILE | The name of the exported file. Format: <PROJECT_NAME>.<EXTENSION> . The output file extension should match the one used by the Godot export process. See Exporting from the command line |
EXPORT_PRESET | The name of the export preset that will be used to export your project. |
- To learn more about environment variables in a
codemagic.yaml
file see Configuring Environment Variables
Now we need to configure the export process. Add the following code to your godot-ios-workflow
section:
scripts:
- *install_godot
- *install_godot_export_templates
- *export_project
- *gather_files
artifacts:
- *zipped_export
Then, make sure your workflow now looks like this:
workflows:
godot-ios-workflow:
...
environment: ...
scripts: ...
artifacts: ...
And that's it, all that's left is to configure your credentials to export your project. If you don't plan to sign your exported project, you can simply start the build. Your project will be available for download in .zip format once the process is complete. To start a new build, you can use Codemagic's interface, or events affecting your repository such as push.
- See Build Automatically to automate the execution of your Codemagic configuration.
- See also Build Notifications to get a notification informing you of the result of your build.
Credentials
Before continuing, make sure to set up Xcode certificates and/or profiles as explained in this tutorial. See Adding Provisioning file to upload a provisionning file on Codemagic.
The following variable groups and variables will be used to retrieve credential information that Godot does not store in the export_presets.cfg
file.
- Learn more about some of these variables in Godot 4 iOS environment variable. See also EditorExportPlatformIOS
TIP
You don't need to define all of these variables, just the ones that match your project's configuration.
Variable name | Variable value | Group |
---|---|---|
GODOT_IOS_PROVISIONING_PROFILE_UUID_DEBUG | UUID of the provisioning profile. See the documentation. | apple_credentials |
GODOT_IOS_PROVISIONING_PROFILE_UUID_RELEASE | UUID of the provisioning profile. See the documentation. | apple_credentials |
Add these variables in the Codemagic interface (either as Application or as Team variables), make sure to click Secure to make sensitive data encrypted.
- Learn how to store these variables using the Codemagic interface by watching this video:
- To learn more about environment variables in a
codemagic.yaml
file see Configuring Environment Variables - To learn more about storing binary files with Codemagic, see Storing Binary files
- If you don't own a PC, you can use a website like base64.guru or base64encode to encode your
keystore
file to base64.
To use the defined variables in our workflow, we have to add their group(apple_credentials
) to our configuration file(codemagic.yaml
file). To do so, add the following code to the environment
section of godot-ios-workflow
:
groups:
- apple_credentials
Then make sure your workflow now looks like this:
godot-ios-workflow:
...
environment:
groups:
- apple_credentials
...
TIP
If you already have a groups
section in your script, simply add the - apple_credentials
line to it.
And it's done! All we need to do is to export the project. To do this, you can use Codemagic's interface, or events affecting your repository such as push.
Sometimes you can get an errors like xcode-select points at wrong SDK location. In this case, inside the scripts
section of your godot-ios-workflow
, just before the export_project
section, add the following section:
- name: xcode-select Setup
script: sudo xcode-select -switch /Applications/Xcode.app
Then, make sure your workflow now looks like this:
scripts:
- *install_godot_export_templates ...
- name: xcode-select Setup
script: sudo xcode-select -switch /Applications/Xcode.app
- *export_project ...
- See Build Automatically to automate the execution of your Codemagic configuration.
- See also Build Notifications to get a notification informing you of the result of your build.
Overview
Summary of what we've covered on this page:
- Exported a Godot project to iOS using a Codemagic build machine.
File | Content | Tutorial |
---|---|---|
Download | Unsigned Godot iOS Export Configuration | Jump to tutorial |
Download | Signed Godot iOS Export Configuration | Jump to tutorial |
Caution !!!
To use this script effectively, refer to the script tutorial.
Note that this script is based on a specific project configuration and may not fit your setup.
Some environment variables have to be defined using the Codemagic interface, as explained in this tutorial.
Optional resources to help refine your configuration:

Getting help and support
If you have a technical question or need help with some particular issue, you can get help in the GitHub Discussions community.