Switching user programmatically

Dear Magic Leap community,

As part of our project, it is necessary that the stored user-profiles on a Magic Leap 2 can be changed programmatically. I'm reaching out to you to elaborate the best way possible.

So far I have considered the following approaches.

  1. Via ADB command, sent from a locally running app (as far as I know, the Magic Leap 2 would have to be rooted for this)
  2. Via ADB command over the network
  3. With the help of an MDM
  4. Other possibility, e.g. via Magic Leap SDK / API?

Which approach would you consider to be the most suitable? I only want to root the device as a last resort because it poses a security risk and has a potential impact on Magic Leap's OS updates, etc.

I would be very grateful for any suggestions :slight_smile:

Kind regards,

Hello again @julien.villiger ,

My response is going to focus on points 3 and 4 and on the assumption you might be pursuing building your own solution rather than doing an off-the-shelf MDM. I leave it up to you to analyze if it is cost effective for your project.

I would start here reading up on the Android documentation around Dedicated devices, effectively that is the only way to access an API surface that allows User management. Dedicated devices overview  |  Android Developers

Effectively you will be writing an MDM app yourself if you want to call APIs on device that allows User management, at the end of the day we are targeting Android 10 behaviors related to this stack and any documentation related to Device Management should be accurate for your reference.

PS I personally would either go with a light open source MDM / pay for one depending on the size of your development team.

Hope that helps,

1 Like

Hi @mrushton

Big thanks for the useful input. Especially the "Dedicated devices"-approach sounds promising.

As far as I know, the google play services are necessary. Is that correct? And are they supported by Magic Leap?

Kind regards,

Depends! Android Enterprise provides APIs that exist on device side as well as in google play. Given we have several MDM solutions that avoid the need for cloud services provided by google play I advocate you roll an implementation that doesn't require functionality. Local user management calls off the top of my head DO NOT require Google Play.