press_key
Simulate hardware or software key presses (BACK, HOME, ENTER, etc.) to control a mobile device during UI tests.
Instructions
Press a hardware/software key (BACK, HOME, ENTER, MENU, etc.)
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": {
"key": "<key>"
},
"name": "press_key"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Key name: BACK, HOME, ENTER, MENU, POWER, VOLUME_UP, VOLUME_DOWN, TAB, DELETE, DPAD_UP, DPAD_DOWN, DPAD_LEFT, DPAD_RIGHT, DPAD_CENTER, etc. | |
| device_id | No | Target device ID. If omitted, uses the default device. |