AddressableAssetProfileSettings.GetProfileDataByName returns variable data, not profile data

The AddressableAssetProfileSettings class has GetProfileDataById and GetProfileDataByName APIs which are documented to return the ProfileIdData associated with an asset profile object.

In fact, if you examine the implementation, these methods look up the id and name associated with a profile variable, not a profile itself. These methods are either incorrectly named or incorrectly implemented given their documented behavior.

Unfortunately there is no simple way to look up the value of a profile variable given only the profile and variable’s names. You have to rely instead on the GetAllProfileNames API, and then filter the profiles yourself using the more cumbersome GetValueByName API.

I encountered all of this while trying to figure out a way to set the active build asset profile from a custom build script. Is there some easy way to do this that I haven’t discovered?