Shake an iOS simulator or Android emulator
shakeSimulate a shake gesture on an iOS simulator or Android emulator so apps that respond to motion-shake or accelerometer events trigger, then take a snapshot to observe the result.
Instructions
Shake an iOS simulator or an Android emulator once. iOS posts the shake notification that Device > Shake in the Simulator app posts, which UIKit delivers to the app as a motion-shake event; it injects no accelerometer data, so an app that detects shakes through CoreMotion does not see it. Android swings the emulator's accelerometer about 2 g in alternating directions for about a second through the emulator console, then restores the reading it found, so an app that counts direction changes above a force threshold sees a shake. The shake is sent without activating the session app and nothing is re-observed afterwards, so take a snapshot to see what the app did with it. Physical devices, Android TV, remote provider devices, and every other platform refuse this command. Times out after 90s.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "shake"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| udid | No | Apple device or simulator UDID. | |
| 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. |