Skip to main content

Unreal Engine AutoSDK System

What is AutoSDK?​

AutoSDK is a system within Unreal Engine designed to automate the distribution and configuration of platform software development kits (SDKs). Instead of requiring every developer and build machine to manually install and configure SDKs (like the Android NDK, Linux Toolchain, or console-specific toolchains) into specific system directories (e.g Program Files), AutoSDK allows these toolchains to be stored in a version-controlled repository. Unreal Engine then dynamically locates and uses them during the build process. Key Benefits:

  • Consistency: Ensures every team member and build node uses the exact same SDK version.
  • Portability: Removes dependencies on static system paths.
  • Version Switching: Allows different branches or projects to use different SDK versions seamlessly on the same machine.

How it works (high level)​

The system relies on a standardized folder structure and the UnrealBuildTool (UBT).

  1. Detection: When you initiate a build (e.g compile for Android or Windows), UBT checks for an environment variable called UE_SDKS_ROOT.
  2. Selection: If found, UBT looks inside that directory for a folder matching the Host Platform (your current OS) and the Target Platform (the platform you are building for).
  3. Environment Injection: Before the build starts, UBT executes temporary setup scripts such as Setup.bat and Unsetup.bat (or the .sh equivalents on Mac/Linux) located within that SDK's folder. These scripts inject the necessary environment variables (like PATH, INCLUDE, and LIB) into the current build process environment.
  4. Execution & Cleanup: The build runs using these temporary paths. Once the build is complete, the environment variables are discarded, leaving the host machine's global environment clean.

Directory structure​

The folder structure is strict so UBT can parse it automatically:

AutoSDK/
├── HostWin64/ # The OS of the build machine
│ ├── Android/ # The platform you are building FOR
│ │ ├── -25b/ # The SDK version (folder name varies by platform; Android often mirrors NDK revisions)
│ │ └── -21/
│ ├── Linux/
│ └── Win64/
└── HostMac/
└── IOS/

General usage workflow​

1. Repository setup​

Create a folder named AutoSDK (usually in the root of your project or engine depot, though it can live anywhere).

Populate with Platform SDKs: This is the most critical step. You must populate the folder with the SDK binaries required for your target platforms.

note

Simply copying installed SDKs (e.g. from C:\Program Files) will not work, as they often rely on static registry keys.

The general workflow for setting these up is as follows:

  1. Source: Download the official SDK installer from the platform holder's website (e.g Sony DevNet, Microsoft GDK, Nintendo Developer Portal).
  2. Extraction: Run the platform-specific generation script to create the "portable" file structure.
    • For platform-specific commands and script locations, please refer to the Engine\Platforms\PLATFORM\Extras\AutoSDK\HostWin64\PLATFORM\* folder.
  3. Placement: Move the output into the correct AutoSDK path: AutoSDK/Host[OS]/[Platform]/[Version].
  4. Turnkey Configuration: Update your project's TurnkeyManifest.xml (Located in MyProject/Extras/Turnkey/TurnkeyManifest.xml) to whitelist the new SDK version. This ensures the Unreal Turnkey system recognizes the new version as valid.

Commit this folder to Source Control.

2. Client setup​

  1. Sync the AutoSDK folder from source control.
  2. Set a system environment variable named UE_SDKS_ROOT pointing to that folder.
    • Example: UE_SDKS_ROOT=D:\P4\MyProject\AutoSDK
  3. Restart the Unreal Editor or generate project files to refresh the environment detection.

3. Building​

No further action is required. When a user selects Package Project or builds via Visual Studio, Unreal Engine detects the SDK in UE_SDKS_ROOT and uses it automatically.

Overriding Unreal Turnkey SDK setup​

Cloud Cooking normally runs Unreal's Turnkey (RunUAT.bat turnkey -Command=InstallSdk) as part of building the studio's game cook image in order to install the platform SDKs needed for cooking. If the project predates Turnkey, or the studio maintains their own SDK/toolchain setup (for example, a custom Linux cross-compile toolchain), these steps can be overridden.

This is done by uploading your own unreal-image-init.hooks.ps1 file to the scripts/ folder of the game's clientbuild storage container. This file is picked up automatically on every future image build. It is a plain PowerShell file that defines one or more of the following functions. If a function is present it will be called instead of mod.io default behaviour:

FunctionWhen it runsDefault behaviour if you don't define it
ShouldInitTurnkeyBefore Turnkey would normally runReturns $true (Turnkey runs as normal)
PreTurnkeyConfigurationImmediately before Turnkey runsNo-op
PostTurnkeyConfigurationImmediately after Turnkey runsNo-op

Example: skipping Turnkey and installing your own SDKs​

# unreal-image-init.hooks.ps1

function ShouldInitTurnkey {
# Returning $false skips our Turnkey call entirely.
return $false
}

function PreTurnkeyConfiguration {
Write-Host "Installing our own Linux cross-compile toolchain..."
# ... your custom SDK/toolchain install steps go here ...
}

Upload this file to clientbuild/scripts/unreal-image-init.hooks.ps1 in the game's storage account and it will be used on the next image build. This does not require contacting mod.io to change the game's pipeline. If you only need to run some additional setup alongside our default Turnkey install (rather than replacing it), just omit ShouldInitTurnkey and define PreTurnkeyConfiguration and/or PostTurnkeyConfiguration instead.

Relevant documentation​