Skip to content

Command Reference

Commands

background

POST /session/:sessionId/appium/app/background

Close app (simulate device home button). It is possible to restore the app after the timeout or keep it minimized based on the parameter value.

Required Parameters
  • seconds

closeApp

POST /session/:sessionId/appium/app/close

Stop the session without stopping the session

launchApp

POST /session/:sessionId/appium/app/launch

Start the session after it has been started.

reset

POST /session/:sessionId/appium/app/reset

Reset the current session (run the delete session and create session subroutines)

Deprecated

Use explicit session management commands instead

Response

null

getStrings

POST /session/:sessionId/appium/app/strings

Return the language-specific strings for an app

Optional Parameters
  • language
  • stringFile

queryAppState

POST /session/:sessionId/appium/device/app_state

Get the running state of an app

getClipboard

POST /session/:sessionId/appium/device/get_clipboard

Gets the content of the primary clipboard on the device under test.

Optional Parameters
  • contentType

isLocked

POST /session/:sessionId/appium/device/is_locked

Determine whether the device is locked

lock

POST /session/:sessionId/appium/device/lock

Lock the device (and optionally unlock the device after a certain amount of time)

Default Value

0

Optional Parameters
  • seconds

setClipboard

POST /session/:sessionId/appium/device/set_clipboard

Sets the primary clipboard's content on the device under test.

Required Parameters
  • content
Optional Parameters
  • contentType
  • label

mobileShake

POST /session/:sessionId/appium/device/shake

Shake the device

unlock

POST /session/:sessionId/appium/device/unlock

Unlock the device

setValueImmediate

POST /session/:sessionId/appium/element/:elementId/value

Deprecated

Required Parameters
  • text

receiveAsyncResponse

POST /session/:sessionId/appium/receive_async_response

Collect the response of an async script execution

Deprecated

Required Parameters
  • response

toggleEnrollTouchId

POST /session/:sessionId/appium/simulator/toggle_touch_id_enrollment

Toggle whether the device is enrolled in the touch ID program

Optional Parameters
  • enabled

touchId

POST /session/:sessionId/appium/simulator/touch_id

Trigger a touch/fingerprint match or match failure

Required Parameters
  • match

startRecordingScreen

POST /session/:sessionId/appium/start_recording_screen

Direct Appium to start recording the device screen

Record the display of devices running iOS Simulator since Xcode 9 or real devices since iOS 11 (ffmpeg utility is required: 'brew install ffmpeg'). It records screen activity to a MPEG-4 file. Audio is not recorded with the video file. If screen recording has been already started then the command will stop it forcefully and start a new one. The previously recorded video file will be deleted.

Throws

If screen recording has failed to start.

Optional Parameters
  • options

stopRecordingScreen

POST /session/:sessionId/appium/stop_recording_screen

Direct Appium to stop screen recording and return the video

If no screen recording process is running then the endpoint will try to get the recently recorded file. If no previously recorded file is found and no active screen recording processes are running then the method returns an empty string.

Throws

If there was an error while getting the name of a media file or the file content cannot be uploaded to the remote location.

Optional Parameters
  • options

getLocation

GET /session/:sessionId/element/:elementId/location

Get the position of an element on screen

Deprecated

Use XCUITestDriver.getElementRect instead

getLocationInView

GET /session/:sessionId/element/:elementId/location_in_view

Alias for XCUITestDriver.getLocation

Deprecated

Use XCUITestDriver.getElementRect instead

getSize

GET /session/:sessionId/element/:elementId/size

Get the size of an element

submit

POST /session/:sessionId/element/:elementId/submit

Submit the form an element is in

keys

POST /session/:sessionId/keys

Send keys to the app

Deprecated

Use XCUITestDriver.setValue instead

Required Parameters
  • value

moveTo

POST /session/:sessionId/moveto

Move the mouse pointer to a particular screen location

Deprecated

Use XCUITestDriver.performActions instead

Optional Parameters
  • element
  • xoffset
  • yoffset

asyncScriptTimeout

POST /session/:sessionId/timeouts/async_script

