# Magic Leap 2

These screenshots show the Unity 6 and device settings required to successfully deploy and launch apps on the Magic Leap 2.

## Settings & Permissions in Unity

#### 1. Build Profiles > Android > ML2 Profile > Scene List & Scripting Defines

Ensure that you have a Build Profile targeting Magic Leap with the correct scene list and scripting defines.

<figure><img src="https://1186324960-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWEOieFcrCdoaTX1LuCOI%2Fuploads%2F4sJIGyJQmULdJw0uvbww%2Fml2-buildprofile-scenelist.png?alt=media&#x26;token=95e42254-1c69-497d-a4f3-7725538addcd" alt=""><figcaption></figcaption></figure>

#### 2. Build Profiles > Android > ML2 Profile > Other Settings

Make sure the Vulkan Graphics API, DXTC texture compression format, package name, version, IL2CPP scripting backend, new input system, x86-64 target architecture, internal write permission, and application entry point are set correctly.

<figure><img src="https://1186324960-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWEOieFcrCdoaTX1LuCOI%2Fuploads%2FD7kN6I0OShoBL4vqXB9X%2Fml2-buildprofile-othersettings1.png?alt=media&#x26;token=7ed0fd5c-cbc0-4ce3-901a-cd18c2c5fb58" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1186324960-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWEOieFcrCdoaTX1LuCOI%2Fuploads%2FgcALu37ltYiE82PQxrSj%2Fml2-buildprofile-othersettings2.png?alt=media&#x26;token=f5f29f4d-8250-4165-937f-a07f10dd6d3b" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1186324960-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWEOieFcrCdoaTX1LuCOI%2Fuploads%2FSn5XOfDaDx4THsvl7x2o%2Fml2-buildprofile-othersettings3.png?alt=media&#x26;token=4b16781b-81d7-4e39-8c97-37c5ccafba35" alt=""><figcaption></figcaption></figure>

#### 3. Build Profiles > Android > ML2 Profile > Publishing Settings&#x20;

Make sure the custom main manifest, custom main Gradle template, and custom launcher Gradle template are all correctly assigned.

<figure><img src="https://1186324960-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWEOieFcrCdoaTX1LuCOI%2Fuploads%2FA0dOxyeTxSfcLwAVzAmj%2Fbuildprofile-buildsettings.png?alt=media&#x26;token=bea41090-d919-4fa2-bbfe-038200ca180e" alt=""><figcaption></figcaption></figure>

#### 4. Project Settings > XR Plug-in Management

Enable the OpenXR Plugin and Magic Leap 2 feature group.

<figure><img src="https://1186324960-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWEOieFcrCdoaTX1LuCOI%2Fuploads%2FWdnT29F63Hq3J9y67cNl%2Fml2-xrpluginmanagement.png?alt=media&#x26;token=6b564b92-e907-42d8-adff-78f5d315e027" alt=""><figcaption></figcaption></figure>

#### 5. Project Settings > XR Plug-in Management > OpenXR > Enabled Interaction Profiles & Feature Groups

Check that any required interaction profiles, feature groups, and subsystems used in your project are enabled.

<figure><img src="https://1186324960-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWEOieFcrCdoaTX1LuCOI%2Fuploads%2FPRVoAG6SYc5uOcFC9s0K%2Fml2-openxrfeaturegroups.png?alt=media&#x26;token=422c3c78-f7a8-40a3-b6bc-ae2d71e16216" alt=""><figcaption></figcaption></figure>

#### 6. Project Settings > XR Plug-in Management > Project Validation

Review that all checks pass successfully.

<figure><img src="https://1186324960-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWEOieFcrCdoaTX1LuCOI%2Fuploads%2FyPLHMc4iDvS0DqneSFob%2Fml2-projectvalidation.png?alt=media&#x26;token=cd700cd7-3a7b-4230-939c-510299ffec07" alt=""><figcaption></figcaption></figure>

#### 7. Project Settings > MagicLeap > Permissions

Include all Android permissions that you anticipate your app needing. Additional permissions may be required on the device, in the app permission settings.

<figure><img src="https://1186324960-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWEOieFcrCdoaTX1LuCOI%2Fuploads%2FjsRQLAlKMCIb4TKQfGAE%2Fml2-permissions.png?alt=media&#x26;token=a6d0dce2-eac6-4315-83cb-91ff99a2e015" alt=""><figcaption></figcaption></figure>

## Installing an App to Magic Leap 2

1. To install an .apk to your device, enable [Developer Mode](https://developer-docs.magicleap.cloud/docs/guides/getting-started/enable-developer-mode/) and [USB Debug Mode](https://developer-docs.magicleap.cloud/docs/guides/getting-started/enable-developer-mode/#enable-usb-debug-mode).
2. Connect your Magic Leap 2 to your computer via USB-C cable.
   1. If your computer has a USB-A port, you may need to use a USB-A-to-C cable.
3. Enable "Allow USB debugging" if prompted.
   1. Check "Always allow from this computer" to not receive this popup in the future.
4. Use [Magic Leap Hub 3](https://developer-docs.magicleap.cloud/docs/guides/developer-tools/ml-hub-3/get-started/) to install the app. Go to Device Bridge > Apps > Install App, and select your .apk file.&#x20;

## Settings & Permissions on Device

For each app you download, you may have to manually grant permissions (e.g., camera, voice input) on device in `Settings > Apps & Notifications > App info > your-app > Permissions`.
