# 6. Build Automation Pitfalls Part of [[Build Automation and CI]]. Previous: [[5. Worked Example - Windows and Android Profiles]]. > [!note] Verification status > Several pitfalls are directly from the 6000.5 command-line build page (platform switch / reload in batch mode) and from GameCI / UBA official notes (UVCS shelves omit private files; GameCI `buildProfile` path is project-relative). Others are standard CI practice. **Not a post-mortem of a live pipeline.** ## 6.1 Pitfalls 1. **Switching platforms inside one batch-mode run.** `SetActiveBuildProfile` / `SwitchActiveBuildTargetAsync` will not do what you want. One process, one target, passed on the command line. 2. **A profile path that is wrong.** GameCI's `buildProfile` is relative to the Unity project (to `projectPath`). `Assets/Settings/Build Profiles/Windows.Dev.asset` — including `Assets/` — is the usual form. A typo fails in a way that looks like "Unity ignored my profile." 3. **Inventing a Unity version tag.** Pin the version from `ProjectSettings/ProjectVersion.txt`. If GameCI has no image for that exact Editor, that is a real constraint; don't "round up" silently. 4. **License secrets in the repo, in a gist, or in a screenshot.** Only GitHub encrypted secrets or the Unity Dashboard. Rotate if leaked. 5. **Fork pull requests and licenses.** GitHub will not hand your org secrets to untrusted forks by default. Design the class repo around that. 6. **Caching `Library` forever.** A bad cache looks like a compiler ghost. Have a way to bust it. 7. **Forgetting Git LFS** (`lfs: true` on checkout). CI will check out pointer files and the build will miss models, audio, or even large scenes ([[2. Git LFS]]). 8. **Test fixture scenes in the production profile**, or a production scene missing from the profile but open in the Editor when someone clicks Build locally. 9. **Unsigned or wrongly signed Android builds** uploaded as "the" APK, and a keystore in Git. Signing secrets belong in UBA or in Actions secrets. 10. **Assuming `ubuntu-latest` can IL2CPP-build every platform.** Read GameCI's runner / SDK notes per target. iOS still needs a Mac somewhere. 11. **UBA Shelve and Build missing new scripts** because they were private files. `cm add` them ([[UVCS]]). 12. **No `-logFile` and no uploaded artifacts.** A red X without a log is not a pipeline. 13. **Building Quest on CI and expecting it to be the comfort sign-off.** CI can produce the APK; [[6. Quest Performance Budgets]] and [[4.Quest 2 Testing and Deployment]] still happen on a headset. 14. **Addressables content not built** before the player, so the first scene is empty in the CI artifact. When you add Addressables, hook the content build into the same command (next tutorial). 15. **`-quit` omitted** on a custom `-executeMethod` so the process sits until the runner times out. ## 6.2 If you remember one thing Start the Editor already pointed at the profile you want, fail the process when the report is not `Succeeded`, and keep licenses out of Git. ## Official docs - Command-line builds (batch-mode limitations): https://docs.unity.com/en-us/engine/6000.5/manual/building-and-publishing/build-customize-build-pipeline/build-command-line - UBA Shelve and Build: https://docs.unity.com/en-us/build-automation/build-automation-editor-package