How to get the serial number of the device in Unity

Hi, we wish to read the serial number of the ML2 to identify the device.

We are aware that the Android API for doing this is blocked in the more recent versions and just returns 'unknown' but we were wondering if the is a ML API we can use to get the serial number instead?


Magic Leap 2 runs Android 10, and Android 10 added restrictions on accessing this type of information. Depending on your use case you might be able to use SystemInfo.deviceUniqueIdentifier.

Hi, yes we're aware of the restrictions but I was hoping there might be a ML API that read it anyway. We have had a similar thing with Pico headsets who have done just that - built their own API to return the serial number. Clearly it is possible in some way to read the serial number on the ML2 as the Device Bridge shows it?
Alternatively is there a way to name the device? As long as it could be read in Unity that would work for us.
The use case for us is will have a bunch of ML2's in one location running our app and connecting to a local server. This has a status screen showing what all the headsets are doing and state (e.g. battery level). I want to be able to know which headset is which so for example if the battery level is low I know which headset it is. With SystemInfo.deviceUniqueIdentifier, I would have to map the Id's to a name (i.e. ML1, ML2, ML3) and there is no guarantee it won't change on a different app build which would require remapping the Id's again. With serial number at least it's fixed and the mapping table can be setup in advance. With hololens you could name the device so we used that.

We do not have this functionality available in our SDK at this time. I will send this feedback to our voice of customer team. For now, you can use a MDM like ArborXR to get information about each of the devices.