android_send_key_event
Simulate hardware button presses on Android devices, such as HOME, BACK, or ENTER, for automated testing and remote control.
Instructions
Send a key event to the Android device (e.g., KEYEVENT_HOME, KEYEVENT_BACK, KEYEVENT_ENTER)
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": {
"keyCode": "<keyCode>"
},
"name": "android_send_key_event"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keyCode | Yes | Key event code (e.g., KEYEVENT_HOME, KEYEVENT_BACK, KEYEVENT_ENTER, 3 for HOME, 4 for BACK). Can be key name or numeric code. | |
| deviceSerial | No | Specific device serial number to target (optional) |