Skip to main content

Trigger Shake Gesture on iOS Devices

Real Device Virtual Device

TestMu AI supports simulating a shake gesture on iOS Real Devices and iOS Simulators during Appium automation sessions. Apps often bind the shake gesture to actions such as switching between production and staging builds, opening debug menus, surfacing feedback prompts, or undoing the last action.

By the end of this document, you will be able to:

  • Trigger a shake gesture on iOS Real Devices and Simulators
  • Validate the response returned by the lambda_executor hook
  • Use the same hook inside Web Automation tests running on iOS Real Devices
note

This feature also works in Web Automation tests on Real Devices. The same lambda_executor script can be used inside your Appium-based web automation session.


Supported Platforms

PlatformOS Version
iOS Real DeviceiOS 16 and above
iOS Simulator (Virtual)All OS

Support for Automation on Mobile Devices

To trigger a shake gesture, use the lambda_executor Appium hook with the gestures action. No additional capability is required.


Supported Arguments

ArgumentTypeDescription
actionStringMust be "gestures" (lowercase).
arguments.shakeBooleanSet to true to trigger the shake. Set to false to skip without erroring.

💡 Note: The hook can be invoked multiple times in the same session.


Appium Hook Example

response = driver.execute_script(
'lambda_executor: {"action": "gestures", "arguments": {"shake": true}}'
)
# response → "shake gesture triggered successfully"

Response References

ScenarioResponse
shake: trueshake gesture triggered successfully
shake: falseshake gesture skipped (shake=false)
Wrong type for shakeargument 'shake' must be a boolean, got string
shake argument missingmissing required argument: shake
Wrong action casingPlease send a valid action for LambdaHook
Android sessionshake gesture is supported on iOS only

Test across 3000+ combinations of browsers, real devices & OS.

Book Demo

Help and Support

Related Articles