Alias for XCUITestDriver.scriptTimeoutW3C.

Deprecated

Use XCUITestDriver.scriptTimeoutW3C instead

Required Parameters
  • ms

implicitWait

POST /session/:sessionId/timeouts/implicit_wait

Set the implicit wait timeout

Deprecated

Use timeouts instead

Parameters

Name Type Description
ms string | number the timeout in ms

Response

null

click

POST /session/:sessionId/touch/click

Click/tap an element

See

https://w3c.github.io/webdriver/#element-click

Required Parameters
  • element

performMultiAction

POST /session/:sessionId/touch/multi/perform

Perform a set of touch actions

Deprecated

Use XCUITestDriver.performActions instead

Required Parameters
  • actions
Optional Parameters
  • elementId

performTouch

POST /session/:sessionId/touch/perform

Perform a set of touch actions

Deprecated

Use XCUITestDriver.performActions instead

Required Parameters
  • actions

getWindowSize

GET /session/:sessionId/window/:windowhandle/size

Get the window size

Deprecated

Use XCUITestDriver.getWindowRect instead.

getPageSource

GET /session/:sessionId/source

Get the current page/app source as HTML/XML

See

https://w3c.github.io/webdriver/#get-page-source

getSettings

GET /session/:sessionId/appium/settings

Get the current settings for the session

Response

StringRecord<any>

The settings object

updateSettings

POST /session/:sessionId/appium/settings

Get the current settings for the session

Required Parameters
  • settings

Response

StringRecord<any>

The settings object

createSession

POST /session

Historically the first two arguments were reserved for JSONWP capabilities. Appium 2 has dropped the support of these, so now we only accept capability objects in W3C format and thus allow any of the three arguments to represent the latter.

See

https://w3c.github.io/webdriver/#new-session

Parameters

Name Type Description
desiredCapabilities? any the new session capabilities
requiredCapabilities? any another place the new session capabilities could be sent (typically left undefined)
capabilities? any another place the new session capabilities could be sent (typically left undefined)

Response

