For the complete documentation index, see llms.txt. This page is also available as Markdown.

System commands

The nine commands that control the app lifecycle and the device — OPEN_APP, KILL_APP, CLEAR_APP and the rest, in one table.

System commands act on the app and the device rather than on anything on screen. They have fixed syntax and are written in capitals.

Platforms

Android · iOS — with differences, see below

Separator

A space. OPEN_APP:com.shopease.android is legacy but still works

Package argument

Required on OPEN_APP, KILL_APP, CLEAR_APP, MINIMISE_APP

Variables

OPEN_APP {{app_package}} works

Watch out

CLEAR_APP is effectively a no-op on iOS

Prerequisites

  • A connected device or emulator

  • An open test file

  • A registered app and its package name — com.shopease.android in these examples

Copy this

OPEN_APP com.shopease.android
Wait Until 5 Seconds

Tap on Log in
Type 9000000000 in the mobile number field
Tap on Continue
Wait Until 3 Seconds
Type 123456 in the OTP field
Tap on Verify
Wait Until 5 Seconds

Validate that the home screen is visible

CLEAR_APP com.shopease.android

All nine commands

Command
What it does
Argument
Required

OPEN_APP <package>

Launches the app

Package name

Yes

KILL_APP <package>

Force-stops the app and clears it from memory

Package name

Yes

CLEAR_APP <package>

Wipes app data and resets to first-launch state

Package name

Yes

MINIMISE_APP <package>

Sends the app to the background

Package name

Yes

PRESS_DEVICE_BACK_BUTTON

Presses the Android hardware back button

None

SET_GPS(latitude=<lat>, longitude=<lon>)

Sets the device location

Named args in parentheses, latitude first

Yes, both

ENABLE_WIFI

Turns wifi on

None

DISABLE_WIFI

Turns wifi off

None

TOGGLE_LOCATION

Toggles location services

None

Syntax rules

Rule
Detail

Space before the package name

OPEN_APP com.shopease.android is the current form

Legacy separator

OPEN_APP:com.shopease.android (colon, no space) still works and appears in older scripts. It is tolerated, not recommended

Unsupported form

OPEN_APP:(com.shopease.android) — colon plus parentheses — is not supported

Package argument required

On OPEN_APP, KILL_APP, CLEAR_APP and MINIMISE_APP. A bare OPEN_APP, or KILL_APP : with nothing after it, fails by design. The editor offers a package-name dropdown for these commands

Spelling

MINIMIZE_APP (US spelling) and MINIMISE_APP are both accepted

SET_GPS arguments

Named, in parentheses, latitude first. Use real coordinates — ETA, pricing, distance and availability all key off them

One action per line

System commands are not chained

Using a variable for the package

For a script that runs against more than one build or environment:

Platform behavior

Command
Behavior

OPEN_APP / KILL_APP / MINIMISE_APP

✅ Supported

CLEAR_APP

✅ Real data wipe. The app resets to first-launch state

PRESS_DEVICE_BACK_BUTTON

✅ Presses the hardware back button

SET_GPS

✅ Supported

ENABLE_WIFI / DISABLE_WIFI

✅ Supported

TOGGLE_LOCATION

✅ Supported

Command
Behavior

OPEN_APP / KILL_APP / MINIMISE_APP

✅ Supported

CLEAR_APP

⚠️ Effectively does nothing - iOS doesn't support

PRESS_DEVICE_BACK_BUTTON

❌ Doesn't exist on iOS. Use Tap on the back button or a left-edge swipe

SET_GPS

⚠️ Set, but not reliably readable back on every device target

ENABLE_WIFI / DISABLE_WIFI

⚠️ Effectively does nothing - iOS doesn't support

TOGGLE_LOCATION

⚠️ Effectively does nothing - iOS doesn't support

Write a teardown

  1. Decide the platforms the test runs on.

  2. Add the teardown for those platforms as the last steps of the test.

  3. Validate the state the teardown leaves behind.

CLEAR_APP wipes app data, so one line resets the app to first launch.

CLEAR_APP is a no-op on iOS: a script that relies on it for clean state passes on Android and reuses state on iOS. Reset inside the app, or install fresh between tests.

Ordering

OPEN_APP comes first. Comments, CLEAR_APP, SET_GPS, PRESS_DEVICE_BACK_BUTTON, API steps and waits are allowed before it, for setting location or clearing state before the app launches.

Validate after them

System commands report nothing about the screen that follows. Follow the ones that change state with a validation.

Common mistakes

What you wrote
What happens

OPEN_APP with no package name

Fails by design. The argument is required

OPEN_APP:(com.shopease.android)

Not a supported form. Use a space

open_app com.shopease.android

System commands are written in capitals

OPEN_APP {{my_dataset}}

The whole row is serialized and the package name is parsed out of the wrong part of it

CLEAR_APP as the clean-state step in an iOS suite

Passes, does nothing, and the next test starts logged in

PRESS_DEVICE_BACK_BUTTON in a cross-platform script

Works on Android, doesn't exist on iOS. Use Tap on the back button or a left-edge swipe

TOGGLE_LOCATION as a dependable precondition

Unreliable. Drive the setting through the app or a module instead

KILL_APP and OPEN_APP on consecutive lines with no wait

The first tap after launch lands on a splash screen

Two system commands on one line

Only one is executed. One per line

Next


Last updated: 6 August 2026

Last updated

Was this helpful?