Unity Editor Batchmode and Command Line Builds
Run isolated Unity builds and tests from the CLI with the pinned editor, explicit target, separate logs and verified outputs.
Read the project's editor version, package manifest and supported targets. Use the matching editor executable and target modules. Run builds in a clean checkout or a worker copy. A project already open in another editor instance should get a separate checkout or a deliberate handoff before batchmode. Verify licensing availability without printing or embedding credentials. ## Key Points - [Unity Editor command line arguments](https://docs.unity3d.com/6000.0/Documentation/Manual/EditorCommandLineArguments.html) - [Unity Test Framework command line](https://docs.unity3d.com/Packages/com.unity.test-framework@1.4/manual/reference-command-line.html) ## Quick Example ```text Unity -batchmode -projectPath PROJECT -runTests -testPlatform EditMode -testResults RESULTS.xml -logFile TEST.log ``` ```text Unity -batchmode -quit -projectPath PROJECT -buildTarget StandaloneWindows64 -executeMethod BuildScripts.BuildWindows64 -logFile BUILD.log ```
skilldb get game-production-skills/unity-batchmodeFull skill: 39 linesUnity Editor Batchmode and Command Line Builds
Read the project's editor version, package manifest and supported targets. Use the matching editor executable and target modules. Run builds in a clean checkout or a worker copy. A project already open in another editor instance should get a separate checkout or a deliberate handoff before batchmode. Verify licensing availability without printing or embedding credentials.
Run tests and builds separately
Use distinct output paths and retain independent logs. For the Unity Test Framework, verify the flags against the installed package. A representative Edit Mode invocation is:
Unity -batchmode -projectPath PROJECT -runTests -testPlatform EditMode -testResults RESULTS.xml -logFile TEST.log
Avoid adding -quit to the test invocation when the Test Framework documentation warns it can exit before asynchronous tests finish. Parse the XML and require a nonzero expected test count. For Play Mode, use the documented test platform and the graphics configuration the tests actually require. A headless result is insufficient for a graphics-dependent assertion.
For builds, use the project's reviewed build method, or use the supported native build flags for its editor version. An example with a static method is:
Unity -batchmode -quit -projectPath PROJECT -buildTarget StandaloneWindows64 -executeMethod BuildScripts.BuildWindows64 -logFile BUILD.log
Use an existing method with that signature or implement a method that checks the BuildReport and returns failure explicitly. Record the exact selected profile, build arguments, target architecture, build output path and editor version. Verify scripts are safe to run before invoking them from a checkout.
Verify output evidence
Check process status and log together. Require a fresh result XML with expected counts for tests. For builds, validate fresh expected file paths, package size, manifest or metadata, and one supported startup smoke test. Keep the logs on failure. A successful import with no build artifact is a failed build. Distinguish a compile error, unavailable license, missing module, failed test and output verification failure before retrying.
Test the pipeline with a known compile failure or failing synthetic test and confirm it cannot leave a prior artifact marked current. Retry in a fresh output directory after the cause is corrected. Keep the verified package and test evidence paired with the source revision.
Sources
Install this skill directly: skilldb add game-production-skills
Related Skills
World of Warcraft Addon Packaging
Package a World of Warcraft addon for named Retail and Classic clients. Validate TOC metadata, folder and manifest names, dependency and load ordering, saved variables, and release archive structure before installing or publishing.
Esports and Competitive Game Design
Expert guidance on designing competitive games and building esports ecosystems including ranked systems, spectator tools, tournament infrastructure, anti-cheat, and competitive integrity
Game Community Management
Expert community management for games covering Discord operations, Steam forum management, player relations, crisis communication, moderation, and building healthy player communities
Game Localization
Comprehensive game localization covering text translation, CJK and RTL support, voice localization, cultural adaptation, UI flexibility, and internationalization engineering
Game Marketing
Strategic game marketing covering community building, wishlist optimization, trailer production, influencer relations, launch campaigns, and long-tail visibility
Game Porting
Expert guidance on porting games between platforms covering PC, console, and mobile adaptation, performance optimization, input remapping, platform-specific features, and cross-platform architecture