[string, DriverCaps<{ absoluteWebLocations: { isBoolean: true = true } ; additionalWebviewBundleIds: {} = {}; agentPath: { isString: true = true } ; allowProvisioningDeviceRegistration: { isBoolean: true = true } ; app: { isString: true = true } ; appInstallStrategy: { inclusionCaseInsensitive: readonly ["serial", "parallel", "ios-deploy"] ; isString: true = true } ; appPushTimeout: { isNumber: true = true } ; autoAcceptAlerts: { isBoolean: true = true } ; autoDismissAlerts: { isBoolean: true = true } ; bootstrapPath: { isString: true = true } ; browserName: { isString: true = true } ; bundleId: { isString: true = true } ; calendarAccessAuthorized: { isBoolean: true = true } ; calendarFormat: { isString: true = true } ; clearSystemFiles: { isBoolean: true = true } ; commandTimeouts: {} = {}; connectHardwareKeyboard: { isBoolean: true = true } ; customSSLCert: { isString: true = true } ; derivedDataPath: { isString: true = true } ; deviceName: { isString: true = true } ; disableAutomaticScreenshots: { isBoolean: true = true } ; enableAsyncExecuteFromHttps: { isBoolean: true = true } ; enablePerformanceLogging: { isBoolean: true = true } ; enforceAppInstall: { isBoolean: true = true } ; enforceFreshSimulatorCreation: { isBoolean: true = true } ; forceAppLaunch: { isBoolean: true = true } ; forceTurnOnSoftwareKeyboardSimulator: { isBoolean: true = true } ; fullContextList: { isBoolean: true = true } ; ignoreAboutBlankUrl: { isBoolean: true = true } ; includeDeviceCapsToSessionInfo: { isBoolean: true = true } ; includeSafariInWebviews: { isBoolean: true = true } ; iosInstallPause: { isNumber: true = true } ; iosSimulatorLogsPredicate: { isString: true = true } ; isHeadless: { isBoolean: true = true } ; keepKeyChains: { isBoolean: true = true } ; keychainPassword: { isString: true = true } ; keychainPath: { isString: true = true } ; keychainsExcludePatterns: { isString: true = true } ; launchWithIDB: { isBoolean: true = true } ; localizableStringsDir: { isString: true = true } ; maxTypingFrequency: { isNumber: true = true } ; mjpegScreenshotUrl: { isString: true = true } ; mjpegServerPort: { isNumber: true = true } ; nativeTyping: { isBoolean: true = true } ; nativeWebTap: { isBoolean: true = true } ; nativeWebTapStrict: { isBoolean: true = true } ; otherApps: { isString: true = true } ; permissions: { isString: true = true } ; platformName: { inclusionCaseInsensitive: readonly ["iOS", "tvOS"] ; isString: true = true; presence: true = true } ; prebuildWDA: { isBoolean: true = true } ; processArguments: {} = {}; reduceMotion: { isBoolean: true = true } ; reduceTransparency: { isBoolean: true = true } ; remoteDebugProxy: { isString: true = true } ; resetLocationService: { isBoolean: true = true } ; resetOnSessionStartOnly: { isBoolean: true = true } ; resultBundlePath: { isString: true = true } ; resultBundleVersion: { isNumber: true = true } ; safariAllowPopups: { isBoolean: true = true } ; safariGarbageCollect: { isBoolean: true = true } ; safariGlobalPreferences: { isObject: true = true } ; safariIgnoreFraudWarning: { isBoolean: true = true } ; safariIgnoreWebHostnames: { isString: true = true } ; safariInitialUrl: { isString: true = true } ; safariLogAllCommunication: { isBoolean: true = true } ; safariLogAllCommunicationHexDump: { isBoolean: true = true } ; safariOpenLinksInBackground: { isBoolean: true = true } ; safariShowFullResponse: { isBoolean: true = true } ; safariSocketChunkSize: { isNumber: true = true } ; safariWebInspectorMaxFrameLength: { isNumber: true = true } ; scaleFactor: { isString: true = true } ; screenshotQuality: { isNumber: true = true } ; shouldTerminateApp: { isBoolean: true = true } ; shouldUseSingletonTestManager: { isBoolean: true = true } ; showIOSLog: { isBoolean: true = true } ; showSafariConsoleLog: { isBoolean: true = true } ; showSafariNetworkLog: { isBoolean: true = true } ; showXcodeLog: { isBoolean: true = true } ; shutdownOtherSimulators: { isBoolean: true = true } ; simpleIsVisibleCheck: { isBoolean: true = true } ; simulatorDevicesSetPath: { isString: true = true } ; simulatorPasteboardAutomaticSync: { isString: true = true } ; simulatorStartupTimeout: { isNumber: true = true } ; simulatorTracePointer: { isBoolean: true = true } ; simulatorWindowCenter: { isString: true = true } ; skipLogCapture: { isBoolean: true = true } ; udid: { isString: true = true } ; updatedWDABundleId: { isString: true = true } ; useJSONSource: { isBoolean: true = true } ; useNativeCachingStrategy: { isBoolean: true = true } ; useNewWDA: { isBoolean: true = true } ; usePrebuiltWDA: { isBoolean: true = true } ; usePreinstalledWDA: { isBoolean: true = true } ; useSimpleBuildTest: { isBoolean: true = true } ; useXctestrunFile: { isBoolean: true = true } ; waitForIdleTimeout: { isNumber: true = true } ; waitForQuiescence: { isBoolean: true = true } ; wdaBaseUrl: { isString: true = true } ; wdaConnectionTimeout: { isNumber: true = true } ; wdaEventloopIdleDelay: { isNumber: true = true } ; wdaLaunchTimeout: { isNumber: true = true } ; wdaLocalPort: { isNumber: true = true } ; wdaStartupRetries: { isNumber: true = true } ; wdaStartupRetryInterval: { isNumber: true = true } ; webDriverAgentUrl: { isString: true = true } ; webkitResponseTimeout: { isNumber: true = true } ; webviewConnectRetries: { isNumber: true = true } ; webviewConnectTimeout: { isNumber: true = true } ; xcodeConfigFile: { isString: true = true } ; xcodeOrgId: { isString: true = true } ; xcodeSigningId: { isString: true = true } }>]

