{"id":28564155,"url":"https://github.com/appium/appium-uiautomator2-driver","last_synced_at":"2026-04-02T11:56:02.058Z","repository":{"id":37548790,"uuid":"41711933","full_name":"appium/appium-uiautomator2-driver","owner":"appium","description":"Appium driver for Android UIAutomator2","archived":false,"fork":false,"pushed_at":"2026-03-24T11:08:17.000Z","size":11991,"stargazers_count":831,"open_issues_count":23,"forks_count":224,"subscribers_count":40,"default_branch":"master","last_synced_at":"2026-03-25T06:40:55.923Z","etag":null,"topics":["android","appium","driver","uiautomator2"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appium.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"open_collective":"appium"}},"created_at":"2015-09-01T02:20:32.000Z","updated_at":"2026-03-24T12:03:38.000Z","dependencies_parsed_at":"2022-07-19T01:32:59.176Z","dependency_job_id":"75785d07-dcdf-47f9-a9d3-10d85297b3ba","html_url":"https://github.com/appium/appium-uiautomator2-driver","commit_stats":{"total_commits":1003,"total_committers":58,"mean_commits":17.29310344827586,"dds":0.728813559322034,"last_synced_commit":"e58f997e4a60177fab0472c5033a3c1e3e223302"},"previous_names":[],"tags_count":416,"template":false,"template_full_name":null,"purl":"pkg:github/appium/appium-uiautomator2-driver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appium%2Fappium-uiautomator2-driver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appium%2Fappium-uiautomator2-driver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appium%2Fappium-uiautomator2-driver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appium%2Fappium-uiautomator2-driver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appium","download_url":"https://codeload.github.com/appium/appium-uiautomator2-driver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appium%2Fappium-uiautomator2-driver/sbom","scorecard":{"id":203624,"data":{"date":"2025-08-11","repo":{"name":"github.com/appium/appium-uiautomator2-driver","commit":"0156dd49887059f516aee2726390d2a4c45c6cf0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.9,"checks":[{"name":"Code-Review","score":2,"reason":"Found 8/27 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":10,"reason":"20 commit(s) and 5 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/functional-test.yml:1","Warn: no topLevel permission defined: .github/workflows/pr-title.yml:1","Warn: topLevel 'contents' permission set to 'write': .github/workflows/publish.js.yml:9","Warn: no topLevel permission defined: .github/workflows/unit-test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/functional-test.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/appium/appium-uiautomator2-driver/functional-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/functional-test.yml:49: update your workflow using https://app.stepsecurity.io/secureworkflow/appium/appium-uiautomator2-driver/functional-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/functional-test.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/appium/appium-uiautomator2-driver/functional-test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/functional-test.yml:69: update your workflow using https://app.stepsecurity.io/secureworkflow/appium/appium-uiautomator2-driver/functional-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/functional-test.yml:71: update your workflow using https://app.stepsecurity.io/secureworkflow/appium/appium-uiautomator2-driver/functional-test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/functional-test.yml:80: update your workflow using https://app.stepsecurity.io/secureworkflow/appium/appium-uiautomator2-driver/functional-test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/functional-test.yml:108: update your workflow using https://app.stepsecurity.io/secureworkflow/appium/appium-uiautomator2-driver/functional-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/functional-test.yml:122: update your workflow using https://app.stepsecurity.io/secureworkflow/appium/appium-uiautomator2-driver/functional-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/functional-test.yml:128: update your workflow using https://app.stepsecurity.io/secureworkflow/appium/appium-uiautomator2-driver/functional-test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-title.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/appium/appium-uiautomator2-driver/pr-title.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.js.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/appium/appium-uiautomator2-driver/publish.js.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.js.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/appium/appium-uiautomator2-driver/publish.js.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/unit-test.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/appium/appium-uiautomator2-driver/unit-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/unit-test.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/appium/appium-uiautomator2-driver/unit-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/unit-test.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/appium/appium-uiautomator2-driver/unit-test.yml/master?enable=pin","Warn: npmCommand not pinned by hash: scripts/run-functional-tests.sh:27","Warn: downloadThenRun not pinned by hash: .github/workflows/functional-test.yml:54","Warn: npmCommand not pinned by hash: .github/workflows/functional-test.yml:55","Warn: npmCommand not pinned by hash: .github/workflows/functional-test.yml:56","Warn: npmCommand not pinned by hash: .github/workflows/functional-test.yml:57","Warn: npmCommand not pinned by hash: .github/workflows/publish.js.yml:24","Warn: npmCommand not pinned by hash: .github/workflows/publish.js.yml:35","Warn: npmCommand not pinned by hash: .github/workflows/unit-test.yml:37","Info:   0 out of  10 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   5 third-party GitHubAction dependencies pinned","Info:   0 out of   7 npmCommand dependencies pinned","Info:   0 out of   1 downloadThenRun dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":9,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/appium/.github/SECURITY.md:1","Info: Found linked content: github.com/appium/.github/SECURITY.md:1","Warn: One or no descriptive hints of disclosure, vulnerability, and/or timelines in security policy","Info: Found text in security policy: github.com/appium/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/publish.js.yml:14"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 14 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T23:15:19.499Z","repository_id":37548790,"created_at":"2025-08-16T23:15:19.499Z","updated_at":"2025-08-16T23:15:19.499Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31305945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T09:48:21.550Z","status":"ssl_error","status_checked_at":"2026-04-02T09:48:19.196Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","appium","driver","uiautomator2"],"created_at":"2025-06-10T13:09:45.920Z","updated_at":"2026-04-02T11:56:02.046Z","avatar_url":"https://github.com/appium.png","language":"TypeScript","funding_links":["https://opencollective.com/appium"],"categories":[],"sub_categories":[],"readme":"# Appium UiAutomator2 Driver\n\n[![NPM version](http://img.shields.io/npm/v/appium-uiautomator2-driver.svg)](https://npmjs.org/package/appium-uiautomator2-driver)\n[![Downloads](http://img.shields.io/npm/dm/appium-uiautomator2-driver.svg)](https://npmjs.org/package/appium-uiautomator2-driver)\n\n[![Release](https://github.com/appium/appium-uiautomator2-driver/actions/workflows/publish.js.yml/badge.svg)](https://github.com/appium/appium-uiautomator2-driver/actions/workflows/publish.js.yml)\n\n\nAppium UiAutomator2 Driver is a test automation framework for Android devices. Appium UiAutomator2 Driver automates native, hybrid and mobile web apps, tested on emulators and real devices. Appium UiAutomator2 Driver is part of the [Appium](https://github.com/appium/appium) mobile test automation tool. The driver operates in scope of [W3C WebDriver protocol](https://www.w3.org/TR/webdriver/) with several custom extensions to cover operating-system specific scenarios.\n\nUiAutomator2 Driver proxies most of the commands to [UiAutomator2 server](https://github.com/appium/appium-uiautomator2-server), which uses Google's [UiAutomator](https://developer.android.com/training/testing/ui-automator) framework under the hood. Some commands are proxied directly to [appium-adb](https://github.com/appium/appium-adb) and other helpers built on top of Android platform tools.\n\n\u003e [!IMPORTANT]\n\u003e Since major version *5.0.0*, this driver is only compatible with Appium 3. Use the `appium driver install uiautomator2`\n\u003e command to add it to your distribution.\n\n\n## Requirements\n\nOn top of standard Appium requirements UiAutomator2 driver also expects the following prerequisites:\n\n- Windows, Linux and macOS are supported as hosts\n- [Android SDK Platform tools](https://developer.android.com/studio/releases/platform-tools) must be installed. [Android Studio IDE](https://developer.android.com/studio) also provides a convenient UI to install and manage the tools.\n- ANDROID_HOME or ANDROID_SDK_ROOT [environment variable](https://developer.android.com/studio/command-line/variables) must be set\n- Java JDK must be installed and [JAVA_HOME](https://www.baeldung.com/java-home-on-windows-7-8-10-mac-os-x-linux) environment variable must be set. Android SDK below API 30 requires Java 8. Android SDK 30 and above requires Java 9 or newer.\n- [Emulator](https://developer.android.com/studio/run/managing-avds) platform image must be installed if you plan to run your tests on it. [Android Studio IDE](https://developer.android.com/studio) also provides a convenient UI to install and manage emulators.\n- Real Android devices must have [USB debugging enabled](https://developer.android.com/studio/debug/dev-options) and should be visible as `online` in `adb devices -l` output.\n- Since driver version 6.0.0 the minimum supported version of Android API is 8/Oreo (API level 26).\nBefore version 6.0.0 the minimum supported version of Android API is 5 (API level 21).\n6.0 is recommended as version 5 has some known compatibility issues.\n\n### Doctor\n\nSince driver version 2.39.0 you can automate the validation for the most of the above\nrequirements as well as various optional ones needed by driver extensions by running the\n`appium driver doctor uiautomator2` server command.\n\n## Capabilities\n\n### General\n\nCapability Name | Description\n--- | ---\nplatformName | Could be set to `android`. Appium itself is not strict about this capability value if `automationName` is provided, so feel free to assign it to any supported platform name if this is needed, for example, to make Selenium Grid working.\nappium:automationName | Must always be set to `uiautomator2`. Values of `automationName` are compared case-insensitively.\nappium:deviceName | The name of the device under test (actually, it is not used to select a device under test). Consider setting `udid` for real devices and `avd` for emulators instead\nappium:platformVersion | The platform version of an emulator or a real device. This capability is used for device autodetection if `udid` is not provided\nappium:udid | UDID of the device to be tested. Could be retrieved from `adb devices -l` output. If unset then the driver will try to use the first connected device. Always set this capability if you run parallel tests.\nappium:noReset | Prevents the device to be reset before the session startup if set to `true`. This means that the application under test is not going to be terminated neither its data cleaned. `false` by default\nappium:fullReset | Being set to `true` always enforces the application under test to be fully uninstalled before starting a new session. `false` by default\nappium:printPageSourceOnFindFailure | Enforces the server to dump the actual XML page source into the log if any error happens. `false` by default.\n\n### Driver/Server\n\nCapability Name | Description\n--- | ---\nappium:systemPort | The number of the port on the host machine used for the UiAutomator2 server. By default the first free port from 8200..8299 range is selected. It is recommended to set this value if you are running [parallel tests](#parallel-tests) on the same machine.\nappium:skipServerInstallation | Skip the UiAutomator2 Server component installation on the device under test and all the related checks if set to `true`. This could help to speed up the session startup if you know for sure the correct server version is installed on the device. In case the server is not installed or an incorrect version of it is installed then you may get an unexpected error later. `false` by default\nappium:uiautomator2ServerLaunchTimeout | The maximum number of milliseconds to wait util UiAutomator2Server is listening on the device. `30000` ms by default\nappium:uiautomator2ServerInstallTimeout | The maximum number of milliseconds to wait util UiAutomator2Server is installed on the device. `20000` ms by default\nappium:uiautomator2ServerReadTimeout | The maximum number of milliseconds to wait for a HTTP response from UiAutomator2Server. Only values greater than zero are accepted. If the given value is too low then expect driver commands to fail with `timeout of Xms exceeded` error. `240000` ms by default\nappium:disableWindowAnimation | Whether to disable window animations when starting the instrumentation process. The animation scale will be restored automatically after the instrumentation process ends for API level 26 and higher. The animation scale could remain if the session ends unexpectedly for API level 25 and lower. `false` by default\nappium:skipDeviceInitialization | If set to `true` then device startup checks (whether it is ready and whether Settings app is installed) will be canceled on session creation. Could speed up the session creation if you know what you are doing. `false` by default\n\n### App\n\nCapability Name | Description\n--- | ---\nappium:app | Full path to the application to be tested (the app must be located on the same machine where the server is running). Both `.apk` and `.apks` application extensions are supported. Could also be an URL to a remote location. If neither of the `app`, `appPackage` or `browserName` capabilities are provided then the driver starts from the Dashboard and expects the test knows what to do next. Do not provide both `app` and `browserName` capabilities at once.\nbrowserName | The name of the browser to run the test on. If this capability is provided then the driver will try to start the test in Web context mode (Native mode is applied by default). Read [Automating hybrid apps](#hybrid-mode) for more details. Usually equals to `chrome`.\nappium:appPackage | Application package identifier to be started. If not provided then UiAutomator2 will try to detect it automatically from the package provided by the `app` capability. Read [How To Troubleshoot Activities Startup](docs/activity-startup.md) for more details\nappium:appActivity | Main application activity identifier. If not provided then UiAutomator2 will try to detect it automatically from the package provided by the `app` capability. Read [How To Troubleshoot Activities Startup](docs/activity-startup.md) for more details\nappium:appWaitActivity | Identifier of the first activity that the application invokes. If not provided then equals to `appium:appActivity`. Read [How To Troubleshoot Activities Startup](docs/activity-startup.md) for more details\nappium:appWaitPackage | Identifier of the first package that is invoked first. If not provided then equals to `appium:appPackage`. Read [How To Troubleshoot Activities Startup](docs/activity-startup.md) for more details\nappium:appWaitDuration | Maximum amount of milliseconds to wait until the application under test is started (e. g. an activity returns the control to the caller). `20000` ms by default. Read [How To Troubleshoot Activities Startup](docs/activity-startup.md) for more details\nappium:androidInstallTimeout | Maximum amount of milliseconds to wait until the application under test is installed. `90000` ms by default\nappium:appWaitForLaunch | Whether to block until the app under test returns the control to the caller after its activity has been started by Activity Manager (`true`, the default value) or to continue the test without waiting for that (`false`).\nappium:intentCategory | Set an optional intent category to be applied when starting the given appActivity by [Activity Manager](https://developer.android.com/studio/command-line/adb#am). Defaults to `android.intent.category.LAUNCHER`. Please use [mobile:startActivity](#mobile-startactivity) in case you don't set an explicit value.\nappium:intentAction | Set an optional intent action to be applied when starting the given appActivity by [Activity Manager](https://developer.android.com/studio/command-line/adb#am). Dfaults to `android.intent.action.MAIN`. Please use [mobile:startActivity](#mobile-startactivity) in case you don't set an explicit value.\nappium:intentFlags | Set an optional intent flags to be applied when starting the given appActivity by [Activity Manager](https://developer.android.com/studio/command-line/adb#am). Defaults to `0x10200000` (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_RESET_TASK_IF_NEEDED flags). Please use [mobile:startActivity](#mobile-startactivity) in case you don't set an explicit value.\nappium:optionalIntentArguments | Set an optional intent arguments to be applied when starting the given appActivity by [Activity Manager](https://developer.android.com/studio/command-line/adb#am)\nappium:dontStopAppOnReset | Set it to `true` if you don't want the application to be restarted if it was already running. If `appium:noReset` is falsy, then the app under test is going to be restarted if either this capability is falsy (the default behavior) or `appium:forceAppLaunch` is set to `true`. `false` by default\nappium:forceAppLaunch | Set it to `true` if you want the application under test to be always forcefully restarted on session startup even if `appium:noReset` is `true`, and the app was already running. If `noReset` is falsy, then the app under test is going to be restarted if either this capability set to `true` or `appium:dontStopAppOnReset` is falsy (the default behavior). `false` by default. Available since driver version 2.12\nappium:shouldTerminateApp | Set it to `true` if you want the application under test to be always terminated on session end even if `appium:noReset` is `true`. If `noReset` is falsy, then the app under test is going to be terminated if `appium:dontStopAppOnReset` is also falsy (the default behavior). `false` by default\nappium:autoLaunch | Whether to launch the application under test automatically (`true`, the default value) after a test starts\nappium:autoGrantPermissions | Whether to grant all the requested application permissions automatically when a test starts(`true`). The targetSdkVersion in the application manifest must be greater or equal to 23 and the Android version on the device under test must be greater or equal to Android 6 (API level 23) to grant permissions. Applications whose targetSdkVersion is lower than or equal to 22 must be reinstalled to grant permissions, for example, by setting the `appium:fullReset` capability as `true` for Android 6+ devices. If your app needs some special security permissions, like access to notifications or media recording, consider using [mobile: changePermissions](#mobile-changepermissions) extension with `appops` target. `false` by default\nappium:otherApps | Allows to set one or more comma-separated paths to Android packages that are going to be installed along with the main application under test. This may be useful if the tested app has dependencies\nappium:uninstallOtherPackages | Allows to set one or more comma-separated package identifiers to be uninstalled from the device before a test starts\nappium:allowTestPackages | If set to `true` then it would be possible to use packages built with the test flag for the automated testing (literally adds `-t` flag to the `adb install` command). `false` by default\nappium:remoteAppsCacheLimit | Sets the maximum amount of application packages to be cached on the device under test. This is needed for devices that don't support streamed installs (Android 7 and below), because ADB must push app packages to the device first in order to install them, which takes some time. Setting this capability to zero disables apps caching. `10` by default.\nappium:enforceAppInstall | If set to `true` then the application under test is always reinstalled even if a newer version of it already exists on the device under test. This capability has no effect if `appium:noReset` is set to `true`. `false` by default.\n\n### App Localization\n\nCapability Name | Description\n--- | ---\nappium:localeScript | Canonical name of the locale to be set for the app under test, for example `Hans` in `zh-Hans-CN`. See https://developer.android.com/reference/java/util/Locale.html for more details.\nappium:language | Name of the language to extract application strings for. Strings are extracted for the current system language by default. Also sets the language for the app under test. See https://developer.android.com/reference/java/util/Locale.html for more details. If `language` is provided then `locale` is also required to be set. The combination of both capability values must be a known locale and should be present in the list of available locales returned by the ICU's [getAvailableULocales()](https://unicode-org.github.io/icu/userguide/locale/#usage-retrieving-locales) method. The full list of supported locales is also dumped into the logcat output on failure. Example: `en`, `ja`\nappium:locale | Sets the locale for the app under test. See https://developer.android.com/reference/java/util/Locale.html for more details. If `locale` is provided then `language` is also required to be set. The combination of both capability values must be a known locale and should be present in the list of available locales returned by the ICU's [getAvailableULocales()](https://unicode-org.github.io/icu/userguide/locale/#usage-retrieving-locales) method. The full list of supported locales is also dumped into the logcat output on failure. Example: `US`, `JP`\n\n### ADB\n\nCapability Name | Description\n--- | ---\nappium:adbPort | Number of the port on the host machine where ADB is running. `5037` by default\nappium:remoteAdbHost | Address of the host where ADB is running (the value of `-H` ADB command line option). Unset by default\nappium:adbExecTimeout | Maximum number of milliseconds to wait until single ADB command is executed. `20000` ms by default\nappium:clearDeviceLogsOnStart | If set to `true` then UiAutomator2 deletes all the existing logs in the device buffer before starting a new test\nappium:buildToolsVersion | The version of Android build tools to use. By default UiAutomator2 driver uses the most recent version of build tools installed on the machine, but sometimes it might be necessary to give it a hint (let say if there is a known bug in the most recent tools version). Example: `28.0.3`\nappium:skipLogcatCapture | Being set to `true` disables automatic logcat output collection during the test run. `false` by default\nappium:suppressKillServer | Being set to `true` prevents the driver from ever killing the ADB server explicitly. Could be useful if ADB is connected wirelessly. `false` by default\nappium:ignoreHiddenApiPolicyError | Being set to `true` ignores a failure while changing hidden API access policies to [enable access to non-SDK interfaces](https://developer.android.com/guide/app-compatibility/restrictions-non-sdk-interfaces#how_can_i_enable_access_to_non-sdk_interfaces). Could be useful on some devices, where access to these policies has been locked by its vendor. `false` by default.\nappium:hideKeyboard | Being set to `true` hides the on-screen keyboard while the session is running. Use it instead of the legacy `appium:unicodeKeyboard` one (which will be dropped in the future). This effect is achieved by assigning a custom \"artificial\" [input method](https://developer.android.com/develop/ui/views/touch-and-input/creating-input-method). Only use this feature for special/exploratory cases as it violates the way your application under test is normally interacted with by a human. Setting this capability explicitly to `false` enforces `adb shell ime reset` call on session startup, which resets the currently selected/enabled IMEs to the default ones as if the device is initially booted with the current locale. `undefined` by default.\nappium:mockLocationApp | Sets the package identifier of the app, which is used as a system mock location provider since Appium 1.18.0+. This capability has no effect on emulators. If the value is set to `null` or an empty string, then the driver will reset the mocked location provider, e.g. the location won't be mocked anymore. Defaults to Appium Setting package identifier (`io.appium.settings`). Termination of a mock location provider application resets the mocked location data.\nappium:logcatFormat | The log print format, where `format` is one of: `brief` `process` `tag` `thread` `raw` `time` `threadtime` `long`. `threadtime` is the default value.\nappium:logcatFilterSpecs | Series of `tag[:priority]` where `tag` is a log component tag (or * for all) and priority is: `V    Verbose`, `D    Debug`, `I    Info`, `W    Warn`, `E    Error`, `F    Fatal`, `S    Silent (supress all output)`. '*' means '*:d' and `tag` by itself means `tag:v`. If not specified on the commandline, filterspec is set from ANDROID_LOG_TAGS. If no filterspec is found, filter defaults to '*:I'.\nappium:allowDelayAdb | Being set to `false` prevents emulator to use `-delay-adb` feature to detect its startup. See https://github.com/appium/appium/issues/14773 for more details.\nappium:adbListenAllNetwork | Being set to `true` adds `-a` ADB command line global option. Requires `uiautomator2:adb_listen_all_network` [security feature](https://github.com/appium/appium/blob/master/packages/appium/docs/en/guides/security.md) to be enabled. Unset by default. Available since driver version 6.7.0.\n\n### Emulator (Android Virtual Device)\n\nCapability Name | Description\n--- | ---\nappium:avd | The name of Android emulator to run the test on. The names of currently installed emulators could be listed using `avdmanager list avd` command. If the emulator with the given name is not running then it is going to be launched on automated session startup.\nappium:avdLaunchTimeout | Maximum number of milliseconds to wait until Android Emulator is started. `60000` ms by default\nappium:avdReadyTimeout | Maximum number of milliseconds to wait until Android Emulator is fully booted and is ready for usage. `60000` ms by default\nappium:avdArgs | Either a string or an array of emulator [command line arguments](https://developer.android.com/studio/run/emulator-commandline). If arguments contain the `-wipe-data` one then the emulator is going to be killed on automated session startup in order to wipe its data.\nappium:avdEnv | Mapping of emulator [environment variables](https://developer.android.com/studio/command-line/variables).\nappium:networkSpeed | Sets the desired network speed limit for the emulator. It is only applied if the emulator is not running before the test starts. See emulator [command line arguments](https://developer.android.com/studio/run/emulator-commandline) description for more details.\nappium:gpsEnabled | Sets whether to enable (`true`) or disable (`false`) GPS service in the Emulator. Unset by default, which means to not change the current value\nappium:isHeadless | If set to `true` then emulator starts in headless mode (e.g. no UI is shown). It is only applied if the emulator is not running before the test starts. `false` by default.\nappium:injectedImageProperties | Allows adjusting of injected image properties, like size, position or rotation. The image itself is expected to be injected by [mobile: injectEmulatorCameraImage](#mobile-injectemulatorcameraimage) extension. It is also mandatory to provide this capability if you are going to use the injection feature on a newly created/resetted emulator as it __enforces emulator restart__, so it could properly reload the modified image properties. The value itself is a map, where possible keys are `size`, `position` and `rotation`. All of them are optional. If any of values is not provided then the following defaults are used: `{size: {scaleX: 1, scaleY: 1}, position: {x: 0, y: 0, z: -1.5}, rotation: {x: 0, y: 0, z: 0}}`. The `size` value contains scale multipliers for X and Y axes. The `position` contains normalized coefficients for X/Y/Z axes, where `0` means it should be centered in the viewport. Values in the `rotation` are measured in degrees respectively for X, Y and Z axis. The capability is available since the driver version 3.6.0.\n\n### App Signing\n\nCapability Name | Description\n--- | ---\nappium:useKeystore | Whether to use a custom keystore to sign the app under test. `false` by default, which means apps are always signed with the default Appium debug certificate (unless canceled by `noSign` capability). This capability is used in combination with `keystorePath`, `keystorePassword`, `keyAlias` and `keyPassword` capabilities.\nappium:keystorePath | The full path to the keystore file on the server filesystem. This capability is used in combination with `useKeystore`, `keystorePath`, `keystorePassword`, `keyAlias` and `keyPassword` capabilities. Unset by default\nappium:keystorePassword | The password to the keystore file provided in `keystorePath` capability. This capability is used in combination with `useKeystore`, `keystorePath`, `keystorePassword`, `keyAlias` and `keyPassword` capabilities. Unset by default\nappium:keyAlias | The alias of the key in the keystore file provided in `keystorePath` capability. This capability is used in combination with `useKeystore`, `keystorePath`, `keystorePassword`, `keyAlias` and `keyPassword` capabilities. Unset by default\nappium:keyPassword | The password of the key in the keystore file provided in `keystorePath` capability. This capability is used in combination with `useKeystore`, `keystorePath`, `keystorePassword`, `keyAlias` and `keyPassword` capabilities. Unset by default\nappium:noSign | Set it to `true` in order to skip application signing. By default all apps are always signed with the default Appium debug signature if they don't have any. This capability cancels all the signing checks and makes the driver to use the application package as is. This capability does not affect `.apks` packages as these are expected to be already signed.\n\n### Device Locking\n\nCapability Name | Description\n--- | ---\nappium:skipUnlock | Whether to skip the check for lock screen presence (`true`). The default driver behaviour is to verify the presence of the screen lock (e.g. 'false' value of the capability) before starting the test and to unlock that (which sometimes may be unstable). Note, that this operation takes some time, so it is highly recommended to set this capability to `true` and disable screen locking on device(s) under test. Read the [Unlock tutorial](./docs/unlock/main.md) for more details.\nappium:unlockType | Set one of the possible types of Android lock screens to unlock. Read the [Unlock tutorial](./docs/unlock/main.md) for more details.\nappium:unlockKey | Allows to set an unlock key. Read the [Unlock tutorial](./docs/unlock/main.md) for more details.\nappium:unlockStrategy | Either 'locksettings' (default) or 'uiautomator'. Read the [Unlock tutorial](./docs/unlock/main.md) for more details.\nappium:unlockSuccessTimeout | Maximum number of milliseconds to wait until the device is unlocked. `2000` ms by default. Read the [Unlock tutorial](./docs/unlock/main.md) for more details.\n\n### MJPEG\n\nRead the [MJPEG guide](docs/mjpeg.md) for capabilities, settings, and usage details.\n\nCapability Name | Description\n--- | ---\nappium:mjpegServerPort | The number of the port on the host machine to which the device MJPEG server port is forwarded. If not provided then the screenshots broadcasting service on the remote device does not get exposed to a local port (e.g. no adb port forwarding is happening).\nappium:mjpegScreenshotUrl | The URL of a service that provides realtime device screenshots in MJPEG format. If provided then the actual command to retrieve a screenshot will be requesting pictures from this service rather than directly from the server.\n\n### Web Context\n\nCapability Name | Description\n--- | ---\nappium:autoWebview | If set to `true` then UiAutomator2 driver will try to switch to the web view with name `WEBVIEW_ + appium:appPackage` after the session is started. For example, if `appium:appPackage` capability is set to `com.mypackage` then `WEBVIEW_com.mypackage` will be used. `false` by default.\nappium:autoWebviewName | Set the name of webview context in which UiAutomator2 driver will try to switch if `autoWebview` capability is set to `true` (available since driver version 2.9.1). Has priority over using the `appium:appPackage` value in webview name. For example, if `appium:autoWebviewName` capability is set to `myWebviewName` then `WEBVIEW_myWebviewName` will be used. Unset by default.\nappium:autoWebviewTimeout | Set the maximum number of milliseconds to wait until a web view is available if `autoWebview` capability is set to `true`. `2000` ms by default.\nappium:webviewDevtoolsPort | The local port number to use for devtools communication. By default the first free port from 10900..11000 range is selected. Consider setting the custom value if you are running parallel tests.\nappium:ensureWebviewsHavePages | Whether to skip web views that have no pages from being shown in `getContexts` output. The driver uses devtools connection to retrieve the information about existing pages. `true` by default since Appium 1.19.0, `false` if lower than 1.19.0.\nappium:enableWebviewDetailsCollection | Whether to retrieve extended web views information using devtools protocol. Enabling this capability helps to detect the necessary chromedriver version more precisely. `true` by default since Appium 1.22.0, `false` if lower than 1.22.0.\nappium:chromedriverPort | The port number to use for Chromedriver communication. Any free port number is selected by default if unset.\nappium:chromedriverPorts | Array of possible port numbers to assign for Chromedriver communication. If none of the port in this array is free then an error is thrown.\nappium:chromedriverArgs | Array of chromedriver command line arguments, listed with `chromedriver --help`. Note that not all command line arguments available for the desktop browser are also available for the mobile one.\nappium:chromedriverExecutable | Full path to the chromedriver executable on the server file system.\nappium:chromedriverExecutableDir | Full path to the folder where chromedriver executables are located. This folder is used then to store the downloaded chromedriver executables if automatic download is enabled. Read [Automatic Chromedriver Discovery article](#automatic-discovery-of-compatible-chromedriver) for more details.\nappium:chromedriverChromeMappingFile | Full path to the chromedrivers mapping file. This file is used to statically map webview/browser versions to the chromedriver versions that are capable of automating them. Read [Automatic Chromedriver Discovery article](#automatic-discovery-of-compatible-chromedriver) for more details.\nappium:chromedriverUseSystemExecutable | Set it to `true` in order to enforce the usage of chromedriver, which gets downloaded by Appium automatically upon installation. This driver might not be compatible with the destination browser or a web view. `false` by default.\nappium:chromedriverDisableBuildCheck | Being set to `true` disables the compatibility validation between the current chromedriver and the destination browser/web view. Use it with care.\nappium:recreateChromeDriverSessions | If this capability is set to `true` then chromedriver session is always going to be killed and then recreated instead of just suspending it on context switching. `false` by default\nappium:nativeWebScreenshot | Whether to use screenshoting endpoint provided by UiAutomator framework (`true`) rather than the one provided by chromedriver (`false`, the default value). Use it when you experience issues with the latter.\nappium:extractChromeAndroidPackageFromContextName | If set to `true`, tell chromedriver to attach to the android package we have associated with the context name, rather than the package of the application under test. `false` by default.\nappium:showChromedriverLog | If set to `true` then all the output from chromedriver binary will be forwarded to the Appium server log. `false` by default.\npageLoadStrategy | One of the available page load strategies. See https://www.w3.org/TR/webdriver/#capabilities\nappium:chromeOptions | A mapping, that allows to customize chromedriver options. See https://chromedriver.chromium.org/capabilities for the list of available entries.\nappium:chromeLoggingPrefs | Chrome logging preferences mapping. Basically the same as [goog:loggingPrefs](https://newbedev.com/getting-console-log-output-from-chrome-with-selenium-python-api-bindings). It is set to `{\"browser\": \"ALL\"}` by default.\nappium:chromedriverForwardBiDi | Being set to `true` enables automated forwarding of chromedriver BiDi web socket to UIA2 driver web socket. This allows to send browser-specific BiDi commands being in a web view context. The web socket connection is terminated as soon as the session context is changed (by default all [BiDi commands](./docs/bidi.md) are handled by the UIA2 driver). It is required that session capabilities have the `webDriverUrl` capability set to `true`. Also note, that older chromedrivers may not support BiDi specification fully, or may not support it at all.\n\n### Other\n\nCapability Name | Description\n--- | ---\nappium:disableSuppressAccessibilityService | Being set to `true` tells the instrumentation process to not suppress accessibility services during the automated test. This may be useful if your automated test needs these services. `false` by default\nappium:userProfile | Integer identifier of a [user profile](https://source.android.com/devices/tech/admin/multi-user). By default the app under test is installed for the currently active user, but in case it is necessary to test how the app performs while being installed for a user profile, which is different from the current one, then this capability may come in handy.\nappium:newCommandTimeout | How long (in seconds) the driver should wait for a new command from the client before assuming the client has stopped sending requests. After the timeout the session is going to be deleted. `60` seconds by default. Setting it to zero disables the timer.\nappium:skipLogcatCapture | Skips to start capturing logs such as logcat. It may improve network performance. Log-related commands won't work if the capability is enabled. Defaults to `false`.\nappium:timeZone | Overrides the current device's time zone since the driver version 3.1.0. This change is preserved until the next override. The time zone identifier must be a valid name from the list of [available time zone identifiers](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones), for example `Europe/Kyiv`\n\n\n## Element Attributes\n\nUiAutomator2 driver supports the following element attributes:\n\nName | Description | Example\n--- | --- | ---\ncheckable | Whether the element is checkable or not | 'true'\nchecked | Whether the element is checked. Always `false` if the element is not checkable | 'false'\nclass or className | The full name of the element's class. Could be `null` for some elements | 'android.view.View'\nclickable | Whether the element could be clicked | 'false'\ncontent-desc or contentDescription | The content-description attribute of the accessible element | 'foo'\nenabled | Whether the element could be clicked | 'true'\nfocusable | Whether the element could be focused | 'true'\nfocused | Whether the element could is focused. Always `false` if the element is not focusable | 'false'\nlong-clickable or longClickable | Whether the element accepts long clicks | 'false'\npackage | Identifier of the package the element belongs to | 'com.mycompany'\npassword | Whether the element is a password input field | 'true'\nresource-id or resourceId | Element's resource identifier. Could be `null` | 'com.mycompany:id/resId'\nscrollable | Whether the element is scrollable | 'true'\nselection-start | Contains the index of the char where the selection starts. Could be `null` if the element provides no range info | '5'\nselection-end | Contains the index of the char where the selection ends. Could be `null` if the element provides no range info | '8'\nselected | Whether the element is selected | 'false'\ntext or name | The element's text. It never equals to null | 'my text'\nhint | Element's hint text. On Android versions below Oreo it always equals to `null`. | 'my hint text'\nbounds | The element's visible frame (`[left, top][right, bottom]`) | `[0,0][100,100]`\ndisplayed | Whether the element is visible to the user | 'true'\ncontentSize | The dimensions of the element's content area | `{\"left\": 0, \"top\":0, \"width\": 100, \"height\": 100, \"scrollableOffset\": 10, \"touchPadding\": 0}`\nextras | The result of [getExtras](https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo#getExtras()). The value includes all key-value pairs as `key=value` separated by a semicolon (`;`). If the value is empty, then only key part ending with the equal sign will be present. Available only if `includeExtrasInPageSource` setting is turned on. | Part of extras in chrome browser:\u003cbr\u003e `AccessibilityNodeInfo.roleDescription=;`\u003cbr\u003e`AccessibilityNodeInfo.chromeRole=rootWebArea;`\u003cbr\u003e `ACTION_ARGUMENT_HTML_ELEMENT_STRING_VALUES=`\u003cbr\u003e `ARTICLE,BLOCKQUOTE,BUTTON,CHECKBOX`\na11y-important | Whether the element originates from a view considered important for accessibility. Available for API 24+ | 'true'\nscreen-reader-focusable | Whether the element is explicitly marked as a focusable unit by a screen reader. Available for API 28+ | 'true'\ninput-type | Bitmask, input type of the editable text element, defined by [InputType](https://developer.android.com/reference/android/text/InputType). Available only for text input fields. | '1'\ndrawing-order | The drawing position of the view corresponding to this element relative to its siblings. Available for API 24+ | '3'\nshowing-hint | Whether the element's text represents a hint for the user to enter text. Available for API 26+ | 'true'\ntext-entry-key | Whether the element represents a text entry key that is part of a keyboard or keypad. Available for API 29+ | 'true'\nmultiline | If the element is a multi line editable text. Available only for text input fields. | 'true'\ndismissable | If the element can be dismissed | 'true'\na11y-focused | Whether this element is accessibility focused | 'true'\nheading | Whether element represents a heading. Available for API 28+ | 'true'\nlive-region | Bitmask, live region mode value for the element, like '1' for [ACCESSIBILITY_LIVE_REGION_POLITE](https://developer.android.com/reference/android/view/View#ACCESSIBILITY_LIVE_REGION_POLITE) | '1'\ncontext-clickable | Whether this element is context clickable. Available for API 23+ | 'true'\nmax-text-length | The maximum text length for the editable text element. Available only for text input fields. | '300'\ncontent-invalid | If the content of this element is invalid. For example, a date is not well-formed. | 'true'\nerror | The error text of the element. | 'text string'\npane-title | Title of the pane represented by this element. Available for API 28+ | 'text string'\nactions | The comma-separated id names of the available accessibility actions for the element from [getActionList](https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo#getActionList()). Available only if `includeA11yActionsInPageSource` setting is turned on. | 'ACTION_FOCUS,ACTION_SELECT,ACTION_CLEAR_SELECTION,ACTION_CLICK,ACTION_ACCESSIBILITY_FOCUS,ACTION_NEXT_AT_MOVEMENT_GRANULARITY,ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY,ACTION_SET_SELECTION,ACTION_SHOW_ON_SCREEN'\ntooltip-text | The result of [getTooltipText](https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo#getTooltipText()). Could be `null`, available for API 28+  | 'Paste'\ntext-has-clickable-span | Indicates whether the `TextView` content contains `ClickableSpan` or `URLSpan` elements, `null` in all other cases. | 'true'\nwindow-id | The integer identifier of the [accessbility window](https://developer.android.com/reference/android/view/accessibility/AccessibilityWindowInfo) this element belongs to. In some rare cases, it may not be present if the window identifier cannot be determined. | 123\n\n\n## Element Location\n\nUiAutomator2 driver supports the following location strategies:\n\nName | Description | Speed Ranking | Example\n--- | --- | --- | ---\nid | This strategy is mapped to the native UiAutomator's `By.res` [locator](https://developer.android.com/reference/androidx/test/uiautomator/BySelector#res(java.lang.String)) (exact match of element's resource name). Package identifier prefix is added automatically if unset and is equal to the identifier of the current application under test. | `⭐⭐⭐⭐⭐` | 'com.mycompany:id/resourceId'\naccessibilityId | This strategy is mapped to the native UiAutomator's `By.desc` [locator](https://developer.android.com/reference/androidx/test/uiautomator/BySelector#desc(java.lang.String)) (exact match of element's content description). In applications written using [ReactNative](https://reactnative.dev/) framework this attribute reflects the value of the `accessibilityLabel` property. | `⭐⭐⭐⭐⭐` | 'my description'\nclassName | This strategy is mapped to the native UiAutomator's `By.clazz` [locator](https://developer.android.com/reference/androidx/test/uiautomator/BySelector#clazz(java.lang.String)) (exact match of element's class). | `⭐⭐⭐⭐⭐` | 'android.view.View'\n-android uiautomator | This strategy is mapped to the native UiAutomator's `UiSelector` [locator](https://developer.android.com/reference/androidx/test/uiautomator/UiSelector)). It is even possible to perform some advanced operations, like scrolling, with this locator type. Check [Guide on UiAutomator Locator Types](docs/uiautomator-uiselector.md) | `⭐⭐⭐⭐` | new UiScrollable(new UiSelector().resourceId(\\\"android:id/list\\\")).scrollIntoView(new UiSelector().text(\\\"Radio Group\\\"))\nxpath | For elements lookup Xpath strategy the driver uses the same XML tree that is generated by page source API. Only Xpath 1.0 is supported for appium-uiatomator2-server versions below 4.25.0. All server versions starting from 4.25.0 support both Xpath 1.0 and 2.0 | `⭐⭐⭐` | By.xpath(\"//android.view.View[@text=\\\"Regular\\\" and @checkable=\\\"true\\\"]\")\n\n\u003e [!NOTE] For testing multi-window applications, see the [Multi-Window Testing Guide](docs/android-multiwindow.md).\n\n\u003e [!WARNING]\n\u003e Google is going to [deprecate](https://developer.android.com/training/testing/other-components/ui-automator-legacy#ui-automator)\n\u003e and remove `UiCollection`, `UiObject`, `UiScrollable`, and `UiSelector` support from the UiAutomator framework.\n\u003e This will render all `-android uiautomator`-based locators invalid, so please keep it in mind while\n\u003e using them or plan to use them in the future.\n\n\n## BiDi Protocol Support\n\nUIAutomator2 driver has partial support of the [BiDi Protocol](https://w3c.github.io/webdriver-bidi/) since version 3.7.10. Check the [Supported BiDi Commands And Events](./docs/bidi.md) document for more details.\n\n\n## Parallel Tests\n\nIt is possible to execute tests in parallel using UiAutomator2 driver.\nAppium allows to do this on per-process (multiple server processes running on different ports managing single session)\nor per-request basis (single server process managing multiple sessions, more preferable, uses less resources and ensures better control over running sessions).\n\n_Note_: If you are not going to run your tests in parallel then consider enabling the `--session-override` Appium server argument.\nIt forces the server to close all pending sessions before a new one could be opened,\nwhich allows you to avoid possible issues with such sessions silently running/expiring in the background.\n\n### Important Real Device Capabilities\n\n- `udid`: The unique device id.\n- `systemPort`: Set a unique system port number for each parallel session. Otherwise you might get a port conflict such as in [this issue](https://github.com/appium/appium/issues/7745).\n- `chromedriverPort`: The unique chromedriver port if testing web views or Chrome.\n- `mjpegServerPort`: Set a unique MJPEG server port for each parallel session if you are going to record a video.\n\n### Important Emulator Capabilities\n\n- `avd`: The unique emulator name.\n- `systemPort`: Set a unique system port number for each parallel session.\n- `chromedriverPort`: The unique chromedriver port (if testing web views or Chrome).\n- `mjpegServerPort`: Set a unique MJPEG server port for each parallel session if you are going to record a video.\n\n\n## Settings API\n\nUiAutomator2 driver supports Appium [Settings API](https://appium.io/docs/en/latest/guides/settings/).\nAlong with the common settings the following driver-specific settings are currently available:\n\nName | Type | Description\n--- | --- | ---\nactionAcknowledgmentTimeout | long | Maximum number of milliseconds to wait for an acknowledgment of generic uiautomator actions, such as clicks, text setting, and menu presses. The acknowledgment is an [AccessibilityEvent](http://developer.android.com/reference/android/view/accessibility/AccessibilityEvent.html) corresponding to an action, that lets the framework determine if the action was successful. Generally, this timeout should not be modified. `3000` ms by default\nallowInvisibleElements | boolean | Whether to include elements that are not visible to the user (e. g. whose `displayed` attribute is `false`) to the XML source tree. `false` by default\nignoreUnimportantViews | boolean | Enables or disables layout hierarchy compression. If compression is enabled, the layout hierarchy derived from the Acessibility framework will only contain nodes that are important for uiautomator testing. Any unnecessary surrounding layout nodes that make viewing and searching the hierarchy inefficient are removed. `false` by default\nelementResponseAttributes | string | Comma-separated list of element attribute names to be included into findElement response. By default only element UUID is present there, but it is also possible to add the following items: `name`, `text`, `rect`, `enabled`, `displayed`, `selected`, `attribute/\u003celement_attribute_name\u003e`. It is required that `shouldUseCompactResponses` setting is set to `false` in order for this one to apply.\nenableMultiWindows | boolean | Whether to include all windows that the user can interact with (for example an on-screen keyboard) while building the XML page source (`true`). By default it is `false` and only the single active application window is included to the page source. See the [Multi-Window Testing Guide](docs/android-multiwindow.md) for detailed information.\nenableTopmostWindowFromActivePackage | boolean | Whether to limit the window with the highest Z-order from the active package for interactions and page source retrieval. By default it is `false` and the active application window, which may not necessarily have this order, is included to the page source. See the [Multi-Window Testing Guide](docs/android-multiwindow.md) for detailed information.\nenableNotificationListener | boolean | Whether to enable (`true`) toast notifications listener to listen for new toast notifications. By default this listener is enabled and UiAutomator2 server includes the text of toast messages to the generated XML page source, but not for longer than `3500` ms after the corresponding notification expires.\nkeyInjectionDelay | long | Delay in milliseconds between key presses when injecting text input. 0 ms by default\nscrollAcknowledgmentTimeout | long | Timeout for waiting for an acknowledgement of an uiautomator scroll swipe action. The acknowledgment is an [AccessibilityEvent](http://developer.android.com/reference/android/view/accessibility/AccessibilityEvent.html), corresponding to the scroll action, that lets the framework determine if the scroll action was successful. Generally, this timeout should not be modified. `200` ms by default\nshouldUseCompactResponses | boolean | Used in combination with `elementResponseAttributes` setting. If set to `false` then the findElement response is going to include the items enumerated in `elementResponseAttributes` setting. `true` by default\nwaitForIdleTimeout | long | Timeout used for waiting for the user interface to go into an idle state. By default, all core uiautomator objects except UiDevice will perform this wait before starting to search for the widget specified by the object's locator. Once the idle state is detected or the timeout elapses (whichever occurs first), the object will start to wait for the selector to find a match. Consider lowering the value of this setting if you experience long delays while interacting with accessibility elements in your test. `10000` ms by default.\nwaitForSelectorTimeout | long | Timeout for waiting for a widget to become visible in the user interface so that it can be matched by a selector. Because user interface content is dynamic, sometimes a widget may not be visible immediately and won't be detected by a selector. This timeout allows the uiautomator framework to wait for a match to be found, up until the timeout elapses. This timeout is only applied to `android uiautomator` location strategy. `10000` ms by default\nnormalizeTagNames | boolean | Being set to `true` applies unicode-to-ascii normalization of element class names used as tag names in the page source XML document. This is necessary if the application under test has some Unicode class names, which cannot be used as XML tag names by default due to known bugs in Android's XML DOM parser implementation. `false` by default\nshutdownOnPowerDisconnect | boolean | Whether to shutdown the server if the device under test is disconnected from a power source (e. g. stays on battery power). `true` by default.\nsimpleBoundsCalculation | boolean | Whether to calculate element bounds as absolute values (`true`) or check if the element is covered by other elements and thus partially hidden (`false`, the default behaviour). Setting this setting to `true` helps to improve the performance of XML page source generation, but decreases bounds preciseness. Use with care.\ntrackScrollEvents | boolean | Whether to apply scroll events tracking (`true`, the default value), so the server could calculate the value of `contentSize` attribute. Having this setting enabled may add delays to all scrolling actions.\nwakeLockTimeout | long | The timeout in milliseconds of wake lock that UiAutomator2 server acquires by default to prevent the device under test going to sleep while an automated test is running. By default the server acquires the lock for 24 hours. Setting this value to zero forces the server to release the wake lock.\nserverPort | int | The number of the port on the remote device to start UiAutomator2 server on. Do not mix this with `systemPort`, which is acquired on the host machine. Must be in range 1024..65535. `6790` by default\nmjpegServerPort | int | The number of the port on the remote device to start MJPEG screenshots broadcaster on. Must be in range 1024..65535. `7810` by default\nmjpegServerFramerate | int | The maximum count of screenshots per second taken by the MJPEG screenshots broadcaster. Must be in range 1..60. `10` by default\nmjpegScalingFactor | int | The percentage value used to apply downscaling on the screenshots generated by the MJPEG screenshots broadcaster. Must be in range 1..100. `50` is by default, which means that screenshots are downscaled to the half of their original size keeping their original proportions.\nmjpegServerScreenshotQuality | int | The percentage value used to apply lossy JPEG compression on the screenshots generated by the MJPEG screenshots broadcaster. Must be in range 1..100. `50` is by default, which means that screenshots are compressed to the half of their original quality.\nmjpegBilinearFiltering | boolean | Controls whether (`true`) or not (`false`, the default value) to apply bilinear filtering to MJPEG screenshots broadcaster resize algorithm. Enabling this flag may improve the quality of the resulting scaled bitmap, but may introduce a small performance hit. See the [MJPEG guide](docs/mjpeg.md) for details on all MJPEG settings.\nuseResourcesForOrientationDetection | boolean | Defines the strategy used by UiAutomator2 server to detect the original device orientation. By default (`false` value) the server uses device rotation value for this purpose. Although, this approach may not work for some devices and a portrait orientation may erroneously be detected as the landscape one (and vice versa). In such case it makes sense to play with this setting.\nenforceXPath1 | boolean | Since UiAutomator2 driver version `4.25.0` XPath2 is set as the default and the recommended interpreter for the corresponding element locators. This interpreter is based on [Psychopath XPath2](https://wiki.eclipse.org/PsychoPathXPathProcessor) implementation, which is now a part of the Eclipse foundation. In most of the cases XPath1 locators are also valid XPath2 locators, so there should be no issues while locating elements. Although, since the XPath2 standard is much more advanced in comparison to the previous version, some [issues](https://github.com/appium/appium/issues/16142) are possible for more sophisticated locators, which cannot be fixed easily, as we depend on the third-party library mentioned above. Then try to workaround such issues by enforcing XPath1 usage (whose implementation is a part of the Android platform itself) and assigning this setting to `true`. Note, this setting is actually applied at the time when the element lookup by XPath is executed, so you could switch it on or off whenever needed throughout your automated testing session.\nlimitXPathContextScope | boolean | Due to historical reasons UiAutomator2 driver limits scopes of element context-based searches to the parent element. This means a request like `findElement(By.xpath, \"//root\").findElement(By.xpath, \"./..\")` would always fail, because the driver only collects descendants of the `root` element for the destination XML source. The `limitXPathContextScope` setting being set to `false` changes that default behavior, so the collected page source includes the whole page source XML where `root` node is set as the search context. With that setting disabled the search query above should not fail anymore. Although, you must still be careful while building XPath requests for context-based searches with the `limitXPathContextScope` setting set to `false`. A request like `findElement(By.xpath, \"//root\").findElement(By.xpath, \"//element\")` would ignore the current context and search for `element` trough the whole page source. Use `.` notation to correct that behavior and only find `element` nodes which are descendants of the `root` node: `findElement(By.xpath, \"//root\").findElement(By.xpath, \".//element\")`.\ndisableIdLocatorAutocompletion | boolean | According to internal Android standards it is expected that each resource identifier is prefixed with `\u003cpackageName\u003e:id/` string. This should guarantee uniqueness of each identifier. Although some application development frameworks ignore this rule and don't add such prefix automatically or, rather, let it up to the developer to decide how to represent their application identifiers. For example, [testTag modifier attribute in the Jetpack Compose](https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/package-summary#(androidx.compose.ui.Modifier).testTag(kotlin.String)) with [testTagsAsResourceId](https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/package-summary#(androidx.compose.ui.semantics.SemanticsPropertyReceiver).testTagsAsResourceId()) allows developers to set an arbitrary string without the prefix rule. [Interoperability with UiAutomator](https://developer.android.com/jetpack/compose/testing) also explains how to set it. By default UIA2 driver adds the above prefixes automatically to all resource id locators if they are not prefixed, but in case of such \"special\" apps this feature might be disabled by assigning the setting to `true`.\nalwaysTraversableViewClasses | string | Allows to continue the tree traversal for user defined classes even though the node itself is invisible. The default logic for the UI tree traversal (controlled by the `allowInvisibleElements` setting) is to stop recursing when an invisible node is found. However, with certain Jetpack Compose classes (e.g. androidx.compose.ui.viewinterop.ViewFactoryHolder), it is possible that invisible parent nodes have visible child nodes.  See [Google issue \\#354958193](https://issuetracker.google.com/issues/354958193) and [UIA2 server issue \\#709](https://github.com/appium/appium-uiautomator2-server/issues/709) for more details. This setting only affects the XPath lookup and the page source buildup. You can provide a comma separated list of glob patterns, that will be used as an exemption list: `androidx.compose.ui.viewinterop.*,android.widget.ImageButton`. Available since the driver version 5.0.3.\nincludeExtrasInPageSource | boolean | Whether to include `extras` element attribute in the XML page source result. Then, XPath locator can find the element by the extras. Its value consists of combined [getExtras](https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo#getExtras()) as `keys=value` pair separated by a semicolon (`;`), thus you may need to find the element with partial matching like `contains` e.g. `driver.find_element :xpath, '//*[contains(@extras, \"AccessibilityNodeInfo.roleDescription=\")]'`. The value could be huge if elements in the XML page source have large `extras`. It could affect the performance of XML page source generation.\nincludeA11yActionsInPageSource | boolean | Whether to include `actions` element attribute in the XML page source result. Its value consists of names of available accessibility actions from [getActionList](https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo#getActionList()), separated by a comma. The value could be huge if elements in the XML page source have a lot of actions and could affect the performance of XML page source generation.\nsnapshotMaxDepth | int | The number of maximum depth for the source tree snapshot. The default value is `70`. This number should be in range [1, 500]. A part of the elements source tree might be lost if the value is too low. Also, StackOverflowError might be caused if the value is too high (Issues [12545](https://github.com/appium/appium/issues/12545), [12892](https://github.com/appium/appium/issues/12892)). The available driver version is `2.27.0` or higher.\ncurrentDisplayId | int | The id of the display that should be used when finding elements, taking screenshots, etc. It can be found in the output of `adb shell dumpsys display` (search for `mDisplayId`). The default value is [Display.DEFAULT_DISPLAY](https://developer.android.com/reference/android/view/Display#DEFAULT_DISPLAY). See the [Multi-Window Testing Guide](docs/android-multiwindow.md) for detailed information about windows, displays, and how this setting affects element location. Set this setting to `-1` in order to reset it.\n\n\n## Platform-Specific Extensions\n\nBeside of standard W3C APIs the driver provides the below custom command extensions to execute platform specific scenarios. Use the following source code examples in order to invoke them from your client code:\n\n```java\n// Java 11+\nvar result = driver.executeScript(\"mobile: \u003cmethodName\u003e\", Map.ofEntries(\n    Map.entry(\"arg1\", \"value1\"),\n    Map.entry(\"arg2\", \"value2\")\n    // you may add more pairs if needed or skip providing the map completely\n    // if all arguments are defined as optional\n));\n```\n\n```js\n// WebdriverIO\nconst result = await driver.executeScript('mobile: \u003cmethodName\u003e', [{\n    arg1: \"value1\",\n    arg2: \"value2\",\n}]);\n```\n\n```python\n# Python\nresult = driver.execute_script('mobile: \u003cmethodName\u003e', {\n    'arg1': 'value1',\n    'arg2': 'value2',\n})\n```\n\n```ruby\n# Ruby\nresult = @driver.execute_script 'mobile: \u003cmethodName\u003e', {\n    arg1: 'value1',\n    arg2: 'value2',\n}\n```\n\n```csharp\n// Dotnet\nobject result = driver.ExecuteScript(\"mobile: \u003cmethodName\u003e\", new Dictionary\u003cstring, object\u003e() {\n    {\"arg1\", \"value1\"},\n    {\"arg2\", \"value2\"}\n});\n```\n\n### mobile: shell\n\nExecutes the given shell command on the device under test via ADB connection. This extension exposes a potential security risk and thus is only enabled when explicitly activated by the `uiautomator2:adb_shell` server command line feature specifier.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\ncommand | string | yes | Shell command name to execute, for example `echo` or `rm` | echo\nargs | Array\u0026lt;string\u0026gt; | no | Array of command arguments | `['-f', '/sdcard/myfile.txt']`\ntimeout | number | no | Command timeout in milliseconds. If the command blocks for longer than this timeout then an exception is going to be thrown. The default timeout is `20000` ms | 100000\nincludeStderr | boolean | no | Whether to include stderr stream into the returned result. `false` by default | true\n\n#### Returned Result\n\nDepending on the `includeStderr` value this API could either return a string, which is equal to the `stdout` stream content of the given command or a dictionary whose elements are `stdout` and `stderr` and values are contents of the corresponding outgoing streams. If the command exits with a non-zero return code then an exception is going to be thrown. The exception message will be equal to the command stderr.\n\n### mobile: execEmuConsoleCommand\n\nExecutes a command through emulator telnet console interface and returns its output.\nThe `emulator_console` server feature must be enabled in order to use this method.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\ncommand | string | yes | The actual command to execute. See [Android Emulator Console Guide](https://developer.android.com/studio/run/emulator-console) for more details on available commands | help-verbose\nexecTimeout | number | no | Timeout used to wait for a server reply to the given command in milliseconds. `60000` ms by default | 100000\nconnTimeout | boolean | no | Console connection timeout in milliseconds. `5000` ms by default | 10000\ninitTimeout | boolean | no | Telnet console initialization timeout in milliseconds (the time between the connection happens and the command prompt). `5000` ms by default | 10000\n\n#### Returned Result\n\nThe actual command output. An error is thrown if command execution fails.\n\n### Mobile Gesture Commands\n\nUiAutomator2 provides several extensions that allow to automate popular mobile gesture shortcuts:\n\n- mobile: dragGesture\n- mobile: flingGesture\n- mobile: doubleClickGesture\n- mobile: clickGesture\n- mobile: longClickGesture\n- mobile: pinchCloseGesture\n- mobile: pinchOpenGesture\n- mobile: swipeGesture\n- mobile: scrollGesture\n\nThese gestures are documented in the [Automating Mobile Gestures](docs/android-mobile-gestures.md) tutorial. Check [W3C Actions API](https://appiumpro.com/editions/29-automating-complex-gestures-with-the-w3c-actions-api) and\n[Low-Level Insights on Android Input Events](docs/actions.md) if you need to automate more complicated gestures.\n\n### mobile: scroll\n\nScrolls the given scrollable element until an element identified by `strategy` and `selector` becomes visible. This function returns immediately if the destination element is already visible in the view port. Otherwise it would scroll to the very beginning of the scrollable control and tries to reach the destination element by scrolling its parent to the end step by step. The scroll direction (vertical or horizontal) is detected automatically.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nelementId | string | no | The identifier of the scrollable element. It is required this element is a valid scrollable container and it was located by `-android uiautomator` strategy. If this property is not provided then the first currently available scrollable view is selected for the interaction. | 123456-3456-3435-3453453\nstrategy | string | yes | The following strategies are supported: `accessibility id` (UiSelector().description), `class name` (UiSelector().className), `-android uiautomator` (UiSelector) | 'accessibility id'\nselector | string | yes | The corresponding lookup value for the selected strategy. | 'com.mycompany:id/table'\nmaxSwipes | number | no | The maximum number of swipes to perform on the target scrollable view in order to reach the destination element. In case this value is unset then it would be retrieved from the scrollable element itself (vua `getMaxSearchSwipes()` property). | 10\n\n### mobile: deepLink\n\nStart URI that may take users directly to the specific content in the app. Read [Reliably Opening Deep Links Across Platforms and Devices](https://appiumpro.com/editions/84-reliably-opening-deep-links-across-platforms-and-devices) for more details.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nurl | string | yes | The URL to start | theapp://login/\npackage | string | no | The name of the package to start the URI with. This argument was required previously but became optional since version 3.9.3 | 'com.mycompany'\nwaitForLaunch | boolean | no | If `false` then ADB won't wait for the started activity to return the control. `true` by default | false\n\n### mobile: startLogsBroadcast\n\nStarts Android logcat broadcast websocket on the same host and port where Appium server is running at `/ws/session/:sessionId:/appium/device/logcat` endpoint. The method will return immediately if the web socket is already listening. Each connected websocket listener will receive logcat log lines as soon as they are visible to Appium. Read [Using Mobile Execution Commands to Continuously Stream Device Logs with Appium](https://appiumpro.com/editions/55-using-mobile-execution-commands-to-continuously-stream-device-logs-with-appium) for more details.\n\nConsider using [logs broadcast via BiDi](./docs/bidi.md#logentryadded) over this extension.\n\n### mobile: stopLogsBroadcast\n\nStops the previously started logcat broadcasting websocket server. This method will return immediately if no server is running. Read [Using Mobile Execution Commands to Continuously Stream Device Logs with Appium](https://appiumpro.com/editions/55-using-mobile-execution-commands-to-continuously-stream-device-logs-with-appium) for more details.\n\nConsider using [logs broadcast via BiDi](./docs/bidi.md#logentryadded) over this extension.\n\n### mobile: deviceidle\n\nThis is a wrapper to 'adb shell dumpsys deviceidle' interface.\nRead [Diving Into Android 'M' Doze](https://www.protechtraining.com/blog/post/diving-into-android-m-doze-875) for more details.\nThis API only exists since Android 6.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\naction | whitelistAdd or whitelistRemove | yes | The name of the action to perform | whitelistAdd\npackages | string or string[] | yes | One or more package names to perfom the above action on | 'com.mycompany'\n\n### mobile: acceptAlert\n\nTries to accept an Android alert. This method might not always be reliable as there is no single standard for how Android alerts should look like within the Accessibility representation.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nbuttonLabel | string | no | The name/text of the alert button to click in order to accept it. If not provided then the driver will try to autodetect it | Accept\n\n### mobile: dismissAlert\n\nTries to dismiss an Android alert. This method might not always be reliable as there is no single standard for how Android alerts should look like within the Accessibility representation.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nbuttonLabel | string | no | The name/text of the alert button to click in order to dismiss it. If not provided then the driver will try to autodetect it | Dismiss\n\n### mobile: batteryInfo\n\nRetrieves the battery information from the device under test.\n\n#### Returned Result\n\nThe extension returns a dictionary whose entries are:\n\nName | Type | Description | Example\n--- | --- | --- | ---\nlevel | number | Battery level in range [0.0, 1.0], where 1.0 means 100% charge. -1 is returned if the actual value cannot be retrieved from the system. | 0.5\nstate | number| Battery state. The following values are possible: BATTERY_STATUS_UNKNOWN = 1; BATTERY_STATUS_CHARGING = 2; BATTERY_STATUS_DISCHARGING = 3; BATTERY_STATUS_NOT_CHARGING = 4; BATTERY_STATUS_FULL = 5. -1 is returned if the actual value cannot be retrieved from the system. | 4\n\n### mobile: deviceInfo\n\nRetrieves the information about the device under test, like the device model, serial number, network connectivity info, etc.\n\n#### Returned Result\n\nThe extension returns a dictionary whose entries are the device properties. Check https://github.com/appium/appium-uiautomator2-server/blob/master/app/src/main/java/io/appium/uiautomator2/handler/GetDeviceInfo.java to get the full list of returned keys and their corresponding values.\n\n### mobile: resetAccessibilityCache\n\nResets the accessibility cache on the device. This can be useful when the accessibility\nservice cache becomes stale and needs to be refreshed to reflect the current UI state.\nThe driver does cache reset automatically before any element lookup as well as before\nretrieving a page source, hovewer it makes sense to call this method manually to avoid stale reference errors or interaction issues if the application under test posseses\nhighly dynamic elements. Note that this methods also waits until app under test becomes\nidle, so it might also slow down your automation if called too often under non-idling\ncircumstances.\n\n### mobile: listWindows\n\nGets a list of windows on all displays. For Android API 30+ (R), uses `getWindowsOnAllDisplays()` to retrieve windows from all displays. For older APIs, uses `getWindows()` which only returns windows from the default display.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nfilters | object | no | Optional filters to apply to the window list. All filters are applied with AND logic (all must match). Supported filter keys: | `{packageName: 'com.example.app', displayId: 0}`\n | | | | `packageName` (string): Package name pattern with glob support (e.g., `com.example.*`) |\n | | | | `windowId` (number): Window identifier |\n | | | | `displayId` (number): Display identifier |\n | | | | `physicalDisplayId` (string): Physical display identifier (as string to avoid JavaScript number precision issues) |\n | | | | `type` (number): Window type (see [AccessibilityWindowInfo.TYPE_*](https://developer.android.com/reference/android/view/accessibility/AccessibilityWindowInfo#TYPE_APPLICATION) constants) |\n | | | | `title` (string): Window title pattern with glob support |\n | | | | `layer` (number): Window Z-order layer (higher values are on top) |\n | | | | `isAccessibilityFocused` (boolean): Whether the window has accessibility focus |\n | | | | `isActive` (boolean): Whether the window is active |\n | | | | `isFocused` (boolean): Whether the window has input focus |\n | | | | `isInPictureInPictureMode` (boolean): Whether the window is in picture-in-picture mode |\nskipScreenshots | boolean | no | Whether to skip taking screenshots for each window. Defaults to `false`. Setting this to `true` can improve performance. Screenshots are only available on Android API 34+ even when this is `false`. | true\n\n#### Returned Result\n\nThe extension returns an array of window information objects. Each object contains:\n\nName | Type | Description | Example\n--- | --- | --- | ---\nwindowId | number \\| null | Window identifier (may be null if the window ID cannot be determined) | 42\ndisplayId | number | Display identifier where the window is located | 0\nphysicalDisplayId | string \\| null | Physical display identifier (may be null). Returned as a string to avoid JavaScript number precision issues with large values. | '1234567890'\nvirtualDisplayId | string \\| null | Virtual display identifier (may be null). Only set for virtual displays, null otherwise. Parsed from 'dumpsys SurfaceFlinger --displays' output by matching display name. | '12345'\nrect | object | Window bounds rectangle with `left`, `top`, `right`, `bottom` properties | `{left: 0, top: 0, right: 1080, bottom: 1920}`\npackageName | string \\| null | Package name of the application that owns this window (may be null) | `com.example.app`\nscreenshot | string \\| null | Base64-encoded PNG screenshot of the window (may be null). Only available on Android API 34+ and when `skipScreenshots` is `false`. | `iVBORw0KGgoAAAANSUhEUgAA...`\ntype | number | Window type. See [AccessibilityWindowInfo.TYPE_*](https://developer.android.com/reference/android/view/accessibility/AccessibilityWindowInfo#TYPE_APPLICATION) constants for possible values (e.g., `TYPE_APPLICATION`, `TYPE_INPUT_METHOD`, `TYPE_SYSTEM`, `TYPE_ACCESSIBILITY_OVERLAY`, `TYPE_SPLIT_SCREEN_DIVIDER`). | 1\ntitle | string \\| null | Window title (may be null) | 'My App Window'\nlayer | number | Window Z-order layer. Higher values indicate windows that are drawn on top of windows with lower layer values. | 100\nisAccessibilityFocused | boolean | Whether the window has accessibility focus | true\nisActive | boolean | Whether the window is active | true\nisFocused | boolean | Whether the window has input focus | true\nisInPictureInPictureMode | boolean | Whether the window is in picture-in-picture mode | false\n\n### mobile: listDisplays\n\nGets a list of all displays available on the device.\n\n#### Returned Result\n\nThe extension returns an array of display information objects. Each object contains:\n\nName | Type | Description | Example\n--- | --- | --- | ---\nid | number | Display identifier (logical display ID). This is the value used by the `currentDisplayId` setting. | 0\nname | string \\| null | Display name (may be null) | 'Built-in Screen'\nphysicalId | string \\| null | Physical display identifier (may be null). Returned as a string to avoid JavaScript number precision issues with large values. This is the value used by the `mobile: screenshots` method. | '1234567890'\nvirtualId | string \\| null | Virtual display identifier (may be null). Only set for virtual displays, null otherwise. Parsed from 'dumpsys SurfaceFlinger --displays' output by matching display name. | '12345'\nmetrics | object | Display metrics containing size and density information. See below for details. | See metrics table\nisDefault | boolean | Whether this is the default display | true\n\n#### Display Metrics\n\nThe `metrics` object contains the following properties:\n\nName | Type | Description | Example\n--- | --- | --- | ---\nwidthPixels | number | Display width in pixels | 1080\nheightPixels | number | Display height in pixels | 1920\ndensity | number | Display density (logical density factor). This is a scaling factor for the display. | 2.625\ndensityDpi | number | Display density in DPI (dots per inch) | 420\nscaledDensity | number | Scaled density factor for fonts. This is typically the same as `density` but may be adjusted by the user's font size preference. | 2.625\nxdpi | number | Exact physical pixels per inch of the screen in the X dimension | 420.0\nydpi | number | Exact physical pixels per inch of the screen in the Y dimension | 420.0\n\n**Example:**\n```python\n# List all displays\ndisplays = driver.execute_script('mobile: listDisplays')\n\nfor display in displays:\n    print(f\"Display ID: {display['id']}\")\n    print(f\"  Name: {display['name']}\")\n    print(f\"  Physical ID: {display['physicalId']}\")\n    if display.get('virtualId'):\n        print(f\"  Virtual ID: {display['virtualId']}\")\n    print(f\"  Is default: {display['isDefault']}\")\n    print(f\"  Size: {display['metrics']['widthPixels']}x{display['metrics']['heightPixels']}\")\n    print(f\"  Density: {display['metrics']['density']} ({display['metrics']['densityDpi']} DPI)\")\n```\n\n### mobile: getDeviceTime\n\nRetrieves the current device's timestamp.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nformat | string | no | The set of format specifiers. Read https://momentjs.com/docs/ to get the full list of supported datetime format specifiers. The default format is `YYYY-MM-DDTHH:mm:ssZ`, which complies to ISO-8601 | YYYY-MM-DDTHH:mm:ssZ\n\n#### Returned Result\n\nThe device timestamp string formatted according to the given specifiers\n\n### mobile: changePermissions\n\nChanges package permissions in runtime.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\npermissions | string or Array\u0026lt;string\u0026gt; | yes | The full name of the permission to be changed or a list of permissions. Consider checking [the full list](https://developer.android.com/reference/android/Manifest.permission) of standard Android permission names. If `all` magic string is passed (available since driver version 2.8.0) and `target` equals `pm` (the default value) then the chosen action is going to be applied to all permissions requested/granted by the 'appPackage'. If `target` is set to `appops` (available since v2.11.0) then check [AppOpsManager.java](https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/app/AppOpsManager.java) sources to get the full list of supported appops permission names for the given Android platform. The `all` magic string is unsupported for the `appops` target. | `['android.permission.ACCESS_FINE_LOCATION', 'android.permission.BROADCAST_SMS']` `all` `['READ_SMS', 'ACCESS_NOTIFICATIONS']`\nappPackage | string | no | The application package to set change permissions on. Defaults to the package name under test | com.mycompany.myapp\naction | string | no | Either `grant` (the default action) or `revoke` if `target` is set to `pm`, otherwise one of: `allow` (default), `deny`, `ignore`, `default`. | allow\ntarget | string | no | Either `pm` (default) or `appops` (available since v2.11.0). The `appops` one requires *adb_shell* server security option to be enabled | appops\n\n### mobile: getPermissions\n\nGets runtime permissions list for the given application package.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\ntype | string | no | One of possible permission types to get. Can be one of: `denied`, `granted` or `requested` (the default value). | granted\nappPackage | string | no | The application package to get permissions from. Defaults to the package name under test | com.mycompany.myapp\n\n#### Returned Result\n\nArray of strings, where each string is a permission name. the array could be empty.\n\n### mobile: performEditorAction\n\nPerforms IME action on the _currently focused_ edit element.\n\nVery often Android developers use [onEditorAction](https://developer.android.com/reference/android/widget/TextView.OnEditorActionListener.html#onEditorAction(android.widget.TextView,%20int,%20android.view.KeyEvent)) callback with `actionId` argument to implement actions handling, for example, when `Search` or `Done` button is pressed on the on-screen keyboard. This mobile extension is supposed to emulate the invokation of such callback on the focused element.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\naction | string | yes | The name or an integer code of the editor action to be executed. The following action names are supported: `normal, unspecified, none, go, search, send, next, done, previous`. Read [EditorInfo](https://developer.android.com/reference/android/view/inputmethod/EditorInfo) for more details on this topic. | search\n\n### mobile: startScreenStreaming\n\nStarts device screen broadcast by creating MJPEG server. Multiple calls to this method have no effect unless the previous streaming session is stopped. This method only works if the `adb_screen_streaming` feature is enabled on the server side. It is also required that [GStreamer](https://gstreamer.freedesktop.org/) with `gst-plugins-base`, `gst-plugins-good` and `gst-plugins-bad` packages are installed and available in PATH on the server machine. For the built-in device MJPEG stream (no GStreamer on host), see the [MJPEG guide](docs/mjpeg.md).\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nwidth | number | no | The scaled width of the device's screen. If unset then the script will assign it to the actual screen width measured in pixels. | 768\nheight | number | no | The scaled height of the device's screen. If unset then the script will assign it to the actual screen height measured in pixels. | 1024\nbitRate | number | no | The video bit rate for the video, in bits per second. The default value is 4000000 (4 Mb/s). You can increase the bit rate to improve video quality, but doing so results in larger movie files. | 1024000\nhost | string | no | The IP address/host name to start the MJPEG server on. You can set it to `0.0.0.0` to trigger the broadcast on all available network interfaces. `127.0.0.1` by default | 0.0.0.0\npathname | string | no | The HTTP request path the MJPEG server should be available on. If unset then any pathname on the given `host`/`port` combination will work. Note that the value should always start with a single slash: `/` | /myserver\ntcpPort | number | no | The port number to start the internal TCP MJPEG broadcast on. This type of broadcast always starts on the loopback interface (`127.0.0.1`). `8094` by default | 5024\nport | number | no | The port number to start the MJPEG server on. `8093` by default | 5023\nquality | number | no | The quality value for the streamed JPEG images. This number should be in range [1, 100], where 100 is the best quality. `70` by default | 80\nconsiderRotation | boolean | no | If set to `true` then GStreamer pipeline will increase the dimensions of the resulting images to properly fit images in both landscape and portrait orientations. Set it to `true` if the device rotation is not going to be the same during the broadcasting session. `false` by default | false\nlogPipelineDetails | boolean | no | Whether to log GStreamer pipeline events into the standard log output. Might be useful for debugging purposes. `false` by default | true\n\n### mobile: stopScreenStreaming\n\nStop the previously started screen streaming. If no screen streaming server has been started then nothing is done.\n\n### mobile: getNotifications\n\nRetrieves Android notifications via Appium Settings helper. Appium Settings app itself must be *manually* granted to access notifications under device Settings in order to make this feature working. Different vendors [might](https://github.com/appium/io.appium.settings/issues/147#issue-2130780990) require more than just the normal Notification permissions at the usual Apps menu. Try to look in places like Privacy menus if you are getting zero items retrieved while expecting some results.\n\nAppium Settings helper keeps all the active notifications plus notifications that appeared while it was running in the internal buffer, but no more than 100 items altogether. Newly appeared notifications are always added to the head of the notifications array. The `isRemoved` flag is set to `true` for notifications that have been removed.\nSee https://developer.android.com/reference/android/service/notification/StatusBarNotification and https://developer.android.com/reference/android/app/Notification.html for more information on available notification properties and their values.\n\n#### Returned Result\n\nThe example output is:\n```json\n{\n   \"statusBarNotifications\":[\n     {\n       \"isGroup\":false,\n       \"packageName\":\"io.appium.settings\",\n       \"isClearable\":false,\n       \"isOngoing\":true,\n       \"id\":1,\n       \"tag\":null,\n       \"notification\":{\n         \"title\":null,\n         \"bigTitle\":\"Appium Settings\",\n         \"text\":null,\n         \"bigText\":\"Keep this service running, so Appium for Android can properly interact with several system APIs\",\n         \"tickerText\":null,\n         \"subText\":null,\n         \"infoText\":null,\n         \"template\":\"android.app.Notification$BigTextStyle\"\n       },\n       \"userHandle\":0,\n       \"groupKey\":\"0|io.appium.settings|1|null|10133\",\n       \"overrideGroupKey\":null,\n       \"postTime\":1576853518850,\n       \"key\":\"0|io.appium.settings|1|null|10133\",\n       \"isRemoved\":false\n     }\n   ]\n}\n```\n\n### mobile: openNotifications\n\nOpens notifications drawer on the device under test. Does nothing if the drawer is already opened. Available since driver version 2.23\n\n### mobile: listSms\n\nRetrieves the list of the most recent SMS properties list via Appium Settings helper. Messages are sorted by date in descending order.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nmax | number | no | The maximum count of recent messages to retrieve. `100` by default | 10\n\n#### Returned Result\n\nThe example output is:\n```json\n {\n   \"items\":[\n     {\n       \"id\":\"2\",\n       \"address\":\"+123456789\",\n       \"person\":null,\n       \"date\":\"1581936422203\",\n       \"read\":\"0\",\n       \"status\":\"-1\",\n       \"type\":\"1\",\n       \"subject\":null,\n       \"body\":\"\\\"text message2\\\"\",\n       \"serviceCenter\":null\n     },\n     {\n       \"id\":\"1\",\n       \"address\":\"+123456789\",\n       \"person\":null,\n       \"date\":\"1581936382740\",\n       \"read\":\"0\",\n       \"status\":\"-1\",\n       \"type\":\"1\",\n       \"subject\":null,\n       \"body\":\"\\\"text message\\\"\",\n       \"serviceCenter\":null\n     }\n   ],\n   \"total\":2\n }\n```\n\n### mobile: type\n\nTypes the given Unicode string. It is expected that the focus is already put to the destination input field before this method is called. The main difference between this method and the sendKeys one is that it emulates `true` typing like it was done from an on-screen keyboard. It also properly supports Unicode input characters.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\ntext | string | yes | The text to type | testing\n\n### mobile: sensorSet\n\nEmulate changing of sensor values on the connected emulator.\nThis extension does not work on real devices.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nsensorType | string | yes | The set of all supported sensor types could be found in [adb-emu-commands.js](https://github.com/appium/appium-adb/blob/master/lib/tools/adb-emu-commands.js) (look for *SENSORS* object values). Check the output of `sensor status` command in the [emulator console](https://developer.android.com/studio/run/emulator-console) to see more details on the available sensor types | light\nvalue | string | yes | Check the output of `sensor get \u003csensorType\u003e` command in the [emulator console](https://developer.android.com/studio/run/emulator-console) to see the acceptable value format for the given sensor type | 50\n\n### mobile: pullFile\n\nPulls a remote file from the device.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nremotePath | string | yes | The full path to the remote file or a specially formatted path, which points to an item inside an app bundle, for example `@my.app.id/my/path`. It is mandatory for the app bundle to have [debugging enabled](https://developer.android.com/studio/debug) in order to use the latter remotePath format. If the file with the given name does not exist then an exception will be thrown. | /sdcard/foo.bar\n\n#### Returned Result\n\nBase64-encoded string, which represents the content of the remote file.\n\n### mobile: pushFile\n\nPushes a local file to the device.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nremotePath | string | yes | The path on the device to where the payload should be written. The value format is similar to the one used in [pullFile](#mobile-pullfile) extension. If the file with the same name already exists then it will be silently overridden. | /sdcard/foo.bar\npayload | string | yes | Base64-encoded content of the file to be pushed. | QXBwaXVt\n\n### mobile: pullFolder\n\nPulls a remote folder from the device.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nremotePath | string | yes | Same as for [pullFile](#mobile-pullfile) extension, but should be pointing to a remote folder | /sdcard/yolo/\n\n#### Returned Result\n\nBase64-encoded string, which represents the zipped content of the remote folder.\n\n### mobile: deleteFile\n\nDeletes a file on the remote device.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nremotePath | string | yes | The full path to the remote file or a file inside an application bundle | `/sdcard/myfile.txt` or `@my.app.id/path/in/bundle`\n\n### mobile: isAppInstalled\n\nVerify whether an application is installed on the device under test.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nappId | string | yes | The identifier of the application package to be checked | `my.app.id`\nuser | number or string | no | The user ID for which the package is installed. The `current` user is used by default | 1006\n\n#### Returned Result\n\nTrue or false\n\n### mobile: listApps\n\nLists all installed packages on the Android device, optionally filtered by user.\nAn exception will be thrown on devices running Android API below level 26.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nuser | number or string | no | The user ID for which the package is installed. The `current` user is used by default | 1006\n\n#### Returned Result\n\nA map where keys are packageName and values are maps of platform-specific app properties since UIAutomator2 driver v7.0.0.\nUIAutomator2 driver v6.9.0 and v6.9.1 were a list of installed package names.\n\n### mobile: queryAppState\n\nQueries the current state of the app.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nappId | string | yes | The identifier of the application package to be checked | `my.app.id`\n\n#### Returned Result\n\nThe following numbers could returned:\n- The app is not installed: `0`\n- The app is installed and is not running: `1`\n- The app is running in background: `3`\n- The app is running in foreground: `4`\n\n### mobile: activateApp\n\nActivates the given application or launches it if necessary.\nThe action literally simulates\nclicking the corresponding application icon on the dashboard.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nappId | string | yes | The identifier of the application package to be activated | `my.app.id`\n\n### mobile: removeApp\n\nRemove the corresponding application if is installed.\nThe call is ignored if the app is not installed.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nappId | string | yes | The identifier of the application package to be removed | `my.app.id`\ntimeout | number | no | The count of milliseconds to wait until the app is terminated. 20000ms by default. | 1500, 0\nkeepData | boolean | no | Set to true in order to keep the application data and cache folders after uninstall. | true\n\n#### Returned Result\n\nTrue is the app has been found on the device and successfully removed. Otherwise false.\n\n### mobile: terminateApp\n\nTerminates the app and waits until the app is terminated up to the given timeout\nby checking the app state to ensure if the app process is actually stopped.\n\nThe app state check can be skipped if the given timeout is lower or equal to zero since UIAutomator driver 2.9.0.\nThe skip helps when you want to terminate the app process but do not want to check the process existence\nbecause the app under test may, for example, restart it automatically.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nappId | string | yes | The identifier of the application package to be terminated | `my.app.id`\ntimeout | number | no | The count of milliseconds to wait until the app is terminated. 500ms by default. | 1500, 0\n\n#### Returned Result\n\nTrue if the app has been successfully terminated.\n\n### mobile: installApp\n\nInstalls the given application package to the device under test.\nIt might raise the `INSTALL_FAILED_VERSION_DOWNGRADE` error if the installation was a version downgrade.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nappPath | string | yes | The local .apk(s) path on the server filesystem or a remote url. | `/app/path.apk`\ntimeout | number | no | The count of milliseconds to wait until the app is installed.. 6000ms by default. | 120000\nallowTestPackages | boolean | no | Set to true in order to allow test packages installation. false by default | true\nuseSdcard | boolean | no | Set to true to install the app on sdcard instead of the device memory. false by default | true\ngrantPermissions | boolean | no | Set to true in order to grant all the permissions requested in the application's manifest automatically after the installation is completed under Android 6+. The targetSdkVersion in the application manifest must be greater or equal to 23 and the Android version on the device under test must be greater or equal to Android 6 (API level 23) to grant permissions. Applications whose targetSdkVersion is lower than or equal to 22 must be reisntalled to grant permissions for Android 6+ devices. false by default | true\nreplace | boolean | no | Set it to false if you don't want the application to be upgraded/reinstalled if it is already present on the device, but throw an error instead. true by default | false\ncheckVersion | boolean | no | Set to true, in order to skip the application installation if the device under test has a greater or equal to the application version. It may help to avoid `INSTALL_FAILED_VERSION_DOWNGRADE` error and unnecessary installation. | true\n\n### mobile: clearApp\n\nDeletes all data associated with a package. Calls `adb shell pm clear` under the hood.\nThe app should be accessible, should not be running,\nand should exist on the device under test for this extension to work properly.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nappId | string | yes | The identifier of the application package to be cleared | `my.app.id`\n\n#### Returned Result\n\nStdout of the corresponding adb command.\n\n### mobile: startActivity\n\nStarts the given activity intent. Invokes `am start`/`am start-activity` command under the hood.\nThis method extends the functionality of the [Start Activity](#applications-management) app management API.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nintent | string | yes | The full name of the activity intent to start | `com.some.package.name/.YourActivityClassName`\nuser | number or string | no | The user ID for which the service is started. The `current` user is used by default | 1006\nwait | boolean | no | Set it to `true` if you want to block the method call until the Activity Manager's process returns the control to the system. | false\nstop | boolean | no | Set it to `true` to force stop the target app before starting the activity. | false\nwindowingMode | integer | no | The windowing mode to launch the activity into. Check [WindowConfiguration.java](https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/app/WindowConfiguration.java) for more details on possible windowing modes (constants starting with `WINDOWING_MODE_`). | 1\nactivityType | integer | no | The activity type to launch the activity as. Check [WindowConfiguration.java](https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/app/WindowConfiguration.java) for more details on possible activity types (constants starting with `ACTIVITY_TYPE_`). | 1\naction | string | no | Action name. The actual value for the Activity Manager's `-a` argument. | android.intent.action.MAIN\nuri | string | no | Unified resource identifier. The actual value for the Activity Manager's `-d` argument. | https://appium.io\nmimeType | string | no | Mime type. The actual value for the Activity Manager's `-t` argument. | application/json\nidentifier | string | no | Optional identifier. The actual value for the Activity Manager's `-i` argument. | my_identifier\ncategories | string or Array\u0026lt;string\u0026gt; | no | One or more category names. The actual value(s) for the Activity Manager's `-c` argument. | android.intent.category.LAUNCHER\ncomponent | string | no | Component name. The actual value for the Activity Manager's `-n` argument. | com.myapp/com.myapp.SplashActivity\npackage | string | no | Package name. The actual value for the Activity Manager's `-p` argument. | com.myapp\nextras | Array\u0026lt;Array\u0026lt;string\u0026gt;\u0026gt; | no | Optional intent arguments. Must be represented as an array of arrays, where each subarray item contains two (only in case it no value is required for the given type) or three string items: value type, key (variable name) and the value itself. Supported value types are: `s`: string. Value must be a valid string; `sn`: null. Value is ignored for this type; `z`: boolean. Value must be either `true` or `false`; `i`: integer. Value must be a valid 4-byte integer number; `l`: long. Value must be a valid 8-byte long number; `f`: float: Value must be a valid float number; `u`: uri. Value must be a valid uniform resource identifier string; `cn`: component name. Value must be a valid component name string; `ia`: Integer[]. Value must be a string of comma-separated integers; `ial`: List\u0026lt;Integer\u0026gt;. Value must be a string of comma-separated integers; `la`: Long[]. Value must be a string of comma-separated long numbers; `lal`: List\u0026lt;Long\u0026gt;. Value must be a string of comma-separated long numbers; `fa`: Float[]. Value must be a string of comma-separated float numbers; `fal`: List\u0026lt;Float\u0026gt;. Value must be a string of comma-separated float numbers; `sa`: String[]. Value must be comma-separated strings. To embed a comma into a string escape it using \"\\,\"; `sal`: List\u0026lt;String\u0026gt;. Value must be comma-separated strings. To embed a comma into a string, escape it using \"\\,\" | [['s', 'varName1', 'My String1'], ['s', 'varName2', 'My String2'], ['ia', 'arrName', '1,2,3,4']]\nflags | string | no | Intent startup-specific flags as a hexadecimal string. Check [Intent documentation](https://developer.android.com/reference/android/content/Intent.html) for the list of available flag values (constants starting with `FLAG_ACTIVITY_`). Flag values could be merged using the logical 'or' operation. | 0x10200000 is the combination of two flags: 0x10000000 `FLAG_ACTIVITY_NEW_TASK` `|` 0x00200000 `FLAG_ACTIVITY_RESET_TASK_IF_NEEDED`\n\n#### Returned Result\n\nThe actual stdout of the downstream `am` command.\n\n#### Example\n\nUse the code snippet below to represent the following shell command: `shell am start-activity -W -n io.appium.android.apis/io.appium.android.apis.ApiDemos -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000'`, which is usually similar to what is called in a new session request.\nIf you replace `'io.appium.android.apis/io.appium.android.apis.ApiDemos'` with your expected launchable activity, it would be the alternative method to start the activity in session.\n\nPlease check [how appium adds flags](https://github.com/appium/appium-android-driver/blob/master/lib/commands/intent.js) for more details to understand how Appium builds flags.\n\n```ruby\n# Ruby\ndriver.execute_script 'mobile: startActivity', {\n    wait: true,\n    stop: true,\n    action: 'android.intent.action.MAIN',\n    component: 'io.appium.android.apis/io.appium.android.apis.ApiDemos',\n    categories: ['android.intent.category.LAUNCHER'],\n    flags: '0x10200000'\n}\n```\n\n### mobile: startService\n\nStarts the given service intent. Invokes `am startservice` or `am start-service` command under the hood.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nintent | string | no | The full name of the service intent to start | `com.some.package.name/.YourServiceSubClassName`\nuser | number or string | no | The user ID for which the service is started. The `current` user id is used by default | 1006\nforeground | boolean | no | Set it to `true` if your service must be started as a foreground service. The argument only works for Android 8 and above. | false\naction | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | android.intent.action.MAIN\nuri | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | https://appium.io\nmimeType | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | application/json\nidentifier | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | my_identifier\ncategories | string or Array\u0026lt;string\u0026gt; | no | See the documentation for [startActivity extension](#mobile-startactivity) | com.myapp/com.myapp.SplashActivity\ncomponent | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | android.intent.category.LAUNCHER\npackage | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | com.myapp\nextras | Array\u0026lt;Array\u0026lt;string\u0026gt;\u0026gt; | no | See the documentation for [startActivity extension](#mobile-startactivity) | [['s', 'varName1', 'My String1'], ['s', 'varName2', 'My String2'], ['ia', 'arrName', '1,2,3,4']]\nflags | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | 0x10200000 is the combination of two flags: 0x10000000 `FLAG_ACTIVITY_NEW_TASK` `|` 0x00200000 `FLAG_ACTIVITY_RESET_TASK_IF_NEEDED`\n\n#### Returned Result\n\nThe actual stdout of the downstream `am` command.\n\n### mobile: stopService\n\nStops the given service intent. Invokes `am stopservice` or `am stop-service` command under the hood.\n\n#### Arguments\n\nName | Type | Required | Description | Example\n--- | --- | --- | --- | ---\nintent | string | no | The full name of the service intent to stop | `com.some.package.name/.YourServiceS","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappium%2Fappium-uiautomator2-driver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappium%2Fappium-uiautomator2-driver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappium%2Fappium-uiautomator2-driver/lists"}