Device Shake (FR)
Perfecto Command
perfecto:handset:shake
Purpose
On iOS: Triggers a virtual shake gesture on the device to activate features or modes that rely on physical shaking, such as entering development or test mode. You can also use it to trigger the React Native development menu in debuggable apps.
On Android: Only triggers the React Native development menu in debuggable apps. This feature requires enablement. To request this feature for your cloud, contact Perfecto Support.
Limitations
Shake gesture simulation is supported on Android 11 and later. On earlier versions, availability may vary depending on the device manufacturer and system configuration. On some devices, especially those running Android 9 or missing system components, the shake gesture may not function as expected.
Parameters
None
Return Value
OK
Exceptions
The following exceptions may occur when working with Android devices.
|
Exception |
Code | Description |
|---|---|---|
|
|
554 |
Thrown if the |
|
|
1206 |
Thrown if no foreground application is detected |
|
|
403 |
Thrown if the application currently in the foreground does not support this operation (if it is not a React Native debuggable app) |
Example
Java sample
Map<String, String> params = new HashMap<>();
getDriver().executeScript(“perfecto:handset:shake”, params);