Skip to main content

Appium

getLogTypesโ€‹

Get available log types.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.getLogTypes()
Returnsโ€‹
  • <String[]> logTypes: The list of available log types, example: browser, driver.

getLogsโ€‹

Get the log for a given log type. Log buffer is reset after each request.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.getLogs(type)
Parametersโ€‹
NameTypeDetails
typestringthe log type
Returnsโ€‹
  • <Object[]> logs: The list of log entries.

getSessionโ€‹

Retrieve the capabilities of the current session.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use getAppiumSessionCapabilities instead

Usageโ€‹
driver.getSession()
Returnsโ€‹
  • <Object> capabilities: An object describing the session's capabilities.

getAppiumContextโ€‹

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.getAppiumContext()
Returnsโ€‹
  • <Context> context: a string representing the current context or null representing 'no context'

switchAppiumContextโ€‹

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.switchAppiumContext(name)
Parametersโ€‹
NameTypeDetails
namestringa string representing an available context

getAppiumContextsโ€‹

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.getAppiumContexts()
Returnsโ€‹
  • <Context[]> contexts: an array of strings representing available contexts, e.g. 'WEBVIEW', or 'NATIVE'

getAppiumCommandsโ€‹

Retrieve the endpoints and BiDi commands supported in the current session.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.getAppiumCommands()
Returnsโ€‹
  • <Object> commands: Supported endpoints and BiDi commands, each grouped into common, driver-specific, and plugin-specific endpoints/commands.

getAppiumExtensionsโ€‹

Retrieve the extension commands supported in the current session.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.getAppiumExtensions()
Returnsโ€‹
  • <Object> commands: Supported extension commands, grouped into driver-specific and plugin-specific commands.

getAppiumSessionCapabilitiesโ€‹

Retrieve the capabilities of the current session.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.getAppiumSessionCapabilities()
Returnsโ€‹
  • <Object> capabilities: An object describing the session's capabilities.

shakeโ€‹

Perform a shake action on the device.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: shake') instead

Usageโ€‹
driver.shake()
Supportโ€‹

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3)


lockโ€‹

Lock the device.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: lock', { ... }) instead

Usageโ€‹
driver.lock(seconds)
Parametersโ€‹
NameTypeDetails
seconds
optional
numberhow long to lock the screen (iOS only)
Supportโ€‹

Support for UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+) Support for Windows (10+)


unlockโ€‹

Unlock the device.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: unlock') instead

Usageโ€‹
driver.unlock()
Supportโ€‹

Support for UiAutomator (4.2+) Support for Windows (10+)


isLockedโ€‹

Check whether the device is locked or not.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: isLocked') instead

Usageโ€‹
driver.isLocked()
Returnsโ€‹
  • <boolean> isLocked: True if the device is locked, false if not
Supportโ€‹

Support for UiAutomator (4.2+) Support for Windows (10+)


startRecordingScreenโ€‹

Start recording the screen.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.startRecordingScreen(options)
Parametersโ€‹
NameTypeDetails
options
optional
objectcommand parameters that can contain keys like: remotePath, username, password, method, forceRestart, timeLimit, videoType, videoQuality, videoFps, bitRate, videoSize, bugReport (see more description in Appium docs)
Supportโ€‹

Support for XCUITest (9.3+) Support for UiAutomator (4.2+) Support for Windows (10+)


stopRecordingScreenโ€‹

Stop recording screen

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.stopRecordingScreen(remotePath, username, password, method)
Parametersโ€‹
NameTypeDetails
remotePath
optional
stringThe path to the remote location, where the resulting video should be uploaded. The following protocols are supported http/https, ftp. This option only has an effect if there is screen recording process in progreess and forceRestart parameter is not set to true. Null or empty string value (the default setting) means the content of resulting file should be encoded as Base64.
username
optional
stringThe name of the user for the remote authentication.
password
optional
stringThe password for the remote authentication.
method
optional
stringThe http multipart upload method name. The 'PUT' one is used by default.
Returnsโ€‹
  • <string> response: Base64 encoded string. If remote_path is set, the response is empty string
Supportโ€‹

Support for XCUITest (9.3+) Support for UiAutomator (4.2+) Support for Windows (10+)


getPerformanceDataTypesโ€‹

Returns the information types of the system state which is supported to read as like cpu, memory, network traffic, and battery.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: getPerformanceDataTypes') instead

