When you use the Addressables package, you build your content (AssetBundles) as a separate step from your application player. The Addressables package provides its own build scripts for this purpose, accessible from the toolbar of the Groups window.
To build your content artifacts:
[!TIP] If you encounter build or runtime loading issues during development, consider running the Clean > All command from the Build menu before you rebuild your content.
A Profile defines separate variables for the build and load paths of local versus remote content. You can create multiple profiles in order to use different paths for different kinds of builds. For example, you could have a profile to use while you develop your Project in the Editor and another for when you publish your final content builds.
For most Projects, you only need multiple profiles when you support remote content distribution. You don't typically need to change the local paths at different stages of your development process. Most projects should build local content to the default local build path and load it from the default local load path (which resolves to the StreamingAssets folder).
The local build path defaults to the path provided by Addressables.BuildPath, which is within the Library folder of your Unity project. Addressables appends a folder to the local build path based on your current platform build target setting. When you build for multiple platforms, the build places the artifacts for each platform in a different subfolder.
Likewise, the local load path defaults to that provided by Addressables.RuntimePath, which resolves to the StreamingAssets folder. Again Addressables adds the platform build target to the path.
When you build your local bundles to the default build path, then the build code temporarily copies the artifacts from the build path to the StreamingAssets folder when you build your player (and removes them after the build).
[!WARNING] If you build to or load from custom local paths, then it becomes your responsibility to copy your build artifacts to the correct place in your project before making a player build and to make sure your application can access those artifacts at runtime.
Addressables sets the default remote build path to an arbitrarily chosen folder name, "ServerData", which is created under your Project folder. The build adds the current platform target to the path as a subfolder to separate the unique artifacts for different platforms.
The default remote load path is "http://localhost/" appended with the current profile BuildTarget variable. You MUST change this path to the base URL at which you plan to load your Addressable assets.
Use different profiles to set up the remote load path as appropriate for the type of development, testing, or publishing you are doing. For example, you could have a profile that loads assets from a localhost server for general development builds, a profile that loads assets from a staging environment for QA builds, and one that loads assets from your Content Delivery Network (CDN) for release builds. See Hosting for more information about configuring hosting.
[!NOTE] When running your game in the Editor, you can use the Use Asset Database Play Mode Script to bypass loading assets through the remote or local load paths. This can be convenient, especially when you don't have a localhost server set up. However, it can hide group configuration and asset assignment mistakes.
To set up a remote content build:
See Remote content distribution for additional information.
After you have your group and Addressables system settings configured, you can run a content build:
The Default Build Script creates one or more AssetBundles for each group and saves them to either the local or the remote build path.
When you distribute content remotely, you can perform a differential update of the previously published build to minimize the amount of data your users must download (compared to a full build).
Once you have configured your remote groups properly and have a previous build which contains remote content, you can perform a content update build by:
Select the Update a Previous Build from the Build menu.
The file picker dialog opens.
Locate the addressables_content_state.bin
file produced by the build you are updating. (The default location is in your Assets/AddressableAssetsData/TargetPlatform
folder.)
Click Open to start the update build.
To update existing clients, copy the updated remote content to your hosting service (after appropriate testing). (An update build does include all of your local and remote content -- any player builds you create after a content update build will contain a complete set of Addressable assets.)
Note that updating a previous build does not change the addressables_content_state.bin
file. Use the same version of the file for future update builds (until you publish another full build created from the New Build menu).
See Content Update Builds for information on how and when to use content update builds.