Version: 2022.1
Including specific Scenes
Build manifest

Using Addressables in Unity Cloud Build

Addressable Assets are assets that have a unique address which you can use to load them from local or remote AssetBundles.

Prerequisites

Before you can build Addressable Assets in Cloud BuildA continuous integration service for Unity projects that automates the process of creating builds on Unity’s servers. More info
See in Glossary
, you must:

  • Convert your project to use Addressables locally, that is:
  • Install the Addressables package
  • Set the Assets as Addressable
  • Commit your updated project to your chosen version controlA system for managing file changes. You can use Unity in conjunction with most common version control tools, including Perforce, Git, Mercurial and PlasticSCM. More info
    See in Glossary
    system (VCS)

Unity recommends that you’re comfortable working with Addressables locally before you build them with Cloud Build.

Configuring the Build Target

If you’re starting from a brand new Cloud Build project, you’ll need to create a new Build Target first.

  1. From the Cloud Build Dashboard, navigate to the build target Configurations page for your project.
  2. Go to the build target that you’d like to build Addressables for.
  3. On the build target’s advanced settings, edit the Addressables section.

Use the Addressables section to configure properties that determine how the Addressables build process behaves. Each property is described in more detail with a tooltip.

Running a new Addressables build

To run a new Addressables build:

  1. Enable Build Addressables.
  2. Click the Save changes button.
  3. Build the Target.

Enable Cloud Content Delivery service

If you want to upload Addressables to the Cloud Content Delivery (CCD) service from Cloud Build:

  1. Go to the build target that you’d like to build Addressables for.
  2. On the build target’s advanced settings, edit the Addressables section.
  3. Enable Upload Addressables to the Cloud Content Delivery service to upload Addressables to CCD.
  4. Choose the required CCD bucket in the Content Delivery Bucket drop-down.
  5. Your Content Delivery API Key should already be populated in its field. If not, add it.
  6. Enable Automatically create a Cloud Content Delivery release from the bucket if you want to automatically create a CCD release from the selected bucket.
  7. Click the Save changes button.
  8. Build the Target.

See Addressable Asset system with Cloud Content Delivery for more information about using Addressables with CCD.

Running a content update build

Content update builds update a previously built player with new addressable content.

To update the existing player, update builds require a Content State file. This links the content from an Update build to an existing player. The Content State file is generated when you do a new Addressables build.

To update a previously built player with new Addressable assets:

  1. On the build target’s advanced settings, edit the Asset bundles section.
  2. Enable Make a content-only build.
  3. Click the Save changes button.

Starting a build

When the build target is configured, to start a new Addressables build:

  1. Navigate to the Build History page of the dashboard.
  2. Build the target you’ve configured Addressables for.

When the new build has successfully completed, the More menu (⋮) for the build displays the Download Addressable Assets option.

Copying Addressables content from Cloud Build to your hosting provider

Once you’ve completed an Addressables build, you can copy the Addressables content from Cloud Build to your hosting provider. You can do this manually, or by using a post-build script.

Copying Addressables content manually

Once you’ve completed an Addressables build, select Download Addressables Assets from the More menu (⋮). When you’ve downloaded the content, you can upload it to your hosting provider as you normally would when building locally.

Copying Addressables content with a post-build script

Cloud Build supports running a custom shell script before or after a build. You can create a post-build script to automatically upload your Addressables content when a build successfully completes.

To enable a post-build script:

  1. Go to the Cloud Build Configurations page.
  2. On your build target’s advanced settings, in the Script hooks section,
  3. In the Post-Build Script field, enter the path to your script.

The following tips might be useful to consider when writing your script:

  • The Addressable content for your build is located at $WORKSPACE/.build/last/<BUILD_TARGET_ID>/extra_data/addrs/

  • You can set environment variables for secret keys in the Build Target Configurations page.


Including specific Scenes
Build manifest