Usageโ€‹
driver.getPerformanceDataTypes()
Returnsโ€‹
  • <string[]> performanceTypes: The available performance data types (cpuinfo|batteryinfo|networkinfo|memoryinfo)
Supportโ€‹

Support for UiAutomator (4.2+)


getPerformanceDataโ€‹

Returns the information of the system state which is supported to read as like cpu, memory, network traffic, and battery.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: getPerformanceData', { ... }) instead

Usageโ€‹
driver.getPerformanceData(packageName, dataType, dataReadTimeout)
Parametersโ€‹
NameTypeDetails
packageNamestringthe package name of the application
dataTypestringthe type of system state which wants to read. It should be one of the supported performance data types
dataReadTimeout
optional
numberthe number of attempts to read
Returnsโ€‹
  • <string[]> performanceData: The information type of the system state which is supported to read as like cpu, memory, network traffic, and battery
Supportโ€‹

Support for UiAutomator (4.2+)


pressKeyCodeโ€‹

Press a particular key on the device.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: pressKey', { ... }) instead

Usageโ€‹
driver.pressKeyCode(keycode, metastate, flags)
Parametersโ€‹
NameTypeDetails
keycodenumberkeycode to press
metastate
optional
numbermeta state to press the keycode with
flags
optional
numberflags for the keypress
Supportโ€‹

Support for UiAutomator (4.2+)


longPressKeyCodeโ€‹

Press and hold a particular key code on the device.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: pressKey', { ... }) instead

Usageโ€‹
driver.longPressKeyCode(keycode, metastate, flags)
Parametersโ€‹
NameTypeDetails
keycodenumberkeycode to press on the device
metastate
optional
numbermetastate for the keypress
flags
optional
numberflags for the keypress
Supportโ€‹

Support for UiAutomator (4.2+)


sendKeyEventโ€‹

Send a key code to the device.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: pressKey', { ... }) instead

Usageโ€‹
driver.sendKeyEvent(keycode, metastate)
Parametersโ€‹
NameTypeDetails
keycodestringkeycode to press
metastate
optional
stringmeta state to press the keycode with
Supportโ€‹

Support for UiAutomator (4.2+)


rotateDeviceโ€‹

Rotate the device in three dimensions.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.rotateDevice(x, y, z)
Parametersโ€‹
NameTypeDetails
xnumberx offset to use for the center of the rotate gesture
ynumbery offset to use for the center of the rotate gesture
znumberz offset to use for the center of the rotate gesture
Supportโ€‹

Support for UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+)


getCurrentActivityโ€‹

Get the name of the current Android activity.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: getCurrentActivity') instead

Usageโ€‹
driver.getCurrentActivity()
Returnsโ€‹
  • <string> activity: Name of the current activity
Supportโ€‹

Support for UiAutomator (4.2+)


getCurrentPackageโ€‹

Get the name of the current Android package.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: getCurrentPackage') instead

Usageโ€‹
driver.getCurrentPackage()
Returnsโ€‹
  • <string> package: Name of the current package
Supportโ€‹

Support for UiAutomator (4.2+)


installAppโ€‹

Install the given app onto the device.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.installApp(appPath, options)
Parametersโ€‹
NameTypeDetails
appPathstringPath to application .apk file
options
optional
objectDriver-specific installation options
Supportโ€‹

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+)


activateAppโ€‹

Activate the given app on the device

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.activateApp(appId, bundleId, options)
Parametersโ€‹
NameTypeDetails
appId
optional
stringApp package ID (required for Android)
bundleId
optional
stringBundle ID (required for iOS)
options
optional
objectDriver-specific launch options
Supportโ€‹

Support for XCUITest (9.3+) Support for UiAutomator (4.2+)


removeAppโ€‹

Remove an app from the device.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.removeApp(appId, bundleId, options)
Parametersโ€‹
NameTypeDetails
appId
optional
stringApp package ID (required for Android)
bundleId
optional
stringBundle ID (required for iOS)
options
optional
objectDriver-specific uninstall options
Returnsโ€‹
  • <boolean> didRemovalSucceed: Return true if uninstall was successful, false if not
Supportโ€‹

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+)


terminateAppโ€‹

Terminate the given app on the device

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.terminateApp(appId, bundleId, options)
Parametersโ€‹
NameTypeDetails
appId
optional
stringApp package ID (required for Android)
bundleId
optional
stringBundle ID (required for iOS)
options
optional
objectDriver-specific termination options
Supportโ€‹

Support for XCUITest (9.3+) Support for UiAutomator (4.2+)