The capabilities object representing the created session

deleteSession

DELETE /session/:sessionId

Get session capabilities merged with what WDA reports This is a library command but needs to call 'super' so can't be on a helper object

Response

any

A session data object

getSession

GET /session/:sessionId

Get session capabilities merged with what WDA reports This is a library command but needs to call 'super' so can't be on a helper object

Response

any

A session data object

findElement

POST /session/:sessionId/element

Find a UI element given a locator strategy and a selector, erroring if it can't be found

See

https://w3c.github.io/webdriver/#find-element

Parameters

Name Type Description
using string the locator strategy
value string the selector to combine with the strategy to find the specific element

Response

Element<string>

The element object encoding the element id which can be used in element-related commands

findElementFromElement

POST /session/:sessionId/element/:elementId/element

Find a UI element given a locator strategy and a selector, erroring if it can't be found. Only look for elements among the set of descendants of a given element

See

https://w3c.github.io/webdriver/#find-element-from-element

Parameters

Name Type Description
using string the locator strategy
value string the selector to combine with the strategy to find the specific element

Response

Element<string>

The element object encoding the element id which can be used in element-related commands

findElementFromShadowRoot

POST /session/:sessionId/shadow/:shadowId/element

Find an element from a shadow root

See

https://w3c.github.io/webdriver/#find-element-from-shadow-root

Parameters

Name Type Description
using string the locator strategy
value string the selector to combine with the strategy to find the specific elements

Response

Element<string>

The element inside the shadow root matching the selector

findElements

POST /session/:sessionId/elements

Find a a list of all UI elements matching a given a locator strategy and a selector

See

https://w3c.github.io/webdriver/#find-elements

Parameters

Name Type Description
using string the locator strategy
value string the selector to combine with the strategy to find the specific elements

Response

Element<string>[]

A possibly-empty list of element objects

findElementsFromElement

POST /session/:sessionId/element/:elementId/elements

Find a a list of all UI elements matching a given a locator strategy and a selector. Only look for elements among the set of descendants of a given element

See

https://w3c.github.io/webdriver/#find-elements-from-element

Parameters

Name Type Description
using string the locator strategy
value string the selector to combine with the strategy to find the specific elements

Response

Element<string>[]

A possibly-empty list of element objects

findElementsFromShadowRoot

POST /session/:sessionId/shadow/:shadowId/elements

Find elements from a shadow root

See

https://w3c.github.io/webdriver/#find-element-from-shadow-root

Parameters

Name Type Description
using string the locator strategy
value string the selector to combine with the strategy to find the specific elements

Response

Element<string>[]

A possibly empty list of elements inside the shadow root matching the selector

getLog

POST /session/:sessionId/log

Get the log for a given log type.

Parameters

Name Type Description
type string Name/key of log type as defined in ILogCommands.supportedLogTypes.

Response

unknown[]

getLog

POST /session/:sessionId/se/log

Get the log for a given log type.

Parameters

Name Type Description
type string Name/key of log type as defined in ILogCommands.supportedLogTypes.

Response

unknown[]

getLogEvents

POST /session/:sessionId/appium/events

Get a list of events that have occurred in the current session

Parameters

Name Type Description
type? string | string[] filter the returned events by including one or more types

Response

EventHistory | Record<string, number>

The event history for the session

getLogTypes

GET /session/:sessionId/log/types

Get available log types as a list of strings

Response

string[]

getLogTypes

GET /session/:sessionId/se/log/types

Get available log types as a list of strings

Response

string[]

getSessions

GET /sessions

Get data for all sessions running on an Appium server

Response

MultiSessionData<Constraints>[]

A list of session data objects

getStatus

GET /status

Summary

Retrieve the server's current status.

Description

Returns information about whether a remote end is in a state in which it can create new sessions and can additionally include arbitrary meta information that is specific to the implementation.

