Sometimes, Android build attempts in Unity Build Automation (UBA) experience long checkout times. Strategies such as switching from Library Caching to Workspace Caching, and changing from Windows to macOS builders can significantly reduce checkout time.
Symptoms
- The checkout build step for an Android build takes ~45 minutes or longer.
- The equivalent iOS checkout timer is much shorter.
Cause
Android builds on Windows builders can have long checkout times (30–50+ minutes or more) due to:
- A script running under Library Caching, which walks the entire repository and updates file timestamps.
- OS-level performance characteristics of Windows (NTFS, real-time scanning, file I/O overhead) make the step above significantly slower than on macOS.
Resolution
- To address slow checkout and timestamp processing:
- Recognize that the long checkout period on a Windows builder is spent in the timestamp update script, which runs only when Library Caching is enabled.
-
To avoid the 40–45 minute or more delay:
- Go to DevOps > Build Automation > Configurations.
- Edit the Android build target and open Advanced Settings.
- Under Caching, change from Library Caching to one of:
- Workspace caching (cache entire project/workspace), or
- Boost Disk (where supported, e.g., Windows 11 builders).
The steps above bypass the timestamp update script because the entire workspace state is restored directly.
- Optionally use macOS builders:
- Tests show that using macOS builders with Workspace Caching further reduces checkout time (e.g., from ~1h 40m to ~1h), thanks to faster file I/O and metadata operations.
-
Consider switching your Android targets to macOS builders (where supported) if you want additional performance gains.
- Validate the fix:
- Trigger a clean Android build after the configuration changes.
- Once the clean build succeeds, trigger an incremental (non-clean) build using the same commit.
- Confirm that:
- Checkout time is significantly reduced (no ~45-minute gap).
- Build duration and output quality meet expectations.
More Information
For more information about UBA performance, please review the Why are my build times on Build Automation so long? article.