wait_for_activity
Wait until a specified Android activity becomes the foreground (resumed) activity, with configurable timeout and polling interval. Use it to synchronize test steps after launching or navigating to a screen.
Instructions
Wait until a specific activity becomes the foreground (resumed) activity
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"activity": "<activity>"
},
"name": "wait_for_activity"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| activity | Yes | Activity name or partial match (e.g., '.MainActivity' or 'com.example/.MainActivity') | |
| device_id | No | Target device ID. If omitted, uses the default device. | |
| timeout_ms | No | Maximum time to wait in milliseconds (default: 10000) | |
| poll_interval_ms | No | Polling interval in milliseconds (default: 500) |