button
Press hardware keys on iOS simulators/devices and Android emulators/devices by device ID and key name; returns the pressed key or a clear error for unsupported or unreachable targets.
Instructions
Press a device hardware button (iOS simulator or physical device, Android emulator or device).
Supported buttons depend on the platform: buttons not present on the target (e.g. 'back' on iOS, 'actionButton' on Android, 'power' or 'appSwitch' on a physical iPhone) are rejected with a clear error.
Use when you need to trigger hardware button events.
Returns { pressed: buttonName }.
Fails if the device backend is not reachable: the simulator-server for iOS, or adb for Android.
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": {
"udid": "<udid>",
"button": "<button>"
},
"name": "button"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| udid | Yes | Target device id from `list-devices` (iOS UDID or Android serial). | |
| button | Yes | Hardware button to press |