isAppInstalledโ€‹

Check whether the specified app is installed on the device.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.isAppInstalled(appId, bundleId)
Parametersโ€‹
NameTypeDetails
appId
optional
stringApp package ID (required for Android)
bundleId
optional
stringBundle ID (required for iOS)
Returnsโ€‹
  • <boolean> isAppInstalled: Return true if installed, false if not
Supportโ€‹

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+)


queryAppStateโ€‹

Get the given app status on the device

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.queryAppState(appId, bundleId)
Parametersโ€‹
NameTypeDetails
appId
optional
stringApp package ID (required for Android)
bundleId
optional
stringBundle ID (required for iOS)
Returnsโ€‹
  • <number> appStatus: 0 is not installed. 1 is not running. 2 is running in background suspended. 3 is running in background. 4 is running in foreground
Supportโ€‹

Support for XCUITest (9.3+) Support for UiAutomator (4.2+)


hideKeyboardโ€‹

Hide soft keyboard.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.hideKeyboard(strategy, key, keyCode, keyName)
Parametersโ€‹
NameTypeDetails
strategy
optional
stringhide keyboard strategy (UIAutomation only), available strategies - 'press', 'pressKey', 'swipeDown', 'tapOut', 'tapOutside', 'default'
key
optional
stringkey value if strategy is 'pressKey'
keyCode
optional
stringkey code if strategy is 'pressKey'
keyName
optional
stringkey name if strategy is 'pressKey'
Supportโ€‹

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+) Support for Windows (10+)


isKeyboardShownโ€‹

Whether or not the soft keyboard is shown.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.isKeyboardShown()
Returnsโ€‹
  • <boolean> isKeyboardShown: True if the keyboard is shown
Supportโ€‹

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+) Support for Windows (10+)


pushFileโ€‹

Place a file onto the device in a particular place.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.pushFile(path, data)
Parametersโ€‹
NameTypeDetails
pathstringpath to install the data to
datastringcontents of file in base64
Supportโ€‹

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+) Support for Windows (10+)


pullFileโ€‹

Retrieve a file from the device's file system.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.pullFile(path)
Parametersโ€‹
NameTypeDetails
pathstringpath on the device to pull file from
Returnsโ€‹
  • <string> response: Contents of file in base64
Supportโ€‹

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+) Support for Windows (10+)


pullFolderโ€‹

Retrieve a folder from the device's file system.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.pullFolder(path)
Parametersโ€‹
NameTypeDetails
pathstringpath to an entire folder on the device
Returnsโ€‹
  • <string> response: Zip file of the folder contents in base64
Supportโ€‹

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+) Support for Windows (10+)


toggleAirplaneModeโ€‹

Toggle airplane mode on device.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: setConnectivity', { ... }) instead

Usageโ€‹
driver.toggleAirplaneMode()
Supportโ€‹

Support for UiAutomator (4.2+)


toggleDataโ€‹

Switch the state of data service.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: setConnectivity', { ... }) instead

Usageโ€‹
driver.toggleData()
Supportโ€‹

Support for UiAutomator (4.2+)


toggleWiFiโ€‹

Switch the state of the wifi service.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: setConnectivity', { ... }) instead

Usageโ€‹
driver.toggleWiFi()
Supportโ€‹

Support for UiAutomator (4.2+)


toggleLocationServicesโ€‹

Switch the state of the location service.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: toggleGps') instead

Usageโ€‹
driver.toggleLocationServices()
Supportโ€‹

Support for UiAutomator (4.2+)


toggleNetworkSpeedโ€‹

Set network speed (Emulator only)

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: networkSpeed', { ... }) instead

Usageโ€‹
driver.toggleNetworkSpeed(netspeed)
Parametersโ€‹
NameTypeDetails
netspeedstringNetwork type - 'full','gsm', 'edge', 'hscsd', 'gprs', 'umts', 'hsdpa', 'lte', 'evdo'
Supportโ€‹

Support for UiAutomator (4.2+)


openNotificationsโ€‹

Open Android notifications.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: openNotifications') or driver.execute('mobile: statusBar', { ... }) instead

Usageโ€‹
driver.openNotifications()
Supportโ€‹

Support for UiAutomator (4.2+)


startActivityโ€‹

Start an Android activity by providing package name and activity name.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: startActivity', { ... }) instead