The readiness state is represented by the ready property of the body, which is false if an attempt to create a session at the current time would fail. However, the value true does not guarantee that a New Session command will succeed.

Implementations may optionally include additional meta information as part of the body, but the top-level properties ready and message are reserved and must not be overwritten.

Examples

JavaScript
// webdriver.io example
await driver.status();
Python
driver.get_status()
Java
driver.getStatus();
Ruby
# ruby_lib example
remote_status

# ruby_lib_core example
@driver.remote_status

Response

Object

getTimeouts

GET /session/:sessionId/timeouts

Set the various timeouts associated with a session

See

https://w3c.github.io/webdriver/#set-timeouts

Response

null

timeouts

POST /session/:sessionId/timeouts

Set the various timeouts associated with a session

See

https://w3c.github.io/webdriver/#set-timeouts

Parameters

Name Type Description
type? string used only for the old (JSONWP) command, the type of the timeout
ms? string | number used only for the old (JSONWP) command, the ms for the timeout
script? number the number in ms for the script timeout, used for the W3C command
pageLoad? number the number in ms for the pageLoad timeout, used for the W3C command
implicit? string | number the number in ms for the implicit wait timeout, used for the W3C command

Response

null

logCustomEvent

POST /session/:sessionId/appium/log_event

Add a custom-named event to the Appium event log

Parameters

Name Type Description
vendor string the name of the vendor or tool the event belongs to, to namespace the event
event string the name of the event itself

Response

null

Execute Methods

Script: mobile: activateApp

Route

POST /session/:sessionId/execute

Script: mobile: activeAppInfo

Returns ActiveApp info.

Throws

if an error raised by command

Route

POST /session/:sessionId/execute

Script: mobile: alert

Route

POST /session/:sessionId/execute

Script: mobile: backgroundApp

Close app (simulate device home button). It is possible to restore the app after the timeout or keep it minimized based on the parameter value.

Route

POST /session/:sessionId/execute

Script: mobile: batteryInfo

Reads the battery information from the device under test. This endpoint only returns reliable result on real devices.

Route

POST /session/:sessionId/execute

Script: mobile: clearKeychains

Clears keychains on Simulator.

Throws

If current device is not a Simulator or there was an error while clearing keychains.

Route

POST /session/:sessionId/execute

Script: mobile: configureLocalization

Change localization settings on the currently booted simulator

Throws

If there was a failure while setting the preferences

Route

POST /session/:sessionId/execute

Opens the given URL with the default or the given application

Route

POST /session/:sessionId/execute

Script: mobile: deleteFile

Delete a remote file from the device.

Route

POST /session/:sessionId/execute

Script: mobile: deleteFolder

Delete a remote folder from the device.

Route

POST /session/:sessionId/execute

Script: mobile: deviceInfo

Returns device info.

Throws

if an error raised by command

Route

POST /session/:sessionId/execute

Script: mobile: deviceScreenInfo

memoized in constructor

Route

POST /session/:sessionId/execute

Script: mobile: disableConditionInducer

Disable condition inducer this call upon driver deletion

Route

POST /session/:sessionId/execute

Script: mobile: doubleTap

Route

POST /session/:sessionId/execute

Script: mobile: dragFromToForDuration

Route

POST /session/:sessionId/execute

Script: mobile: dragFromToWithVelocity

Route

POST /session/:sessionId/execute

Script: mobile: enableConditionInducer

Enable a "condition inducer". You can create a condition on a connected device to test your app under adverse conditions, such as poor network connectivity or thermal constraints. When you start a device condition, the operating system on the device behaves as if its environment has changed. The device condition remains active until you stop the device condition or disconnect the device. For example, you can start a device condition, run your app, monitor your app’s energy usage, and then stop the condition.

(Note: the socket needs to remain connected during operation) (Note: Device conditions are available only for real devices running iOS 13.0 and later.)

Throws

If you try to start another Condition and the previous Condition has not stopped

Since

4.9.0

See

https://help.apple.com/xcode/mac/current/#/dev308429d42

Route

