How do I "clean' build when building addressables?

Howdy,

When building addressables through the Addressables Groups window, you can clean build data using BuildClean BuildAll. This allows us to clean the local addressables data before building for a ‘clean’ addressables build.

I haven’t found the addressables API to replicate this behavior when building addressables via script. How should I go about this?

Thanks in advance!

You can find the APIs here.

Update:
The link has been moved to https://docs.unity3d.com/Packages/com.unity.addressables@1.21/manual/ContinuousIntegration.html.

Thank you very much!

Just in case the URL breaks in the future, I’ll summarize the answer here:

  • In order to clear the addressables content builder cache, you should use the following line (assuming you’re using the default data builder or have set your custom one already):
    AddressableAssetSettingsDefaultObject.Settings.ActivePlayerDataBuilder.ClearCachedData();

  • In order to clear the scriptable build pipeline cache, you should use the following line (assuming you want to avoid opening a prompt window because this is for a CI flow):
    BuildCache.PurgeCache(false);

5 Likes

Thanks for this, the URL did break in the now your future

1 Like