Usageโ€‹
driver.startActivity(appPackage, appActivity, appWaitPackage, appWaitActivity, intentAction, intentCategory, intentFlags, optionalIntentArguments, dontStopAppOnReset)
Parametersโ€‹
NameTypeDetails
appPackagestringname of app
appActivitystringname of activity
appWaitPackage
optional
stringname of app to wait for
appWaitActivity
optional
stringname of activity to wait for
intentAction=android.intent.action.MAIN
optional
stringintent action which will be used to start activity
intentCategory=android.intent.category.LAUNCHER
optional
stringintent category which will be used to start activity
intentFlags=0x10200000
optional
stringflags that will be used to start activity
optionalIntentArguments
optional
stringadditional intent arguments that will be used to start activity
dontStopAppOnReset
optional
stringdoesnโ€™t stop the process of the app under test, before starting the app using adb
Supportโ€‹

Support for UiAutomator (4.2+)


getSystemBarsโ€‹

Retrieve visibility and bounds information of the status and navigation bars.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: getSystemBars') instead

Usageโ€‹
driver.getSystemBars()
Returnsโ€‹
  • <object[]> systemBars: Information about visibility and bounds of status and navigation bar
Supportโ€‹

Support for UiAutomator (4.2+)


getDeviceTimeโ€‹

Get the time on the device.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.getDeviceTime()
Returnsโ€‹
  • <string> time: Time on the device
Supportโ€‹

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+)


getDisplayDensityโ€‹

Get display density from device.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: getDisplayDensity') instead

Usageโ€‹
driver.getDisplayDensity()
Returnsโ€‹
  • <*>
Supportโ€‹

Support for UiAutomator (4.2+)


touchIdโ€‹

Simulate a touch id event (iOS Simulator only). To enable this feature, the allowTouchIdEnroll desired capability must be set to true and the Simulator must be enrolled. When you set allowTouchIdEnroll to true, it will set the Simulator to be enrolled by default. The enrollment state can be toggled. This call will only work if Appium process or its parent application (e.g. Terminal.app or Appium.app) has access to Mac OS accessibility in System Preferences > Security & Privacy > Privacy > Accessibility list.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: sendBiometricMatch', { ... }) instead

Usageโ€‹
driver.touchId(match)
Parametersโ€‹
NameTypeDetails
matchbooleanare we simulating a successful touch (true) or a failed touch (false)
Supportโ€‹

Support for XCUITest (9.3+)


toggleEnrollTouchIdโ€‹

Toggle the simulator being enrolled to accept touchId (iOS Simulator only). To enable this feature, the allowTouchIdEnroll desired capability must be set to true. When allowTouchIdEnroll is set to true the Simulator will be enrolled by default, and the 'Toggle Touch ID Enrollment' changes the enrollment state. This call will only work if the Appium process or its parent application (e.g., Terminal.app or Appium.app) has access to Mac OS accessibility in System Preferences > Security & Privacy > Privacy > Accessibility list.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: enrollBiometric', { ... }) instead

Usageโ€‹
driver.toggleEnrollTouchId(enabled)
Parametersโ€‹
NameTypeDetails
enabled=true
optional
booleanequals to true if TouchID enrollment should be enabled
Supportโ€‹

Support for XCUITest (9.3+)


launchAppโ€‹

Launch an app on device.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: launchApp', { ... }) (iOS) or driver.execute('mobile: activateApp', { ... }) (Android) instead

Usageโ€‹
driver.launchApp()
Supportโ€‹

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+)


closeAppโ€‹

Close an app on device.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: terminateApp', { ... }) instead

Usageโ€‹
driver.closeApp()
Supportโ€‹

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+)


backgroundโ€‹

Send the currently running app for this session to the background.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: backgroundApp', { ... }) instead

Usageโ€‹
driver.background(seconds)
Parametersโ€‹
NameTypeDetails
seconds=nullnumber, nullTimeout after which to restore the app. A value of -1 disables the timeout
Supportโ€‹

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+)


endCoverageโ€‹

Get test coverage data.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: shell', { ... }) instead

Usageโ€‹
driver.endCoverage(intent, path)
Parametersโ€‹
NameTypeDetails
intentstringintent to broadcast
pathstringpath to .ec file
Supportโ€‹

Support for UiAutomator (4.2+)


getStringsโ€‹

Get app strings.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: getAppStrings', { ... }) instead

Usageโ€‹
driver.getStrings(language, stringFile)
Parametersโ€‹
NameTypeDetails
language
optional
stringlanguage code
stringFile
optional
stringpath to the string file
Returnsโ€‹
  • <object> appStrings: all defined Strings from an app for the specified language and strings filename
