Symptoms
- I am building a game via Unity Build Automation for iOS/Android and it is taking a long time to complete.
- I am on a tight deadline and I need a faster processing speed to build my larger projects.
Cause
- You are experiencing a noticeable drop in build speed when you are building your project in Unity Build Automation.
- You may notice this happens more frequently with iOS and Android builds, which take over an hour to complete, compared to local builds in Unity which may take far less.
- You may find that Build Automation takes 20 minutes for an empty project, while the local build only takes around 7 minutes.
Resolution
Build Automation usually takes a few minutes extra processing time per build than your local build.
This is due to the following tasks Build Automation will need to perform to complete each build:
- Each build needs to check out the project first. Depending on your hosting solution, the checkout can take a variable amount of time. The smaller your repository, the faster the checkout.
- After the checkout, it will verify whether it needs to build the library cache first. The first time, it usually has to import a fair number of assets. If library caching is turned on, the following are processed much faster.
- Most builders do not currently have any GPU (dedicated graphics processing hardware), so tasks that require GPU (shader compilation, lighting) will be longer. You can generally mitigate this by pre-compiling shaders and pre-generating any lighting. Builders that do have GPU are indicated in the build configuration options.
Builds with Build Automation can be 2-3 times as long as a local build, but this also depends on the size of your project. If you have many restarts, or if your builds fail, these factors can also affect the build time.
Each build needs to check out the project from your repository. The download speed varies depending on your source code hoster and connection to our systems. If you see builds with unusually slow build times, you can also check the status pages of your source code hoster to see if they have problems right now. Big hosts like GitHub or BitBucket provide their own status page, similar to the Unity Cloud status page.
You can also examine the build steps tab of your build logs to get an idea of which steps are taking the longest to complete.
The first import of a project will be slightly longer when using library caching as it builds the Library first. This, however, should improve the build speed after the first successful build. If you encounter issues with Library Caching please read the tips found here.
Unity Build Automation is a continuous integration system. The power of Unity Build Automation is in the capacity of creating distributed and parallel builds. You will gain the most power if you build all platforms for several test purposes at the same time. For example, you can create a Build for the Google Play Store, Amazon App Store, a test version, a release version, and different iOS versions at the same time in parallel.
This helps you integrate a continuous build pipeline, which enables you to work to short deadlines. Your developers will not have to wait too long for local builds.
If you notice extraordinary build times, you can create a Build Automation support ticket, via your project dashboard or tell us about it in the Build Automation Forum. The Build Automation team can monitor the build clients used for your project and advise you on how to resolve your issue.