Skip to main content
Version: 20 Mar 2024

Command Line

You can activate Application Simulator functions to iterate on the device using command line tools.

tip

For additional information on using Application Simulator on the command line with Native applications, reference the C/C++ Apps section of the Using Application Simulator Guide.

These are some of the most common VDCLI commands. For a full list of commands, type VDCLI --help on the command line.

CommandsDescription:
VDCLI -sStarts the Application Simulator Server (VDS)
VDCLI -kStops the Application Simulator Server
VDCLI -rRestarts the Application Simulator Server
VDCLI -hDisplays the command line help page
info

There is currently an issue with some Macs not being able to open the Magic Leap Hub (ML Hub) terminal. To get around this bug, you can open up any command line interface (for example Terminal) and set up your environment with the following commands:

source $USER/MagicLeap/mlsdk/<your-os-version>/envsetup.sh
source $USER/MagicLeap/tools/zi/<latest-app-sim-version>/mlvdsetup.sh

Start Application Simulator in Device Mode

Your device must be connected to the host with a USB cable.

  1. Open a terminal from the ML Hub by opening the Activity bar and clicking the terminal icon at the bottom. Use this terminal to enter commands.

  2. Start the Application Simulator Server.

VDCLI -s
  1. Install the com.magicleap.zi_agent to the device.
adb install -u path/to/mlsdk/VirtualDevice/device/com.magicleap.zi_agent.apk
  1. Launch the Application Simulator Agent.
adb shell start am -n com.magicleap.zi_agent.MainActivity
  1. Connect the Application Simulator Server to the device.
VDCLI --connect 12345

Start Application Simulator in Simulator Mode

  1. Open a terminal from the ML Hub by opening the Activity bar and clicking the terminal icon at the bottom. Use this terminal to enter commands.

  2. Start the Application Simulator Server.

VDCLI -s
  1. Launch the Simulator.
VDCLI -R Simulator
  1. Connect your peripheral.
VDCLI -R Peripheral