Supportโ€‹

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+)


setValueImmediateโ€‹

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.addValue(...) or driver.setValue(...) instead

Usageโ€‹
driver.setValueImmediate(elementId, text)
Parametersโ€‹
NameTypeDetails
elementIdStringthe id of an element returned in a previous call to Find Element(s)
textstringtext to set to an element
Supportโ€‹

Support for XCUITest (9.3+) Support for UiAutomator (4.2+)


replaceValueโ€‹

Replace the value to element directly.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.addValue(...) or driver.setValue(...) instead

Usageโ€‹
driver.replaceValue(elementId, value)
Parametersโ€‹
NameTypeDetails
elementIdStringthe id of an element returned in a previous call to Find Element(s)
valuestringvalue to replace on element
Supportโ€‹

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+)


getSettingsโ€‹

Retrieve the current session settings.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.getSettings()
Returnsโ€‹
  • <object> settings: JSON hash of all the currently specified settings, see Settings API
Supportโ€‹

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+) Support for Windows (10+)


updateSettingsโ€‹

Update the session settings.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.updateSettings(settings)
Parametersโ€‹
NameTypeDetails
settingsobjectkey/value object with settings to update
Supportโ€‹

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+) Support for Windows (10+)


receiveAsyncResponseโ€‹

Callback url for asynchronous execution of JavaScript.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.executeAsyncScript(...) instead

Usageโ€‹
driver.receiveAsyncResponse(response)
Parametersโ€‹
NameTypeDetails
responseobjectresponse to receive on device
Supportโ€‹

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3)


gsmCallโ€‹

Make GSM call (Emulator only).

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: gsmCall', { ... }) instead

Usageโ€‹
driver.gsmCall(phoneNumber, action)
Parametersโ€‹
NameTypeDetails
phoneNumberstringthe phone number to call to
actionstringThe action - 'call', 'accept', 'cancel', 'hold'
Supportโ€‹

Support for UiAutomator (4.2+)


gsmSignalโ€‹

Set GSM signal strength (Emulator only).

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: gsmSignal', { ... }) instead

