Device commands
Last updated
Last updated
The client provides methods to configure the device and start a session, while the session provides methods for user interaction.
Starts a session with the requested app, device, operating system, and other launch options.
Parameters
Name | Type | Description |
---|---|---|
Update the configured app, device, operating system, or other launch options. See Configuration for acceptable values.
Note: This will end any active sessions.
Ends the active session or cancels any pending session requests.
Executes an adb shell
command on the device (Android only)
Enables or disables all interactions on the device.
Simulate a matching fingerprint (Android 8+ only)
Ends the session
Experimental The data structure of the response is subject to change
Returns an array of elements describing the current UI on the device.
Sends a heartbeat to the server, resetting the inactivity timer of the session
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)
Opens a deep-link or web URL
Launches the specified application using the provided appId
.
If the app is already running, it will be brought to the foreground instead of being relaunched. If the app was originally launched with params or a launchUrl, these will also be passed with this method.
Parameters
Restarts the app
Reinstalls the app
Rotates the device 90 degrees left or right
Takes a screenshot of the device and returns the data as a buffer.
Alternatively, it can return the data as a base64 encoded string
Shakes device
Toggles the soft keyboard (iOS only)
Changes the current language.
If your app does not automatically handle language/locale changes, you would need to explicitly call restartApp for this to take effect. Some apps might also cache data in the previously used language. In these cases use reinstallApp to clear any previous cached data.
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.
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 |
---|---|---|
Name | Type | Description |
---|---|---|
config?
Record<string, any>
A JSON object describing the Configuration options for the device.
appId
string
Android:
The app's package name / appId (e.g., com.example.app
) or packageName/activityName
. If no activity name is specified, it defaults to the main launch activity.
iOS:
The app's bundle identifier (e.g., com.example.app
).
options.imageThreshold?
number
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?
number
The maximum amount of time (in ms) to wait for the image to stabilize. (default 10s)