Device commands
The client provides methods to configure the device and start a session, while the session provides methods for user interaction.
Client
startSession()
Starts a session with the requested app, device, operating system, and other launch options.
Parameters
Name | Type | Description |
---|---|---|
|
| A JSON object describing the Configuration options for the device. |
setConfig()
Update the configured app, device, operating system, or other launch options. See Configuration for acceptable values.
Note: This will end any active sessions.
endSession()
Ends the active session or cancels any pending session requests.
Session
adbShellCommand
Executes an adb shell
command on the device (Android only)
allowInteractions()
Enables or disables all interactions on the device.
biometry()
Simulate a matching fingerprint (Android 8+ only)
end()
Ends the session
getUI()
Experimental The data structure of the response is subject to change
Returns an array of elements describing the current UI on the device.
heartbeat()
Sends a heartbeat to the server, resetting the inactivity timer of the session
keypress()
Sends a single key press to the device.
This can also be used to send hardware keys:
HOME
VOLUME_UP
(Android)VOLUME_DOWN
(Android)ANDROID_KEYCODE_MENU
(Android)
openUrl()
Opens a deep-link or web URL
restartApp()
Restarts the app
reinstallApp()
Reinstalls the app
rotate()
Rotates the device 90 degrees left or right
screenshot()
Takes a screenshot of the device and returns the data as a buffer.
Alternatively, it can return the data as a base64 encoded string
shake()
Shakes device (iOS only)
toggleSoftKeyboard()
Toggles the soft keyboard (iOS only)
setLanguage()
Changes the current language and restarts the app
type()
Types the given text
Typing is limited to 1000 characters at a time to ensure optimal performance and prevent potential disruptions. For larger payloads, you can use multiple 'type' operations.
waitForAnimations(options)
Waits until the there are no ongoing animations on the screen by waiting for the image to stabilize for at least 1 second.
Name | Type | Description |
---|---|---|
options.imageThreshold? |
| The threshold for the amount of pixels (in %) that can change between frames before the image is considered to be stable. (default 0.001) |
options.timeout? |
| The maximum amount of time (in ms) to wait for the image to stabilize. (default 10s) |
Last updated