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.assetor 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
- 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. - Pick the platform target and switch the active build target if needed
(
BuildTarget/EditorUserBuildSettings). - 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.)
- 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. - Script the build with
BuildPipeline.BuildPlayer(BuildPlayerOptions)and inspect the returnedBuildReport— a non-Succeededresult must fail your pipeline. - Run headless for CI with
-batchmode -quit -executeMethod, and check the exit code. - Verify the actual output runs (launch the player), not just that the build returned without throwing.
Patterns
1. Scripted build with a result check
2. Headless / CI invocation
3. Protect stripped code with link.xml
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.LoadSceneonly 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/TypeLoadExceptiononly in the build — managed stripping removed reflection-only code. Lower the stripping level or add alink.xmlpreserve 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.Developmentenables the profiler/debugging and is slower; useBuildOptions.Nonefor 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 athttps://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.


