Skip to main content

set · unset

This tool on every surface: CLI · MCP · Python · JavaScript · Go · Java · .NET

Put a checkbox or switch into a state, rather than toggling whatever it is in. These call app_set.

set​

public void set(String target, boolean value)

Puts a checkbox or switch into a state, rather than toggling it.

Idempotent: asking for a state it is already in does nothing, which is what makes it safe to call without reading first. Anything with no checked state is refused rather than tapped, and a radio cannot be unchecked — a group is cleared by choosing a different member.

@param target a ref from map() such as "@e5", or a locator such as "text=Sign in" @param value true to check it or turn it on, false to clear it or turn it off

unset​

public void unset(String target)

set(target, false): a checkbox cleared, a switch turned off.

@param target a ref from map() such as "@e5", or a locator such as "text=Sign in"

Examples​

Tick a checkbox, whatever state it is in​

device.set("testid=termsCheck", true); // does nothing if it is already ticked

The same call from the command line, mobium set testid=termsCheck, printed on an Android 15 emulator:

testid=termsCheck is now checked
BeforeAfter
Before: mobium set testid=termsCheck on an Android 15 emulatorAfter: mobium set testid=termsCheck on an Android 15 emulator

mobium set testid=termsCheck on an Android 15 emulator

Turn a switch off​

device.unset("@e4");

On a device​

BeforeAfter
Before: mobium unset testid=termsCheck on an Android 15 emulatorAfter: mobium unset testid=termsCheck on an Android 15 emulator

mobium unset testid=termsCheck on an Android 15 emulator