Capture a Meta XR Simulator Session
Updated: Oct 4, 2024
Session Capture is useful for replaying a sequence of inputs in the exact same manner and checking if the results are the same as before. You can build fast manual tests, automated tests that run in Continuous Automation, or play against yourself in a multi-player test setup. It records inputs and takes screenshots using an exact time algorithm.
To create a recording:
Start an app with the runtime set to the Meta XR Simulator.
Load a scene (optionally run with the Synthetic Environment Server).
In the Meta XR Simulator window, click Record & Replay > Record.
Select a VRS file to record to. Session Capture is now in the Recording state.
Use your keyboard and mouse or Xbox controller to enter inputs and interact with the app.
- To save a snapshot, click Take Snapshot(s).
- Increase or decrease the number of frames to capture according to your testing scenario.
To exit the Recording state, click Stop Recording.
Start the same app with Meta XR Simulator.
Select the VRS recording.
In the Meta XR Simulator window, click Record & Replay > Replay.
Select a VRS file to save to. Session Capture is now in the Replay state.
Note: When you take a snapshot, the Capture number is displayed.
To exit the Replay state, click Record & Replay > Stop Replay.
Note
This works with standalone applications but not with Play mode in Unity. Add the following to %AppData%\Roaming\MetaXR\MetaXrSimulator\persistent_data.json
(after updating replay_path
to your recording’s location):
"session_capture": {
"delay_start_ms": 1000,
"exec_state": "replay",
"quit_buffer_ms": 1000,
"quit_when_complete": true,
"record_path": "C:\\open\\test_recordings\\recording.vrs",
"replay_path": "C:\\open\\test_recordings\\replay.vrs"
}
Launch the application with Meta XR Simulator to automatically replay.
Note: The recording automatically closes one second after the replay is complete. If you want the Meta XR Simulator to stay open after the replay is complete, change quit_when_complete
to false
.
JSON field definitions:
session_capture
(object, required) - top-level block that contains all of the automation session_capture parametersdelay_start_ms
(int, optional) - number of milliseconds to wait before starting the replyexec_state
(string, required) - which state to start the automation in (only replay is supported for now)quit_buffer_ms
(int, optional) - how long to delay after replay is complete before quitting the Meta XR Simulatorquit_when_complete
(bool, optional) - whether to quit the Meta XR Simulator after replay is completerecord_path
- absolute path to the record file to usereplay_path
- absolute path to the replay file to save
Session Capture is valuable for automated tests in Continuous Automation or when testing multiplayer setups by playing against yourself. For more details, please visit
Meta XR Simulator Automated Testing.