Game state and properties#

Commands that read and change text, scenes, properties and time scale, and save the game state or a screenshot.

Every command also takes the global options, such as --host and --port.

get-text#

Gets the text content of a UI element.

Parameters

Name

Required

Description

value

Yes

The object name or locator value.

--by

No

Locator strategy. The default value is: NAME

--camera-by

No

Locator strategy for the camera. The default value is: NAME

--camera-value

No

Camera locator value.

Returns

  • The text content of the element as a string.

Examples

alttester get-text ScoreLabel
alttester get-text --by PATH //Canvas/Header/Title

set-text#

Sets the text of an input field.

Parameters

Name

Required

Description

value

Yes

The object name or locator value.

--text

Yes

The text to set on the input field.

--by

No

Locator strategy. The default value is: NAME

--camera-by

No

Locator strategy for the camera. The default value is: NAME

--camera-value

No

Camera locator value.

Returns

  • Confirmation.

Examples

alttester set-text UsernameInput --text "player1"

scene#

Gets the current scene name, lists all loaded scenes, or loads a scene by name.

Parameters

Name

Required

Description

--list

No

If set, returns all currently loaded scenes instead of just the active one.

--load

No

Name of the scene to load.

Returns

  • The current scene name by default. A list of scene names when using --list. Confirmation when using --load.

Examples

alttester scene                     # Current scene
alttester scene --list              # All loaded scenes
alttester scene --load MainMenu     # Load a scene

game-state#

Gets the full game object hierarchy for the current scene.

Parameters

Name

Required

Description

--root

No

Limit the hierarchy to objects under this root object path.

--output

No

File path to save the game state to. If omitted, saved to .alttester-cli/.

Returns

  • Game state snapshot containing the full object hierarchy, scene info, and screen positions.

Examples

alttester game-state
alttester game-state --root Canvas
alttester game-state --output my-state.json

snapshot#

Captures and saves a game state snapshot, or reads back a previously saved one.

Parameters

Name

Required

Description

--root

No

Limit the snapshot to objects under this root object path (capture mode).

--output

No

File path to save the snapshot to. If omitted, saved to .alttester-cli/ (capture mode).

--show

No

Read and print the latest snapshot instead of capturing a new one. Does not require a connected game.

--file

No

Path to a specific snapshot file to read when using --show. Defaults to .alttester-cli/latest.

--json

No

When used with --show, print the raw snapshot JSON instead of the rendered hierarchy.

Returns

  • Path to the saved snapshot file (capture mode), or the rendered hierarchy / raw JSON (read-back mode).

Examples

alttester snapshot
alttester snapshot --root Canvas/Menu
alttester snapshot --output menu-snapshot.json

# Read back the latest snapshot (no game connection needed)
alttester snapshot --show
alttester snapshot --show --json
alttester snapshot --show --file path/to/snapshot.json

screen-size#

Gets the game’s screen resolution.

Parameters

No parameters.

Returns

  • Width and height of the screen in pixels.

Examples

alttester screen-size

get-property#

Reads a component property from an object.

Parameters

Name

Required

Description

value

Yes

The object name or locator value.

--component

Yes

The component type name.

--property

Yes

The property name on the component.

--assembly

Yes

The name of the assembly containing the component.

--by

No

Locator strategy. The default value is: NAME

--max-depth

No

Maximum depth for nested property traversal. The default value is: 2

Returns

  • The value of the requested property.

Examples

alttester get-property Player \
  --component PlayerController \
  --property Health \
  --assembly Assembly-CSharp

set-property#

Sets a component property on an object.

Parameters

Name

Required

Description

value

Yes

The object name or locator value.

--component

Yes

The component type name.

--property

Yes

The property name on the component.

--assembly

Yes

The name of the assembly containing the component.

--set-value

Yes

The new value to assign to the property.

--by

No

Locator strategy. The default value is: NAME

Returns

  • Confirmation.

Examples

alttester set-property Player \
  --component PlayerController \
  --property Health \
  --assembly Assembly-CSharp \
  --set-value 100

wait-for-property#

Waits until a component property reaches an expected value.

Parameters

Name

Required

Description

value

Yes

The object name or locator value.

--component

Yes

The component type name.

--property

Yes

The property name on the component.

--assembly

Yes

The name of the assembly containing the component.

--expected

Yes

The expected value to wait for.

--by

No

Locator strategy. The default value is: NAME

--timeout

No

How long to wait before failing, in seconds. The default value is: 20

--interval

No

How often to poll the property, in seconds. The default value is: 0.5

Returns

  • The matched property value.

Examples

alttester wait-for-property Player \
  --component PlayerController \
  --property Health \
  --assembly Assembly-CSharp \
  --expected 0 \
  --timeout 30

get-time-scale#

Gets the current game time scale.

Parameters

No parameters.

Returns

  • The current time scale as a float.

Examples

alttester get-time-scale

set-time-scale#

Sets the game time scale. Useful for speeding up or pausing gameplay during tests.

Parameters

Name

Required

Description

value

Yes

The time scale to set. Use 0 to pause, 1 for normal speed, values below 1 for slow motion, and values above 1 to speed up.

Returns

  • Confirmation.

Examples

alttester set-time-scale 0       # Pause
alttester set-time-scale 0.5     # Half speed
alttester set-time-scale 1       # Normal
alttester set-time-scale 2       # Double speed

screenshot#

Takes a screenshot of the game.

Parameters

Name

Required

Description

--path

No

File path for the saved PNG. The default value is: screenshot.png

Returns

  • Path to the saved PNG screenshot file.

Examples

alttester screenshot
alttester screenshot --path my-screenshot.png