PluginBench
Skill
Pass
Audit score 90

unity-build-pipeline

gamedev-skills/awesome-gamedev-agent-skills

Configure, script, and automate Unity 6.3 LTS player builds with platform targets, scripting backends, and CI integration.

What is unity-build-pipeline?

Covers building and shipping Unity 6.3 LTS players: configuring build settings and scenes, choosing between Mono and IL2CPP scripting backends, managing code stripping to reduce size, scripting repeatable builds with BuildPipeline.BuildPlayer, and running headless/CI builds. Use when setting up build configurations, automating builds, or optimizing build size.

  • Configure Build Settings/Profiles, scene lists, and platform targets for player builds
  • Choose and switch between Mono (fast iteration) and IL2CPP (AOT, required for many platforms) scripting backends
  • Reduce build size with Managed Stripping Levels (Disabled through High) and link.xml protection for reflection code
  • Script repeatable builds using BuildPipeline.BuildPlayer and inspect BuildReport for success/failure
  • Run headless builds for CI pipelines with -batchmode -quit -executeMethod and exit code verification
  • Tune Quality Settings and Player Settings per platform for performance and compatibility

How to install unity-build-pipeline

npx skills add https://github.com/gamedev-skills/awesome-gamedev-agent-skills --skill unity-build-pipeline
Prerequisites
  • Unity 6.3 LTS (6000.3) or compatible version
  • Platform-specific C++ toolchains if using IL2CPP (e.g., Windows build tools for Windows, Android NDK for mobile)
  • Basic familiarity with Unity Editor Build Settings and Player Settings
Claude Code
Cursor
Windsurf
Cline

How to use unity-build-pipeline

  1. 1.List the scenes to include in the build via Build Profiles/Settings or EditorBuildSettings.scenes; only enabled scenes ship
  2. 2.Select the target platform (BuildTarget) and switch the active build target if needed
  3. 3.Choose the scripting backend (Mono vs IL2CPP) in Player Settings based on platform requirements and performance needs
  4. 4.Configure Managed Stripping Level (Disabled → High) and add link.xml entries to protect reflection-only code
  5. 5.Write a build script using BuildPipeline.BuildPlayer(BuildPlayerOptions) and always check BuildReport.summary.result
  6. 6.Invoke the build headless in CI with -batchmode -quit -executeMethod and verify the exit code is 0
  7. 7.Launch and test the actual built player to confirm it runs, not just that the build succeeded

Use cases

Good for
  • Setting up a multi-platform build pipeline that targets Windows, mobile, or console platforms
  • Automating builds in CI/CD systems with headless Unity editor invocation and exit code checks
  • Reducing shipped player size by configuring managed code stripping and preserving reflection-only code with link.xml
  • Switching from Mono to IL2CPP for performance-critical or platform-required builds
  • Debugging build failures by inspecting BuildReport results and scene configuration
Who it's for
  • Game developers configuring release builds for multiple platforms
  • Build engineers setting up CI/CD pipelines for automated game builds
  • Programmers optimizing build size and performance for shipped players
  • Technical leads managing build infrastructure and player distribution

unity-build-pipeline FAQ

When should I use Mono vs IL2CPP?

Use Mono for fast iteration on desktop platforms (Windows, macOS, Linux). Use IL2CPP when the platform requires it (iOS, WebGL, console), for better runtime performance, or when you need ahead-of-time compilation. IL2CPP requires the platform's C++ toolchain installed.

Why is my scene missing from the build even though it loads in the Editor?

The scene must be listed and enabled in Build Settings (or Build Profiles in newer Unity versions). SceneManager.LoadScene only sees scenes in that list. Check EditorBuildSettings.scenes or the Build Profiles UI.

How do I prevent managed code stripping from breaking my build?

Lower the Managed Stripping Level (try Minimal or Low first), or create an Assets/link.xml file with <assembly> and <type> entries to preserve types used only via reflection, JSON serialization, or plugins.

What does it mean if BuildPipeline.BuildPlayer returns but the build has errors?

Always check BuildReport.summary.result — it can return without throwing an exception even if result != BuildResult.Succeeded. A non-Succeeded result must fail your CI pipeline; do not treat 'returned' as 'success'.

How do I run a build in CI without the Unity Editor UI?

Use -batchmode -quit -nographics -projectPath <path> -executeMethod <ClassName.MethodName> -logFile -. The exit code will be 0 on success; check it in your CI script.

Full instructions (SKILL.md)

Source of truth, from gamedev-skills/awesome-gamedev-agent-skills.


name: unity-build-pipeline description: > Build and ship Unity 6.3 LTS players: build settings and scenes, player/quality settings, the IL2CPP vs Mono scripting backend, managed code stripping, scripted BuildPipeline.BuildPlayer, and CI/headless builds. Use when configuring or automating a build, choosing a scripting backend, shrinking build size, or when the user mentions Unity build, player settings, IL2CPP, code stripping, or Addressables.

