Create a Custom Command
Updated: Oct 1, 2024
As a developer, you are accustomed to using shortcut commands that enable you to perform unique functions and tasks during your VR project development. When developing for Android-based virtual reality apps, Android Debug Bridge (ADB) commands are an essential part of interacting with your device through your computer. Meta Quest Developer Hub (MQDH) lets you create your own commands, which means that you don’t need to switch between your editor and command prompt, or type lengthy commands. With just a single click, you can run a custom command that’s a combination of multiple ADB commands, use unique shortcuts for repetitive tasks, or leverage command arguments that offer more precise insight into development.
- Open MQDH and go to Device Manager.
Under Custom Commands, click Create Command.
- In the Custom Command dialog box, do the following:
- In Name, give your command a unique descriptive name.
- In Command, enter the custom command. If your command requires device ID, replace the device ID with
_MQDH_CONNECTED_DEVICE_SERIAL_ID_
in your command syntax. When you run the command, MQDH replaces this string with the currently connected device ID. In this way, you don’t have to modify or create new commands for each device.
- To immediately open the output in a new window, select Display command output in a new window.
- Click Save.
- To modify or delete a command, click the ... icon for more options to modify or delete the command.
To run a command, ensure that the device is connected to your development machine and that it is available in the Device Manager of Meta Quest Developer Hub.
- On Device Manager, under Custom Commands, click Run.
To view the output, click View Output.
Import and Export Commands Share your custom commands externally, for example, with another developer or on another computer, through a JSON file. Similarly, if you have a list of custom commands saved externally, import them in MQDH using a formatted JSON file.
- Next to Create Command, click the ... icon to see more options.
- To import commands in MQDH, from the list of more options, click Import Commands, and locate the JSON file on your computer that contains the custom commands.
- To export commands, from the list of more options, click Export Commands. This exports all the custom commands in a JSON file. To export a specific command, click the ... icon next to the command you want to export, and click Export.