POST /session/:sessionId/execute

Script: mobile: enrollBiometric

Enrolls biometric authentication on Simulator.

Throws

If enrollment fails or the device is not a Simulator.

Route

POST /session/:sessionId/execute

Script: mobile: expectNotification

Blocks until the expected notification is delivered.

This method is a thin wrapper over XCTNSNotificationExpectation and XCTDarwinNotificationExpectation entities.

Throws

TimeoutError if the expected notification has not been delivered within the given timeout

Route

POST /session/:sessionId/execute

Script: mobile: forcePress

Route

POST /session/:sessionId/execute

Script: mobile: getAppStrings

Return the language-specific strings for an app

Route

POST /session/:sessionId/execute

Script: mobile: getAppearance

Get the device's UI appearance style.

Since

Xcode SDK 11

Route

POST /session/:sessionId/execute

Script: mobile: getContexts

Get the contexts available, with information about the url and title of each webview

Route

POST /session/:sessionId/execute

Script: mobile: getDeviceTime

Retrieves the current device time

Route

POST /session/:sessionId/execute

Script: mobile: getPasteboard

Route

POST /session/:sessionId/execute

Script: mobile: getPermission

Gets application permission state on Simulator.

This method requires WIX applesimutils to be installed on the server host.

Throws

If permission getting fails or the device is not a Simulator.

Route

POST /session/:sessionId/execute

Script: mobile: getSimulatedLocation

Retrieves simulated geolocation value. Only works since Xcode 14.3/iOS 16.4

Throws

If the device under test does not support gelolocation simulation.

Route

POST /session/:sessionId/execute

Script: mobile: hideKeyboard

Route

POST /session/:sessionId/execute

Script: mobile: installApp

Route

POST /session/:sessionId/execute

Script: mobile: installCertificate

Installs a custom certificate onto the device. Since Xcode SDK 11.4 Apple has added a dedicated simctl subcommand to quickly handle certificates on Simulator over CLI. On real devices or simulators before Xcode 11.4 SDK Apple provides no official way to do it via the command line. In such case (and also as a fallback if CLI setup fails) this method tries to wrap the certificate into .mobileconfig format and then deploys the wrapped file to the internal HTTP server, so one can open it via mobile Safari. Then the algorithm goes through the profile installation procedure by clicking the necessary buttons using WebDriverAgent.

Route

POST /session/:sessionId/execute

Script: mobile: installXCTestBundle

Install an XCTestBundle

Route

POST /session/:sessionId/execute

Script: mobile: isAppInstalled

Route

POST /session/:sessionId/execute

Script: mobile: isBiometricEnrolled

Checks whether biometric is currently enrolled or not.

Throws

If the detection fails or the device is not a Simulator.

Route

POST /session/:sessionId/execute

Script: mobile: isKeyboardShown

Route

POST /session/:sessionId/execute

Script: mobile: isLocked

Determine whether the device is locked

Route

POST /session/:sessionId/execute

Script: mobile: killApp

Kill the given bundle id process via instruments service.

See

https://github.com/YueChen-C/py-ios-device/blob/51f4683c5c3c385a015858ada07a5f1c62d3cf57/ios_device/cli/base.py#L220

Route

POST /session/:sessionId/execute

Script: mobile: launchApp

Route

POST /session/:sessionId/execute

Script: mobile: listApps

List applications installed on the real device under test

Route

POST /session/:sessionId/execute

Script: mobile: listCertificates

Lists installed certificates for real devices only if py-ios-device tool is available on the server machine.

Throws

If attempting to list certificates for simulated device or if py-ios-device is not installed

Route

POST /session/:sessionId/execute

Script: mobile: listConditionInducers

Get all ConditionInducer configuration information We will use conditionID and profileID in the mobileEnableConditionInducer

Route

POST /session/:sessionId/execute

Script: mobile: listXCTestBundles

List XCTest bundles that are installed on device

Route

POST /session/:sessionId/execute

Script: mobile: listXCTestsInTestBundle

List XCTests in a test bundle

Route

POST /session/:sessionId/execute

