Getting Started with Meta XR Simulator
Updated: Jun 10, 2024
Meta XR Simulator is a lightweight Extended Reality (XR) runtime built to speed up XR application development and testing on your development machine.
The simulator uses the same XR API specification as mobile and PC VR runtimes, allowing it to integrate with your engine’s IDE without modification. The simulator includes a predefined input mapping schema and a user interface that provides information on how the runtime composites the final view and simulates input.
This page provides a brief overview of Meta XR Simulator and basic installation and usage instructions.
Download the latest Meta XR Simulator UPM Package. Only the MetaXrSimulator
folder is needed for Native C++. Copy it to somewhere convenient, like C:\Projects\MetaXRSimulator
(this location will be assumed for the rest of this document).
To use Meta XR Simulator, you need to set it as the active OpenXR runtime. There are two ways to do this:
- With Windows Registry: use registry editor to open (or create)
<HKLM>\SOFTWARE\Khronos\OpenXR\1
, and set/add ActiveRuntime
to the JSON file path (e.g., C:\Projects\MetaXRSimulator\meta_openxr_simulator.json
). - With an environment variable: you can also set the Windows environment variable
XR_RUNTIME_JSON
to the JSON file path.
The difference between the two methods is that the Windows registry is permanent, and will apply to all OpenXR apps before it’s modified. For the environment variable, the impact of modification is limited to the process (e.g., the command console or game engine which sets it), and will not be preserved after exiting the process.
OpenXR Runtime Changed
The steps above change the OpenXR Runtime (for example, the runtime used by Link) to Meta XR Simulator which means the previous runtime will not work anymore after this change. Please make sure to revert above steps when Meta XR Simulator is not used anymore.Meta XR Simulator supports Apple Silicon Mac and can be installed as a Homebrew formula. Please check
this Github page for detailed instructions.
Assuming you have downloaded Meta XR Simulator and set it as the activated OpenXR runtime, you can launch the OpenXR application. The OpenXR Loader will load Meta XR Simulator as the runtime, and you should see the Debug Window opened when xrBeginSession()
is called. The Debug Window closes automatically when your application calls xrEndSession()
. If you click the Close button of the Debug Window, it triggers xrRequestExitSession()
and kicks off the session state transition, including XR_SESSION_STATE_STOPPING
and XR_SESSION_STATE_EXITING
.
You can run hello_xr
to verify that Meta XR Simulator is set up correctly. The About window gives details about the Meta XR Simulator version, file path, graphics API, and other useful information.
Running mixed reality applications
To run a mixed reality application in Meta XR Simulator, you need to launch the Synthetic Environment Server (SES) that enables mixed reality simulations.
From the .synth_env_server
folder, under the Meta XR Simulator folder, you can run synth_env_server.exe RoomName
to start SES. The valid room names (case sensitive) are LivingRoom
, Bedroom
, and GameRoom
. To quit SES, close its window.
Meta XR Simulator does not support hot-switching between environments, but you may switch to another environment without closing the first one when the simulator is not running.