wait_for
This tool on every surface: CLI · MCP · Python · JavaScript · Go · Java · .NET
Wait until an element appears, disappears, shows particular text, or reaches a state — enabled, checked, focused, holding a value — then return. These call app_wait_for.
wait_for
def wait_for(target: str, condition: str='visible', text: str | None=None, timeout_ms: int=10000, negate: bool=False, exact: bool=False, count: int | None=None) -> Element | None
Block until the screen agrees, instead of sleeping.
condition is "visible" (default), "hidden", "text" — which needs the text to wait for — "value", a field's whole content ("" for empty; a password field is refused), "enabled", "disabled", "checked", "unchecked", "focused" or "count" (with count). negate waits for the opposite; exact makes "text" match the whole text. Raises MobiumError if it never happens, saying what was on screen instead.
On success the screen is remapped, so the element returned already has a ref that can be tapped without calling map() first. Nothing is returned when waiting for something to go away.
Examples
Wait for text to appear
el = device.wait_for("text=Welcome back")
device.tap(el.ref)
Wait for a spinner to go
device.wait_for("role=progressbar", condition="hidden")
Wait for a checkbox to be checked, for up to five seconds
device.wait_for("testid=termsCheck", condition="checked", timeout_ms=5000)
The same call from the command line, mobium wait testid=termsCheck --for checked --timeout 5s, printed on an Android 15 emulator:
testid=termsCheck is checked after 18ms — @e3 Accept terms (checkbox, checked)
On a device

mobium wait testid=loginError --for text --text 'Incorrect username or password.' on an Android 15 emulator