Script: mobile: lock

Lock the device (and optionally unlock the device after a certain amount of time)

Default Value

0

Route

POST /session/:sessionId/execute

Script: mobile: performIoHidEvent

Emulates triggering of the given low-level IO HID device event.

See this source header for possible constants

Popular constants: - kHIDPage_Consumer = 0x0C - kHIDUsage_Csmr_VolumeIncrement = 0xE9 (Volume Up) - kHIDUsage_Csmr_VolumeDecrement = 0xEA (Volume Down) - kHIDUsage_Csmr_Menu = 0x40 (Home) - kHIDUsage_Csmr_Power = 0x30 (Power) - kHIDUsage_Csmr_Snapshot = 0x65 (Power + Home)

Route

POST /session/:sessionId/execute

Script: mobile: pinch

Route

POST /session/:sessionId/execute

Script: mobile: pressButton

Emulates press the given devive button name.

Route

POST /session/:sessionId/execute

Script: mobile: pullFile

Pulls a remote file from the device.

Route

POST /session/:sessionId/execute

Script: mobile: pullFolder

Pulls the whole folder from the device under test.

Route

POST /session/:sessionId/execute

Script: mobile: pushFile

Pushes the given data to a file on the remote device.

Route

POST /session/:sessionId/execute

Script: mobile: pushNotification

Simulates push notification delivery to Simulator.

Only application remote push notifications are supported. VoIP, Complication, File Provider, and other types are unsupported.

Since

Xcode SDK 11.4

Route

POST /session/:sessionId/execute

Script: mobile: queryAppState

Returns the current application state

Route

POST /session/:sessionId/execute

Script: mobile: removeApp

Route

POST /session/:sessionId/execute

Script: mobile: resetLocationService

Reset the location service on real device. Raises not implemented error for simulator.

Throws

If the device is simulator, or 'resetLocation' raises an error.

Route

POST /session/:sessionId/execute

Script: mobile: resetPermission

Resets the given permission for the active application under test. Works for both Simulator and real devices using Xcode SDK 11.4+

Throws

If permission reset fails on the device.

Route

POST /session/:sessionId/execute

Script: mobile: resetSimulatedLocation

Resets simulated geolocation value. Only works since Xcode 14.3/iOS 16.4. ! Do not forget to reset the simulated geolocation value after your automated test is finished. ! If the value is not reset explcitly then the simulated one will remain until the next device restart.

Throws

If the device under test does not support gelolocation simulation.

Route

POST /session/:sessionId/execute

Script: mobile: rotateElement

Route

POST /session/:sessionId/execute

Script: mobile: runXCTest

Run an XCTest.

Launches a subprocess that runs the XC Test and blocks until it is complete. Parses the stdout of the process and returns result as an array.

See the idb docs for reference.

Throws

Error thrown if subprocess returns non-zero exit code

Route

POST /session/:sessionId/execute

Script: mobile: scroll

Route

POST /session/:sessionId/execute

Script: mobile: scrollToElement

See https://github.com/facebook/WebDriverAgent/blob/master/WebDriverAgentLib/Commands/FBElementCommands.m to get the info about available WDA gestures API

See https://developer.apple.com/reference/xctest/xcuielement and https://developer.apple.com/reference/xctest/xcuicoordinate to get the detailed description of all XCTest gestures

Route

POST /session/:sessionId/execute

Script: mobile: selectPickerWheelValue

