Skip to main content
Version: 12 Dec 2024

Start and Stop Application Simulator

This section walks through the options you have for starting a session in Application Simulator that you can use to run your app. You can use ML C API or Unity apps.

Topics covered on this page include:

What is a Simulator Target vs. a Device Target?

You can run your app in Application Simulator with either a device or a simulator target. This section describes the differences between the two.

Simulator Target

If you choose the simulator target, your app is displayed in the Application Simulator window. A simulator target does not require a Magic Leap device, making it ideal for large development teams with limited hardware. Application Simulator provides head pose and world reconstruction data from the virtual environment of the simulation. You can adjust everything manually in the Application Simulator (head pose, eye gaze, hand, controller). The changes are sent to your application.

Device Target

If you choose the device target, you use your Magic Leap device with Application Simulator. If you move your head, your hands, the controller, or eyes, that information appears in the Application Simulator. You view your app inside the Magic Leap headset.

Start Simulator Target

This section walks through starting a session with a simulator target.

  1. The Application Simulator opens with the Target Configuration dialog displayed. Choose the Simulator target type. The dialog comes pre-populated with the latest version of the SDK, leave it as-is.

    Target Configuration Panel
  2. Click Start. Your session starts. You are now ready to run your application. You should see the default Application Simulator office scene, as shown:

Simulator Target View in Application Simulator

Start Device Target

You can use a Magic Leap device connected to your PC via a USB-C cable, which allows you to execute and debug your project on your host computer. To do this, take the following steps:

  1. Connect a powered on Magic Leap device to your computer over USB.

  2. In the Magic Leap headset, you are prompted with a USB Device Detected screen. Leave the setting on File Transfer/ML Hub Connectivity Media Transfer Protocol (MTP).

  3. Click OK.

  4. Open the Application Simulator. When it starts, the Target Configuration dialog is displayed. Choose the Device target type. The dialog comes pre-populated with the latest version of the SDK, leave it as-is.

    Target Configuration Panel for Device Target
  5. Select your Magic Leap device from the Device drop-down.

  6. Click Start.

  7. If it is your first time using the Application Simulator on your headset, you need to answer three prompts and choose ALLOW each time:

    • Allow App Sim Device Agent to take pictures and record video?
    • Allow App Sim Device Agent to track eyes and detect gaze behaviors like blinks and fixation?
    • Allow App Sim Device Agent to detect planes and mesh data of the environment around you?
  8. After you answer the questions, your session starts. It should look like the display pictured:

Device Target on Application Simulator
  1. On the headset you should see a message saying "App Sim Ready Play a scene in Unity or use ZILauncher to run an application on host. (Use Controller to hide this message.)"

After this, you can now run an app and have it appear in your headset. You can see the input data like head pose, controller, eye tracking and more in the Application Simulator window.

Stop a Target

To stop a target, toggle the Target State Selector to Disconnected.

Connected State Toggle
Disconnected State Toggle

If you stop a session, you can restart a new one using the menu at the top of the screen, shown here:

Target Selector Menu

To start a target from this menu, do the following:

  1. Click the box to the right of Target.
  2. Choose an existing target to restart, or click Connect to Target to start a new target.