Press a phone hardware button once
hardware-buttonPress a device button once—volume, power, mute, sleep/wake, or media—to trigger OS-level actions without activating the session app.
Instructions
Press a phone hardware button once: volume-up, volume-down, power, mute, sleep, wake, media-play-pause, media-next, media-previous, media-rewind, or media-fast-forward. The press is dispatched without activating the session app and nothing is re-observed afterwards, so the OS decides what the key does — which audio stream a volume press moves, which media session a media key reaches, and whether the HUD shows, is device behavior this command does not claim. Power toggles the Android screen; sleep and wake are the explicit Android events that turn it off or on without toggling, and after a press that turns it off, later commands may hit a locked screen. Android (ADB-backed and Appium) presses all eleven on phones and tablets; a physical iPhone or iPad presses volume only through the local runner or Appium, never power, mute, sleep, wake, or media. iOS Simulators, Android TV and tvOS targets refuse this command. Times out after 90s.
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": {
"button": "<button>"
},
"name": "hardware-button"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| udid | No | Apple device or simulator UDID. | |
| button | Yes | One press each. volume-up and volume-down move the system volume stream the OS selects; power toggles the screen on Android; sleep and wake are the explicit Android events that turn the screen off or on without toggling; mute, media-play-pause, media-next, media-previous, media-rewind, and media-fast-forward are Android keys the OS routes to its own streams and media sessions. All of these except volume are refused on every Apple leaf. | |
| device | No | Device name; ids go in udid or serial. | |
| serial | No | Android, HarmonyOS, or Vega VVD serial. | |
| session | No | Session name. | |
| noRecord | No | Do not record this action. | |
| platform | No | Device platform. | |
| deviceTarget | No | Device form factor. |