Performs selection of the next or previous picker wheel value. This might be useful if these values are populated dynamically (so you don't know which one to select) or if value selection using the sendKeys API does not work due to an XCTest bug. The method throws an exception if it fails to change the current picker value.

Route

POST /session/:sessionId/execute

Script: mobile: sendBiometricMatch

Emulates biometric match/non-match event on Simulator. The biometric feature is expected to be already enrolled before executing this.

Throws

If matching fails or the device is not a Simulator.

Route

POST /session/:sessionId/execute

Script: mobile: setAppearance

Set the device's UI appearance style

Since

iOS 12.0

Throws

if the current platform does not support UI appearance changes

Route

POST /session/:sessionId/execute

Script: mobile: setPasteboard

Route

POST /session/:sessionId/execute

Script: mobile: setPermission

Set application permission state on Simulator.

Since

Xcode SDK 11.4

Throws

If permission setting fails or the device is not a Simulator.

Route

POST /session/:sessionId/execute

Script: mobile: setSimulatedLocation

Sets simulated geolocation value. Only works since Xcode 14.3/iOS 16.4

Throws

If the device under test does not support gelolocation simulation.

Route

POST /session/:sessionId/execute

Script: mobile: shake

Shake the device

Route

POST /session/:sessionId/execute

Script: mobile: siriCommand

Route

POST /session/:sessionId/execute

Script: mobile: source

Route

POST /session/:sessionId/execute

Script: mobile: startAudioRecording

Records the given hardware audio input and saves it into an .mp4 file.

To use this command, the audio_record security feature must be enabled and FFMpeg must be installed on the Appium server.

Route

POST /session/:sessionId/execute

Script: mobile: startLogsBroadcast

Starts iOS system logs broadcast websocket on the same host and port where Appium server is running at /ws/session/:sessionId:/appium/syslog endpoint. The method will return immediately if the web socket is already listening.

Each connected webcoket listener will receive syslog lines as soon as they are visible to Appium.

Route

POST /session/:sessionId/execute

Script: mobile: startPcap

Records the given network traffic capture into a .pcap file.

Throws

If network traffic capture has failed to start.

Route

POST /session/:sessionId/execute

Script: mobile: startPerfRecord

Starts performance profiling for the device under test.

Relaxing security is mandatory for simulators. It can always work for real devices.

Since XCode 14 the method tries to use xctrace tool to record performance stats.

The instruments developer utility is used as a fallback for this purpose if xctrace is not available.

It is possible to record multiple profiles at the same time.

Read Recording, Pausing, and Stopping Traces for more details.

Route

POST /session/:sessionId/execute

Script: mobile: stopAudioRecording

Stop recording of the audio input. If no audio recording process is running then the endpoint will try to get the recently recorded file. If no previously recorded file is found and no active audio recording processes are running then the method returns an empty string.

Throws

If there was an error while getting the recorded file.

Route

POST /session/:sessionId/execute

Script: mobile: stopLogsBroadcast

Stops the previously started syslog broadcasting wesocket server. This method will return immediately if no server is running.

Route

POST /session/:sessionId/execute

Script: mobile: stopPcap

Stop capture of the device network traffic. If no traffic capture process is running then the endpoint will try to get the recently recorded file. If no previously recorded file is found and no active traffic capture processes are running then the method returns an empty string.

Throws

If there was an error while getting the capture file.

Route

POST /session/:sessionId/execute

Script: mobile: stopPerfRecord

Stops performance profiling for the device under test.

The resulting file in .trace format can be either returned directly as base64-encoded zip archive or uploaded to a remote location (such files can be pretty large). Afterwards it is possible to unarchive and open such files with Xcode Dev Tools.

Throws

If no performance recording with given profile name/device udid combination has been started before or the resulting .trace file has not been generated properly.

Route

POST /session/:sessionId/execute

Script: mobile: swipe

Route

POST /session/:sessionId/execute

Script: mobile: tap

Route

POST /session/:sessionId/execute

Script: mobile: tapWithNumberOfTaps

Route

POST /session/:sessionId/execute

Script: mobile: terminateApp

Route

POST /session/:sessionId/execute

Script: mobile: touchAndHold

Route

POST /session/:sessionId/execute

Script: mobile: twoFingerTap

Route

POST /session/:sessionId/execute

Script: mobile: unlock

Unlock the device

Route

POST /session/:sessionId/execute

Script: mobile: updateSafariPreferences

Updates preferences of Mobile Safari on Simulator

*

Route

POST /session/:sessionId/execute

Script: mobile: viewportRect

Route

POST /session/:sessionId/execute

Script: mobile: viewportScreenshot

Route

POST /session/:sessionId/execute