Usageโ€‹
driver.gsmSignal(signalStrength, signalStrengh)
Parametersโ€‹
NameTypeDetails
signalStrengthstringsignal strength in the range [0, 4]
signalStrengh
optional
stringsignal strength in the range [0, 4]. Please also set this parameter with the same value if you use Appium v1.11.0 or lower (see https://github.com/appium/appium/issues/12234).
Supportโ€‹

Support for UiAutomator (4.2+)


powerCapacityโ€‹

Set the battery percentage (Emulator only).

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: powerCapacity', { ... }) instead

Usageโ€‹
driver.powerCapacity(percent)
Parametersโ€‹
NameTypeDetails
percentnumberpercentage value in range [0, 100]
Supportโ€‹

Support for UiAutomator (4.2+)


powerACโ€‹

Set the state of the battery charger to connected or not (Emulator only).

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: powerAC', { ... }) instead

Usageโ€‹
driver.powerAC(state)
Parametersโ€‹
NameTypeDetails
statestringset the state. on or off
Supportโ€‹

Support for UiAutomator (4.2+)


gsmVoiceโ€‹

Set GSM voice state (Emulator only).

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: gsmVoice', { ... }) instead

Usageโ€‹
driver.gsmVoice(state)
Parametersโ€‹
NameTypeDetails
statestringstate of GSM voice - 'unregistered', 'home', 'roaming', 'searching', 'denied', 'off', 'on'
Supportโ€‹

Support for UiAutomator (4.2+)


sendSmsโ€‹

Simulate an SMS message (Emulator only).

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: sendSms', { ... }) instead

Usageโ€‹
driver.sendSms(phoneNumber, message)
Parametersโ€‹
NameTypeDetails
phoneNumberstringthe phone number to send the SMS too
messagestringthe SMS message
Supportโ€‹

Support for UiAutomator (4.2+)


fingerPrintโ€‹

Authenticate users by using their finger print scans on supported emulators.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: fingerPrint', { ... }) instead

Usageโ€‹
driver.fingerPrint(fingerprintId)
Parametersโ€‹
NameTypeDetails
fingerprintIdnumberfinger prints stored in Android Keystore system (from 1 to 10)
Supportโ€‹

Support for UiAutomator (4.2+)


setClipboardโ€‹

Set the content of the system clipboard

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: setClipboard', { ... }) instead

Usageโ€‹
driver.setClipboard(content, contentType, label)
Parametersโ€‹
NameTypeDetails
contentstringThe actual base64 encoded clipboard content
contentType
optional
stringThe type of the content to get. Plaintext, Image, URL. Android supports only plaintext
label
optional
stringClipboard data label for Android
Returnsโ€‹
  • <string> response: Response from Appium server
Supportโ€‹

Support for XCUITest (9.3+) Support for UiAutomator (4.2+)


getClipboardโ€‹

Get the content of the system clipboard

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.execute('mobile: getClipboard', { ... }) instead

Usageโ€‹
driver.getClipboard(contentType)
Parametersโ€‹
NameTypeDetails
contentType
optional
stringThe type of the content to get. Plaintext, Image, URL. Android supports only plaintext
Returnsโ€‹
  • <string> response: Clipboard content as base64-encoded string or an empty string if the clipboard is empty
Supportโ€‹

Support for XCUITest (9.3+) Support for UiAutomator (4.2+)


touchPerformโ€‹

This functionality is only available from within a native context. 'Touch Perform' works similarly to the other singular touch interactions, except that this allows you to chain together more than one touch action as one command. This is useful because Appium commands are sent over the network and there's latency between commands. This latency can make certain touch interactions impossible because some interactions need to be performed in one sequence. Vertical, for example, requires pressing down, moving to a different y coordinate, and then releasing. For it to work, there can't be a delay between the interactions.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.performActions(...) instead

Usageโ€‹
driver.touchPerform(actions)
Parametersโ€‹
NameTypeDetails
actionsobject[]The type of action to perform (e.g. moveTo, release, press, tap, wait)
Exampleโ€‹
// do a horizontal swipe by percentage
const startPercentage = 10;
const endPercentage = 90;
const anchorPercentage = 50;

const { width, height } = driver.getWindowSize();
const anchor = height * anchorPercentage / 100;
const startPoint = width * startPercentage / 100;
const endPoint = width * endPercentage / 100;
driver.touchPerform([
{
action: 'press',
options: {
x: startPoint,
y: anchor,
},
},
{
action: 'wait',
options: {
ms: 100,
},
},
{
action: 'moveTo',
options: {
x: endPoint,
y: anchor,
},
},
{
action: 'release',
options: {},
},
]);
Supportโ€‹

Support for UiAutomator (4.2+) Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for Windows (10+)


multiTouchPerformโ€‹

This functionality is only available from within a native context. Perform a multi touch action sequence.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.performActions(...) instead

Usageโ€‹
driver.multiTouchPerform(actions)
Parametersโ€‹
NameTypeDetails
actionsobject[]The type of action to perform (e.g. moveTo, release, press, tap, wait)
Supportโ€‹

Support for UiAutomator (4.2+) Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for Windows (10+)


executeDriverScriptโ€‹

Execute a script in a child process. This approach helps minimize potential latency associated with each command. Using this command in Appium 2 or later requires installing the execute-driver plugin.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.executeDriverScript(script, type, timeout)
Parametersโ€‹
NameTypeDetails
scriptstringThe script to execute. It has access to a 'driver' object which represents a WebdriverIO session attached to the current server.
type
optional
stringThe language/framework used in the script. Currently, only 'webdriverio' is supported and is the default.
timeout
optional
numberThe number of milliseconds the script should be allowed to run before being killed by the Appium server. Defaults to the equivalent of 1 hour.
Returnsโ€‹
  • <object> result: An object containing two fields: 'result', which is the return value of the script itself, and 'logs', which contains 3 inner fields, 'log', 'warn', and 'error', which hold an array of strings logged by console.log, console.warn, and console.error in the script's execution.

getEventsโ€‹

Get events logged in the current session.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.getEvents(type)
Parametersโ€‹
NameTypeDetails
type
optional
string, string[]One or more event types to filter the returned events
Returnsโ€‹
  • <object> result: A JSON hash of events like {'commands' => [{'cmd' => 123455, ....}], 'startTime' => 1572954894127, }.
Supportโ€‹

Support for UiAutomator (4.2+) Support for XCUITest (9.3+)


logEventโ€‹

Log a custom event.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.logEvent(vendor, event)
Parametersโ€‹
NameTypeDetails
vendorstringName of the namespace (vendor) used to prefix the event
eventstringName of the event
Supportโ€‹

Support for UiAutomator (4.2+) Support for XCUITest (9.3+)


compareImagesโ€‹

Compare two images using the specified mode of comparison. Using this command in Appium 2 or later requires installing the images plugin.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.compareImages(mode, firstImage, secondImage, options)
Parametersโ€‹
NameTypeDetails
modestringOne of possible comparison modes: 'matchFeatures', 'getSimilarity', 'matchTemplate'.
firstImagestringBase64-encoded image file.
secondImagestringBase64-encoded image file.
options=[object Object]
optional
objectThe supported values of this property depend on the mode value. See Appium documentation for more details.
Returnsโ€‹
  • <object> result: The content of the resulting dictionary depends on the mode and options values. See Appium documentation for more details.

implicitWaitโ€‹

Set the amount of time the driver should wait when searching for elements. When searching for a single element, the driver should poll the page until an element is found or the timeout expires, whichever occurs first. When searching for multiple elements, the driver should poll the page until at least one element is found or the timeout expires, at which point it should return an empty list. If this command is never sent, the driver should default to an implicit wait of 0ms.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.setTimeouts(...) instead

Usageโ€‹
driver.implicitWait(ms)
Parametersโ€‹
NameTypeDetails
msnumberThe amount of time, in milliseconds, to wait on an element.
Supportโ€‹

Support for UiAutomator (4.2+) Support for XCUITest (9.3+)


getLocationInViewโ€‹

Determine an element's location on the screen once it has been scrolled into view.

Note: This is considered an internal command and should only be used to determine an element's location for correctly generating native events.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.getElementRect(...) or element.getLocation() instead

Usageโ€‹
driver.getLocationInView(elementId)
Parametersโ€‹
NameTypeDetails
elementIdStringID of the element to route the command to
Returnsโ€‹
  • <Object> location: The X and Y coordinates for the element on the page.
Supportโ€‹

Support for UiAutomator (4.2+) Support for XCUITest (9.3+)


sendKeysโ€‹

Send a sequence of key strokes to the active element

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.performActions(...) with keyUp and keyDown actions instead

Usageโ€‹
driver.sendKeys(value)
Parametersโ€‹
NameTypeDetails
valuestring[]The sequence of keys to type. An array must be provided.
Supportโ€‹

Support for UiAutomator (4.2+) Support for XCUITest (9.3+)


availableIMEEnginesโ€‹

List all available IME engines on the device. To use an engine, it has to be present in this list.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.availableIMEEngines()
Returnsโ€‹
  • <String[]> engines: A list of available engines
Supportโ€‹

Support for UiAutomator (4.2+)


getActiveIMEEngineโ€‹

Get the name of the active IME engine. The name string is platform specific.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.getActiveIMEEngine()
Returnsโ€‹
  • <String> engine: The name of the active IME engine
Supportโ€‹

Support for UiAutomator (4.2+)


isIMEActivatedโ€‹

Indicates whether IME input is active at the moment

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.isIMEActivated()
Returnsโ€‹
  • <Boolean> isActive: true if IME input is available and currently active, false otherwise
Supportโ€‹

Support for UiAutomator (4.2+)


deactivateIMEEngineโ€‹

De-activates the currently-active IME engine.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.deactivateIMEEngine()
Supportโ€‹

Support for UiAutomator (4.2+)


activateIMEEngineโ€‹

Activates an IME engine.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.activateIMEEngine(engine)
Parametersโ€‹
NameTypeDetails
enginestringname of the engine to activate
Supportโ€‹

Support for UiAutomator (4.2+)


asyncScriptTimeoutโ€‹

Set the amount of time, in milliseconds, that asynchronous scripts executed by /session/:sessionId/execute_async are permitted to run before they are aborted and a Timeout error is returned to the client.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.setTimeouts(...) instead

Usageโ€‹
driver.asyncScriptTimeout(ms)
Parametersโ€‹
NameTypeDetails
msnumberThe amount of time, in milliseconds, that time-limited commands are permitted to run
Supportโ€‹

Support for XCUITest (9.3+)


submitโ€‹

Submit a form element.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Please explicitly find and click the submit element

Usageโ€‹
driver.submit(elementId)
Parametersโ€‹
NameTypeDetails
elementIdStringID of the form element to be submitted
Supportโ€‹

Support for XCUITest (9.3+)


getElementSizeโ€‹

Determine an element's size in pixels. The size will be returned as a JSON object with width and height properties.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.getElementRect(...) or element.getSize() instead

Usageโ€‹
driver.getElementSize(elementId)
Parametersโ€‹
NameTypeDetails
elementIdStringID of the element to route the command to
Returnsโ€‹
  • <Object> size: The width and height of the element, in pixels.
Supportโ€‹

Support for UiAutomator (4.2+) Support for XCUITest (9.3+)


getElementLocationโ€‹

Determine an element's location on the page. The point (0, 0) refers to the upper-left corner of the page. The element's coordinates are returned as a JSON object with x and y properties.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.getElementRect(...) or element.getLocation() instead

Usageโ€‹
driver.getElementLocation(elementId)
Parametersโ€‹
NameTypeDetails
elementIdStringID of the element to route the command to
Returnsโ€‹
  • <Object> location: The X and Y coordinates for the element on the page.
Supportโ€‹

Support for UiAutomator (4.2+) Support for XCUITest (9.3+)


touchClickโ€‹

Single tap on the touch enabled device.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.performActions(...) with pointerDown and pointerUp actions instead

Usageโ€‹
driver.touchClick(element)
Parametersโ€‹
NameTypeDetails
elementstringID of the element to single tap on.
Supportโ€‹

Support for UiAutomator (4.2+) Support for XCUITest (9.3+)


touchDownโ€‹

Finger down on the screen.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.performActions(...) with a pointerDown action instead

Usageโ€‹
driver.touchDown(x, y)
Parametersโ€‹
NameTypeDetails
xnumberx coordinate on the screen
ynumbery coordinate on the screen
Supportโ€‹

Support for UiAutomator (4.2+)


touchUpโ€‹

Finger up on the screen.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.performActions(...) with a pointerUp action instead

Usageโ€‹
driver.touchUp(x, y)
Parametersโ€‹
NameTypeDetails
xnumberx coordinate on the screen
ynumbery coordinate on the screen
Supportโ€‹

Support for UiAutomator (4.2+)


touchMoveโ€‹

Finger move on the screen.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.performActions(...) with a pointerMove action instead

Usageโ€‹
driver.touchMove(x, y)
Parametersโ€‹
NameTypeDetails
xnumberx coordinate on the screen
ynumbery coordinate on the screen
Supportโ€‹

Support for UiAutomator (4.2+)


touchLongClickโ€‹

Long press on the touch screen using finger motion events.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.performActions(...) with pointerDown, pause and pointerUp actions instead

Usageโ€‹
driver.touchLongClick(element)
Parametersโ€‹
NameTypeDetails
elementstringID of the element to long press on
Supportโ€‹

Support for UiAutomator (4.2+)


touchFlickโ€‹

Flick on the touch screen using finger motion events. This flick command starts at a particular screen location.

Appium command. More details can be found in the official protocol docs.

caution

This protocol command is deprecated
Use driver.performActions(...) with pointerDown, pointerMove and pointerUp actions instead

Usageโ€‹
driver.touchFlick(xoffset, yoffset, element, speed, xspeed, yspeed)
Parametersโ€‹
NameTypeDetails
xoffset
optional
numberthe x offset in pixels to flick by
yoffset
optional
numberthe y offset in pixels to flick by
element
optional
stringID of the element where the flick starts
speed
optional
numberthe speed in pixels per seconds
xspeed
optional
numberthe x speed in pixels per second
yspeed
optional
numberthe y speed in pixels per second
Supportโ€‹

Support for UiAutomator (4.2+)


getOrientationโ€‹

Get the current device orientation.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.getOrientation()
Returnsโ€‹
  • <String> orientation: The current orientation corresponding to a value defined in ScreenOrientation: LANDSCAPE|PORTRAIT.
Supportโ€‹

Support for UiAutomator (4.2+) Support for XCUITest (9.3+)


setOrientationโ€‹

Set the device orientation

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.setOrientation(orientation)
Parametersโ€‹
NameTypeDetails
orientationstringthe new browser orientation as defined in ScreenOrientation: LANDSCAPE|PORTRAIT
Supportโ€‹

Support for UiAutomator (4.2+) Support for XCUITest (9.3+)


getGeoLocationโ€‹

Get the current geo location.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.getGeoLocation()
Returnsโ€‹
  • <Object> location: The current geo location.

setGeoLocationโ€‹

Set the current geo location.

Appium command. More details can be found in the official protocol docs.

Usageโ€‹
driver.setGeoLocation(location)
Parametersโ€‹
NameTypeDetails
locationobjectthe new location ({latitude: number, longitude: number, altitude: number})

Welcome! How can I help?

WebdriverIO AI Copilot