xr-mode-test

Test XR session lifecycle and mode transitions. Use when verifying XR enter/exit behavior, testing mode-dependent features, or debugging session state issues.

npx skills add https://github.com/facebook/immersive-web-sdk --skill xr-mode-test

XR Mode Toggle Test

Test the XR session lifecycle by entering and exiting XR mode, verifying state transitions at each step.

Test Flow

1. Check Initial State

Use mcp__iwsdk-dev-mcp__xr_get_session_status to confirm starting state:

  • In 2D mode: no active session
  • Already in XR: note current state before proceeding

2. Enter XR Mode

Use mcp__iwsdk-dev-mcp__xr_accept_session to enter XR.

3. Verify XR Session Active

Use mcp__iwsdk-dev-mcp__xr_get_session_status to confirm:

  • Session is active
  • visibilityState is "visible"

4. Optional: Verify Input Devices

Use mcp__iwsdk-dev-mcp__xr_get_device_state to check:

  • Controllers are connected
  • Headset position is valid

5. Exit XR Mode

Use mcp__iwsdk-dev-mcp__xr_end_session to leave XR.

6. Verify Session Ended

Use mcp__iwsdk-dev-mcp__xr_get_session_status to confirm:

  • No active session
  • Back to 2D mode

7. Check Application State

Use mcp__iwsdk-dev-mcp__browser_get_console_logs to verify:

  • Any mode-switch logs fired correctly
  • Application state reset as expected (if applicable)

Arguments

If $ARGUMENTS is provided, use it as a log pattern filter for step 7.

Example: /xr-mode-test "MODE|RESET" will filter logs for "MODE" or "RESET" patterns.

Expected Results

Report:

  • Whether each step passed or failed
  • Any unexpected state or errors
  • Time taken for session transitions
  • Relevant log messages from the application

More skills from facebook

binary-size-analysis
facebook
Analyze per-commit binary size changes of the hermesvm shared library across a git commit range. Produces a markdown report with per-commit sizes and summary tables of significant increases and decreases.
official
modify-jsi-features
facebook
Guide for adding new JSI functionality to the JavaScript Interface (JSI) layer. Use when the user asks to add, create, or implement new methods or features in…
official
non-interactive-git-rebase
facebook
Use when needing to reorder, split, drop, or amend git commits that are not the top commit, without interactive editor access. Covers programmatic rebase via…
official
click-target
facebook
Find and click a target object in XR. Use when testing UI interactions, clicking buttons, or verifying interactable elements work correctly.
official
iwsdk-planner
facebook
IWSDK project planning and best practices guide. Use when planning new IWSDK features, designing systems/components, reviewing IWSDK code architecture, or when…
official
iwsdk-ui-panel
facebook
Develop and iterate on IWSDK UI panels efficiently. Use when working on PanelUI components, debugging UI layout, or improving UI design in IWSDK applications.
official
test-all
facebook
Parallel test orchestrator. Runs all 9 test suites concurrently via Task sub-agents and the iwsdk CLI. Handles build, example setup, dev servers, agent launch,…
official
test-audio
facebook
Test audio system (AudioSource loading, playback state, stop, spatial audio) against the audio example using the iwsdk CLI.
official