Unity Build Pipeline

Configure, script, and automate Unity 6.3 LTS player builds: scenes, platform target, scripting backend, stripping, and headless/CI builds. Targets Unity 6.3 LTS (6000.3).

When to use

  • Use when setting up Build Settings/Profiles, choosing a platform and scripting backend (Mono vs IL2CPP), reducing build size with managed stripping, scripting a repeatable build with BuildPipeline.BuildPlayer, or wiring a CI/headless build.
  • Use when the project has ProjectSettings/EditorBuildSettings.asset or a CI build script.

When not to use: authoring a CI service config end-to-end is DevOps; this skill covers the Unity-side build API and settings. Console/platform certification specifics are platform-NDA territory. Storefront submission → steam-publish / itch-publish.

Core workflow

  1. List the scenes to build (File → Build Profiles/Settings → Scene List, or EditorBuildSettings.scenes). Only listed, enabled scenes ship; scene 0 is the start scene.
  2. Pick the platform target and switch the active build target if needed (BuildTarget / EditorUserBuildSettings).
  3. Choose the scripting backend (Player Settings): Mono (fast iteration, desktop) vs IL2CPP (AOT C++; required for many platforms, better perf, harder to reverse). IL2CPP needs the platform's C++ toolchain installed. (Forward note: Unity is developing a CoreCLR backend as a modern .NET runtime successor to Mono, but it is experimental, desktop-only, and not production-ready as of Unity 6.7 — so for 6.3 LTS the choice stays Mono vs IL2CPP.)
  4. Tune size/perf: set Managed Stripping Level (Disabled → Minimal → Low → Medium → High) and protect reflection-only code with a link.xml. Set Quality Settings per platform.
  5. Script the build with BuildPipeline.BuildPlayer(BuildPlayerOptions) and inspect the returned BuildReport — a non-Succeeded result must fail your pipeline.
  6. Run headless for CI with -batchmode -quit -executeMethod, and check the exit code.
  7. Verify the actual output runs (launch the player), not just that the build returned without throwing.

Patterns

1. Scripted build with a result check

using UnityEditor;
using UnityEditor.Build.Reporting;
using UnityEngine;

public static class BuildScript
{
    [MenuItem("Build/Windows x64")]
    public static void BuildWindows()
    {
        var options = new BuildPlayerOptions
        {
            scenes = new[] { "Assets/Scenes/Main.unity", "Assets/Scenes/Level1.unity" },
            locationPathName = "Builds/Windows/Game.exe",
            target = BuildTarget.StandaloneWindows64,
            options = BuildOptions.None,            // add BuildOptions.Development for a dev build
        };

        BuildReport report = BuildPipeline.BuildPlayer(options);
        BuildSummary summary = report.summary;

        if (summary.result != BuildResult.Succeeded)
            throw new System.Exception($"Build failed: {summary.totalErrors} errors");
        Debug.Log($"Build OK: {summary.totalSize} bytes in {summary.totalTime}");
    }
}

2. Headless / CI invocation

# Exit code is 0 on success; -quit ensures the editor closes; -nographics for build servers.
Unity -batchmode -quit -nographics \
  -projectPath "/path/to/Project" \
  -executeMethod BuildScript.BuildWindows \
  -logFile -

3. Protect stripped code with link.xml

<!-- Assets/link.xml — keep types the linker can't see are used (reflection, JSON, plugins). -->
<linker>
  <assembly fullname="MyGameRuntime" preserve="all"/>
</linker>

Pitfalls

  • A scene loads in the Editor but is missing in the build — it isn't in the Build Settings scene list (or is disabled). SceneManager.LoadScene only sees listed scenes.
  • IL2CPP build fails on a fresh machine — the platform C++ toolchain (e.g. Windows build tools, Android NDK) isn't installed. Mono has no such requirement.
  • MissingMethodException/TypeLoadException only in the build — managed stripping removed reflection-only code. Lower the stripping level or add a link.xml preserve entry.
  • Treating "BuildPlayer returned" as success — always check BuildReport.summary.result; it can return with errors.
  • Addressables content is stale/missing — Addressables (com.unity.addressables) need a separate content build (Build → Addressables) and a profile pointing at the right load path; a player build alone doesn't rebuild them.
  • Shipping a Development build — BuildOptions.Development enables the profiler/debugging and is slower; use BuildOptions.None for release.

References

  • For a complete multi-platform CI build script (target switching, version stamping, argument parsing, exit codes) and an Addressables content-build call, read references/ci-build-script.md.
  • Primary docs: ScriptReference/BuildPipeline.BuildPlayer, Unity Manual build sections (player settings, managed code stripping). For the forward-looking CoreCLR backend, see the experimental note at https://docs.unity3d.com/6000.7/Documentation/Manual/scripting-backends-coreclr.html.

Related skills

  • steam-publish / itch-publish — distributing the player you just built.
  • unity-csharp-scripting — editor scripting conventions used by build scripts.