@appium/mcp-documentation 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (417) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/package.json +4 -7
  3. package/src/resources/submodules/appium/.github/PULL_REQUEST_TEMPLATE.md +28 -0
  4. package/src/resources/submodules/appium/.github/copilot-instructions.md +9 -0
  5. package/src/resources/submodules/appium/CHANGELOG.md +45 -0
  6. package/src/resources/submodules/appium/GOVERNANCE.md +189 -0
  7. package/src/resources/submodules/appium/README.md +221 -0
  8. package/src/resources/submodules/appium/ROADMAP.md +30 -0
  9. package/src/resources/submodules/appium/SPONSORS.md +3 -0
  10. package/src/resources/submodules/appium/docs/README.md +6 -0
  11. package/src/resources/submodules/appium/docs/payout.md +35 -0
  12. package/src/resources/submodules/appium/packages/appium/CHANGELOG.md +1547 -0
  13. package/src/resources/submodules/appium/packages/appium/README.md +221 -0
  14. package/src/resources/submodules/appium/packages/appium/docs/en/blog/index.md +2 -0
  15. package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/announcing-appiumconf2024.md +45 -0
  16. package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/announcing-browserstack-as-strategic-partner.md +46 -0
  17. package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/announcing-headspin-as-development-partner.md +47 -0
  18. package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/announcing-lambdatest-as-development-partner.md +36 -0
  19. package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/announcing-lambdatest-as-strategic-partner.md +42 -0
  20. package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/announcing-sauce-labs-as-strategic-partner.md +36 -0
  21. package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/announcing-sponsorship-program.md +48 -0
  22. package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/appium3.md +40 -0
  23. package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/hello-world.md +15 -0
  24. package/src/resources/submodules/appium/packages/appium/docs/en/contributing/index.md +150 -0
  25. package/src/resources/submodules/appium/packages/appium/docs/en/developing/build-docs.md +86 -0
  26. package/src/resources/submodules/appium/packages/appium/docs/en/developing/build-doctor-checks.md +141 -0
  27. package/src/resources/submodules/appium/packages/appium/docs/en/developing/build-drivers.md +1002 -0
  28. package/src/resources/submodules/appium/packages/appium/docs/en/developing/build-plugins.md +523 -0
  29. package/src/resources/submodules/appium/packages/appium/docs/en/developing/config-system.md +451 -0
  30. package/src/resources/submodules/appium/packages/appium/docs/en/developing/index.md +18 -0
  31. package/src/resources/submodules/appium/packages/appium/docs/en/developing/sensitive.md +49 -0
  32. package/src/resources/submodules/appium/packages/appium/docs/en/ecosystem/clients.md +132 -0
  33. package/src/resources/submodules/appium/packages/appium/docs/en/ecosystem/drivers.md +207 -0
  34. package/src/resources/submodules/appium/packages/appium/docs/en/ecosystem/index.md +45 -0
  35. package/src/resources/submodules/appium/packages/appium/docs/en/ecosystem/plugins.md +138 -0
  36. package/src/resources/submodules/appium/packages/appium/docs/en/ecosystem/tools.md +106 -0
  37. package/src/resources/submodules/appium/packages/appium/docs/en/guides/branch-testing.md +57 -0
  38. package/src/resources/submodules/appium/packages/appium/docs/en/guides/caching.md +76 -0
  39. package/src/resources/submodules/appium/packages/appium/docs/en/guides/caps.md +271 -0
  40. package/src/resources/submodules/appium/packages/appium/docs/en/guides/config.md +98 -0
  41. package/src/resources/submodules/appium/packages/appium/docs/en/guides/context.md +44 -0
  42. package/src/resources/submodules/appium/packages/appium/docs/en/guides/event-timing.md +73 -0
  43. package/src/resources/submodules/appium/packages/appium/docs/en/guides/execute-methods.md +122 -0
  44. package/src/resources/submodules/appium/packages/appium/docs/en/guides/grid.md +178 -0
  45. package/src/resources/submodules/appium/packages/appium/docs/en/guides/headers.md +17 -0
  46. package/src/resources/submodules/appium/packages/appium/docs/en/guides/log-filters.md +86 -0
  47. package/src/resources/submodules/appium/packages/appium/docs/en/guides/managing-exts.md +87 -0
  48. package/src/resources/submodules/appium/packages/appium/docs/en/guides/migrating-1-to-2.md +368 -0
  49. package/src/resources/submodules/appium/packages/appium/docs/en/guides/migrating-2-to-3.md +464 -0
  50. package/src/resources/submodules/appium/packages/appium/docs/en/guides/security.md +87 -0
  51. package/src/resources/submodules/appium/packages/appium/docs/en/guides/settings.md +68 -0
  52. package/src/resources/submodules/appium/packages/appium/docs/en/guides/tls.md +42 -0
  53. package/src/resources/submodules/appium/packages/appium/docs/en/index.md +59 -0
  54. package/src/resources/submodules/appium/packages/appium/docs/en/intro/appium.md +202 -0
  55. package/src/resources/submodules/appium/packages/appium/docs/en/intro/clients.md +127 -0
  56. package/src/resources/submodules/appium/packages/appium/docs/en/intro/drivers.md +188 -0
  57. package/src/resources/submodules/appium/packages/appium/docs/en/intro/history.md +196 -0
  58. package/src/resources/submodules/appium/packages/appium/docs/en/intro/index.md +39 -0
  59. package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/index.md +29 -0
  60. package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/install.md +50 -0
  61. package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/next-steps.md +23 -0
  62. package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/requirements.md +29 -0
  63. package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/test-dotnet.md +105 -0
  64. package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/test-java.md +23 -0
  65. package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/test-js.md +75 -0
  66. package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/test-py.md +60 -0
  67. package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/test-rb.md +83 -0
  68. package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/uiauto2-driver.md +144 -0
  69. package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/appium.md +394 -0
  70. package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/bidi.md +70 -0
  71. package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/index.md +30 -0
  72. package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/jsonwp.md +214 -0
  73. package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/mjsonwp.md +151 -0
  74. package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/others.md +736 -0
  75. package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/plugins.md +289 -0
  76. package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/webdriver.md +1114 -0
  77. package/src/resources/submodules/appium/packages/appium/docs/en/reference/cli/env-vars.md +31 -0
  78. package/src/resources/submodules/appium/packages/appium/docs/en/reference/cli/extensions.md +246 -0
  79. package/src/resources/submodules/appium/packages/appium/docs/en/reference/cli/index.md +36 -0
  80. package/src/resources/submodules/appium/packages/appium/docs/en/reference/cli/insecure-features.md +24 -0
  81. package/src/resources/submodules/appium/packages/appium/docs/en/reference/cli/server.md +78 -0
  82. package/src/resources/submodules/appium/packages/appium/docs/en/reference/cli/setup.md +76 -0
  83. package/src/resources/submodules/appium/packages/appium/docs/en/reference/index.md +31 -0
  84. package/src/resources/submodules/appium/packages/appium/docs/en/reference/session/caps.md +56 -0
  85. package/src/resources/submodules/appium/packages/appium/docs/en/reference/session/index.md +23 -0
  86. package/src/resources/submodules/appium/packages/appium/docs/en/resources/index.md +28 -0
  87. package/src/resources/submodules/appium/packages/appium/docs/en/sponsors/index.md +69 -0
  88. package/src/resources/submodules/appium/packages/appium/docs/ja/blog/index.md +2 -0
  89. package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/announcing-appiumconf2024.md +45 -0
  90. package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/announcing-browserstack-as-strategic-partner.md +46 -0
  91. package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/announcing-headspin-as-development-partner.md +47 -0
  92. package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/announcing-lambdatest-as-development-partner.md +34 -0
  93. package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/announcing-lambdatest-as-strategic-partner.md +41 -0
  94. package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/announcing-sauce-labs-as-strategic-partner.md +36 -0
  95. package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/announcing-sponsorship-program.md +48 -0
  96. package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/appium3.md +40 -0
  97. package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/hello-world.md +15 -0
  98. package/src/resources/submodules/appium/packages/appium/docs/ja/contributing/index.md +158 -0
  99. package/src/resources/submodules/appium/packages/appium/docs/ja/developing/build-docs.md +86 -0
  100. package/src/resources/submodules/appium/packages/appium/docs/ja/developing/build-doctor-checks.md +141 -0
  101. package/src/resources/submodules/appium/packages/appium/docs/ja/developing/build-drivers.md +1010 -0
  102. package/src/resources/submodules/appium/packages/appium/docs/ja/developing/build-plugins.md +529 -0
  103. package/src/resources/submodules/appium/packages/appium/docs/ja/developing/config-system.md +468 -0
  104. package/src/resources/submodules/appium/packages/appium/docs/ja/developing/index.md +18 -0
  105. package/src/resources/submodules/appium/packages/appium/docs/ja/developing/sensitive.md +49 -0
  106. package/src/resources/submodules/appium/packages/appium/docs/ja/ecosystem/clients.md +143 -0
  107. package/src/resources/submodules/appium/packages/appium/docs/ja/ecosystem/drivers.md +219 -0
  108. package/src/resources/submodules/appium/packages/appium/docs/ja/ecosystem/index.md +45 -0
  109. package/src/resources/submodules/appium/packages/appium/docs/ja/ecosystem/plugins.md +140 -0
  110. package/src/resources/submodules/appium/packages/appium/docs/ja/ecosystem/tools.md +115 -0
  111. package/src/resources/submodules/appium/packages/appium/docs/ja/guides/branch-testing.md +57 -0
  112. package/src/resources/submodules/appium/packages/appium/docs/ja/guides/caching.md +78 -0
  113. package/src/resources/submodules/appium/packages/appium/docs/ja/guides/caps.md +276 -0
  114. package/src/resources/submodules/appium/packages/appium/docs/ja/guides/config.md +102 -0
  115. package/src/resources/submodules/appium/packages/appium/docs/ja/guides/context.md +44 -0
  116. package/src/resources/submodules/appium/packages/appium/docs/ja/guides/event-timing.md +75 -0
  117. package/src/resources/submodules/appium/packages/appium/docs/ja/guides/execute-methods.md +142 -0
  118. package/src/resources/submodules/appium/packages/appium/docs/ja/guides/grid.md +178 -0
  119. package/src/resources/submodules/appium/packages/appium/docs/ja/guides/headers.md +17 -0
  120. package/src/resources/submodules/appium/packages/appium/docs/ja/guides/log-filters.md +86 -0
  121. package/src/resources/submodules/appium/packages/appium/docs/ja/guides/managing-exts.md +89 -0
  122. package/src/resources/submodules/appium/packages/appium/docs/ja/guides/migrating-1-to-2.md +402 -0
  123. package/src/resources/submodules/appium/packages/appium/docs/ja/guides/migrating-2-to-3.md +458 -0
  124. package/src/resources/submodules/appium/packages/appium/docs/ja/guides/security.md +89 -0
  125. package/src/resources/submodules/appium/packages/appium/docs/ja/guides/settings.md +70 -0
  126. package/src/resources/submodules/appium/packages/appium/docs/ja/guides/tls.md +43 -0
  127. package/src/resources/submodules/appium/packages/appium/docs/ja/index.md +55 -0
  128. package/src/resources/submodules/appium/packages/appium/docs/ja/intro/appium.md +191 -0
  129. package/src/resources/submodules/appium/packages/appium/docs/ja/intro/clients.md +139 -0
  130. package/src/resources/submodules/appium/packages/appium/docs/ja/intro/drivers.md +188 -0
  131. package/src/resources/submodules/appium/packages/appium/docs/ja/intro/history.md +196 -0
  132. package/src/resources/submodules/appium/packages/appium/docs/ja/intro/index.md +39 -0
  133. package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/index.md +23 -0
  134. package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/install.md +47 -0
  135. package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/next-steps.md +19 -0
  136. package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/requirements.md +29 -0
  137. package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/test-dotnet.md +107 -0
  138. package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/test-java.md +23 -0
  139. package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/test-js.md +77 -0
  140. package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/test-py.md +63 -0
  141. package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/test-rb.md +85 -0
  142. package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/uiauto2-driver.md +148 -0
  143. package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/appium.md +395 -0
  144. package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/bidi.md +71 -0
  145. package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/index.md +30 -0
  146. package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/jsonwp.md +215 -0
  147. package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/mjsonwp.md +152 -0
  148. package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/others.md +737 -0
  149. package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/plugins.md +291 -0
  150. package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/webdriver.md +1114 -0
  151. package/src/resources/submodules/appium/packages/appium/docs/ja/reference/cli/env-vars.md +31 -0
  152. package/src/resources/submodules/appium/packages/appium/docs/ja/reference/cli/extensions.md +247 -0
  153. package/src/resources/submodules/appium/packages/appium/docs/ja/reference/cli/index.md +36 -0
  154. package/src/resources/submodules/appium/packages/appium/docs/ja/reference/cli/insecure-features.md +23 -0
  155. package/src/resources/submodules/appium/packages/appium/docs/ja/reference/cli/server.md +78 -0
  156. package/src/resources/submodules/appium/packages/appium/docs/ja/reference/cli/setup.md +78 -0
  157. package/src/resources/submodules/appium/packages/appium/docs/ja/reference/index.md +31 -0
  158. package/src/resources/submodules/appium/packages/appium/docs/ja/reference/session/caps.md +56 -0
  159. package/src/resources/submodules/appium/packages/appium/docs/ja/reference/session/index.md +23 -0
  160. package/src/resources/submodules/appium/packages/appium/docs/ja/resources/index.md +28 -0
  161. package/src/resources/submodules/appium/packages/appium/docs/ja/sponsors/index.md +66 -0
  162. package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/appium-logo-horiz-white.png +0 -0
  163. package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/appium-logo-horiz.png +0 -0
  164. package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/appium-logo-white.png +0 -0
  165. package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/appium-logo.png +0 -0
  166. package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/sponsor-logo-browserstack-dark.png +0 -0
  167. package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/sponsor-logo-browserstack-light.png +0 -0
  168. package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/sponsor-logo-lambdatest-dark.png +0 -0
  169. package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/sponsor-logo-lambdatest-light.png +0 -0
  170. package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/sponsor-logo-sauce.png +0 -0
  171. package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/sponsor-logo-testmuai-dark.png +0 -0
  172. package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/sponsor-logo-testmuai-light.png +0 -0
  173. package/src/resources/submodules/appium/packages/appium/docs/zh/blog/index.md +2 -0
  174. package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/announcing-appiumconf2024.md +45 -0
  175. package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/announcing-browserstack-as-strategic-partner.md +46 -0
  176. package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/announcing-headspin-as-development-partner.md +47 -0
  177. package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/announcing-lambdatest-as-development-partner.md +34 -0
  178. package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/announcing-lambdatest-as-strategic-partner.md +41 -0
  179. package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/announcing-sauce-labs-as-strategic-partner.md +36 -0
  180. package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/announcing-sponsorship-program.md +48 -0
  181. package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/appium3.md +40 -0
  182. package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/hello-world.md +15 -0
  183. package/src/resources/submodules/appium/packages/appium/docs/zh/contributing/index.md +132 -0
  184. package/src/resources/submodules/appium/packages/appium/docs/zh/developing/build-docs.md +86 -0
  185. package/src/resources/submodules/appium/packages/appium/docs/zh/developing/build-doctor-checks.md +141 -0
  186. package/src/resources/submodules/appium/packages/appium/docs/zh/developing/build-drivers.md +1010 -0
  187. package/src/resources/submodules/appium/packages/appium/docs/zh/developing/build-plugins.md +529 -0
  188. package/src/resources/submodules/appium/packages/appium/docs/zh/developing/config-system.md +468 -0
  189. package/src/resources/submodules/appium/packages/appium/docs/zh/developing/index.md +18 -0
  190. package/src/resources/submodules/appium/packages/appium/docs/zh/developing/sensitive.md +49 -0
  191. package/src/resources/submodules/appium/packages/appium/docs/zh/ecosystem/clients.md +143 -0
  192. package/src/resources/submodules/appium/packages/appium/docs/zh/ecosystem/drivers.md +219 -0
  193. package/src/resources/submodules/appium/packages/appium/docs/zh/ecosystem/index.md +45 -0
  194. package/src/resources/submodules/appium/packages/appium/docs/zh/ecosystem/plugins.md +140 -0
  195. package/src/resources/submodules/appium/packages/appium/docs/zh/ecosystem/tools.md +115 -0
  196. package/src/resources/submodules/appium/packages/appium/docs/zh/guides/branch-testing.md +57 -0
  197. package/src/resources/submodules/appium/packages/appium/docs/zh/guides/caching.md +78 -0
  198. package/src/resources/submodules/appium/packages/appium/docs/zh/guides/caps.md +279 -0
  199. package/src/resources/submodules/appium/packages/appium/docs/zh/guides/config.md +102 -0
  200. package/src/resources/submodules/appium/packages/appium/docs/zh/guides/context.md +44 -0
  201. package/src/resources/submodules/appium/packages/appium/docs/zh/guides/event-timing.md +75 -0
  202. package/src/resources/submodules/appium/packages/appium/docs/zh/guides/execute-methods.md +142 -0
  203. package/src/resources/submodules/appium/packages/appium/docs/zh/guides/grid.md +178 -0
  204. package/src/resources/submodules/appium/packages/appium/docs/zh/guides/headers.md +17 -0
  205. package/src/resources/submodules/appium/packages/appium/docs/zh/guides/log-filters.md +86 -0
  206. package/src/resources/submodules/appium/packages/appium/docs/zh/guides/managing-exts.md +89 -0
  207. package/src/resources/submodules/appium/packages/appium/docs/zh/guides/migrating-1-to-2.md +410 -0
  208. package/src/resources/submodules/appium/packages/appium/docs/zh/guides/migrating-2-to-3.md +459 -0
  209. package/src/resources/submodules/appium/packages/appium/docs/zh/guides/security.md +89 -0
  210. package/src/resources/submodules/appium/packages/appium/docs/zh/guides/settings.md +70 -0
  211. package/src/resources/submodules/appium/packages/appium/docs/zh/guides/tls.md +43 -0
  212. package/src/resources/submodules/appium/packages/appium/docs/zh/index.md +54 -0
  213. package/src/resources/submodules/appium/packages/appium/docs/zh/intro/appium.md +91 -0
  214. package/src/resources/submodules/appium/packages/appium/docs/zh/intro/clients.md +100 -0
  215. package/src/resources/submodules/appium/packages/appium/docs/zh/intro/drivers.md +101 -0
  216. package/src/resources/submodules/appium/packages/appium/docs/zh/intro/history.md +72 -0
  217. package/src/resources/submodules/appium/packages/appium/docs/zh/intro/index.md +36 -0
  218. package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/index.md +23 -0
  219. package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/install.md +47 -0
  220. package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/next-steps.md +19 -0
  221. package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/requirements.md +21 -0
  222. package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/test-dotnet.md +99 -0
  223. package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/test-java.md +20 -0
  224. package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/test-js.md +62 -0
  225. package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/test-py.md +57 -0
  226. package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/test-rb.md +80 -0
  227. package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/uiauto2-driver.md +119 -0
  228. package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/appium.md +395 -0
  229. package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/bidi.md +71 -0
  230. package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/index.md +30 -0
  231. package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/jsonwp.md +215 -0
  232. package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/mjsonwp.md +152 -0
  233. package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/others.md +737 -0
  234. package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/plugins.md +291 -0
  235. package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/webdriver.md +1114 -0
  236. package/src/resources/submodules/appium/packages/appium/docs/zh/reference/cli/env-vars.md +31 -0
  237. package/src/resources/submodules/appium/packages/appium/docs/zh/reference/cli/extensions.md +247 -0
  238. package/src/resources/submodules/appium/packages/appium/docs/zh/reference/cli/index.md +36 -0
  239. package/src/resources/submodules/appium/packages/appium/docs/zh/reference/cli/insecure-features.md +23 -0
  240. package/src/resources/submodules/appium/packages/appium/docs/zh/reference/cli/server.md +78 -0
  241. package/src/resources/submodules/appium/packages/appium/docs/zh/reference/cli/setup.md +78 -0
  242. package/src/resources/submodules/appium/packages/appium/docs/zh/reference/index.md +31 -0
  243. package/src/resources/submodules/appium/packages/appium/docs/zh/reference/session/caps.md +56 -0
  244. package/src/resources/submodules/appium/packages/appium/docs/zh/reference/session/index.md +23 -0
  245. package/src/resources/submodules/appium/packages/appium/docs/zh/resources/index.md +28 -0
  246. package/src/resources/submodules/appium/packages/appium/docs/zh/sponsors/index.md +66 -0
  247. package/src/resources/submodules/appium/packages/appium/types/manifest/README.md +30 -0
  248. package/src/resources/submodules/appium/packages/base-driver/CHANGELOG.md +1244 -0
  249. package/src/resources/submodules/appium/packages/base-driver/README.md +15 -0
  250. package/src/resources/submodules/appium/packages/base-driver/docs/mjsonwp/errors.md +82 -0
  251. package/src/resources/submodules/appium/packages/base-driver/docs/mjsonwp/protocol-methods.md +182 -0
  252. package/src/resources/submodules/appium/packages/base-driver/static/appium.png +0 -0
  253. package/src/resources/submodules/appium/packages/base-plugin/CHANGELOG.md +764 -0
  254. package/src/resources/submodules/appium/packages/base-plugin/README.md +15 -0
  255. package/src/resources/submodules/appium/packages/docutils/CHANGELOG.md +1038 -0
  256. package/src/resources/submodules/appium/packages/docutils/README.md +27 -0
  257. package/src/resources/submodules/appium/packages/driver-test-support/CHANGELOG.md +790 -0
  258. package/src/resources/submodules/appium/packages/driver-test-support/README.md +103 -0
  259. package/src/resources/submodules/appium/packages/eslint-config-appium-ts/CHANGELOG.md +256 -0
  260. package/src/resources/submodules/appium/packages/eslint-config-appium-ts/README.md +47 -0
  261. package/src/resources/submodules/appium/packages/execute-driver-plugin/CHANGELOG.md +671 -0
  262. package/src/resources/submodules/appium/packages/execute-driver-plugin/README.md +55 -0
  263. package/src/resources/submodules/appium/packages/fake-driver/CHANGELOG.md +603 -0
  264. package/src/resources/submodules/appium/packages/fake-driver/README.md +7 -0
  265. package/src/resources/submodules/appium/packages/fake-driver/lib/screen.png +0 -0
  266. package/src/resources/submodules/appium/packages/fake-plugin/CHANGELOG.md +780 -0
  267. package/src/resources/submodules/appium/packages/fake-plugin/README.md +7 -0
  268. package/src/resources/submodules/appium/packages/images-plugin/CHANGELOG.md +691 -0
  269. package/src/resources/submodules/appium/packages/images-plugin/README.md +27 -0
  270. package/src/resources/submodules/appium/packages/images-plugin/docs/find-by-image.md +65 -0
  271. package/src/resources/submodules/appium/packages/images-plugin/docs/image-comparison.md +203 -0
  272. package/src/resources/submodules/appium/packages/images-plugin/test/fixtures/appstore.png +0 -0
  273. package/src/resources/submodules/appium/packages/images-plugin/test/fixtures/img1.png +0 -0
  274. package/src/resources/submodules/appium/packages/images-plugin/test/fixtures/img2.png +0 -0
  275. package/src/resources/submodules/appium/packages/images-plugin/test/fixtures/img2_part.png +0 -0
  276. package/src/resources/submodules/appium/packages/logger/CHANGELOG.md +212 -0
  277. package/src/resources/submodules/appium/packages/logger/README.md +31 -0
  278. package/src/resources/submodules/appium/packages/opencv/CHANGELOG.md +446 -0
  279. package/src/resources/submodules/appium/packages/opencv/README.md +68 -0
  280. package/src/resources/submodules/appium/packages/opencv/test/e2e/images/appium-diagram.jpg +0 -0
  281. package/src/resources/submodules/appium/packages/opencv/test/e2e/images/cc1.png +0 -0
  282. package/src/resources/submodules/appium/packages/opencv/test/e2e/images/cc2.png +0 -0
  283. package/src/resources/submodules/appium/packages/opencv/test/e2e/images/cc_rotated.png +0 -0
  284. package/src/resources/submodules/appium/packages/opencv/test/e2e/images/findwaldo.jpg +0 -0
  285. package/src/resources/submodules/appium/packages/opencv/test/e2e/images/number5.png +0 -0
  286. package/src/resources/submodules/appium/packages/opencv/test/e2e/images/waldo.jpg +0 -0
  287. package/src/resources/submodules/appium/packages/plugin-test-support/CHANGELOG.md +610 -0
  288. package/src/resources/submodules/appium/packages/plugin-test-support/README.md +49 -0
  289. package/src/resources/submodules/appium/packages/relaxed-caps-plugin/CHANGELOG.md +209 -0
  290. package/src/resources/submodules/appium/packages/relaxed-caps-plugin/README.md +35 -0
  291. package/src/resources/submodules/appium/packages/schema/CHANGELOG.md +308 -0
  292. package/src/resources/submodules/appium/packages/schema/README.md +50 -0
  293. package/src/resources/submodules/appium/packages/storage-plugin/CHANGELOG.md +157 -0
  294. package/src/resources/submodules/appium/packages/storage-plugin/README.md +83 -0
  295. package/src/resources/submodules/appium/packages/strongbox/CHANGELOG.md +129 -0
  296. package/src/resources/submodules/appium/packages/strongbox/README.md +110 -0
  297. package/src/resources/submodules/appium/packages/support/CHANGELOG.md +1147 -0
  298. package/src/resources/submodules/appium/packages/support/README.md +161 -0
  299. package/src/resources/submodules/appium/packages/tsconfig/CHANGELOG.md +147 -0
  300. package/src/resources/submodules/appium/packages/tsconfig/README.md +19 -0
  301. package/src/resources/submodules/appium/packages/types/CHANGELOG.md +871 -0
  302. package/src/resources/submodules/appium/packages/types/README.md +21 -0
  303. package/src/resources/submodules/appium/packages/universal-xml-plugin/CHANGELOG.md +502 -0
  304. package/src/resources/submodules/appium/packages/universal-xml-plugin/README.md +53 -0
  305. package/src/resources/submodules/appium/renovate/README.md +55 -0
  306. package/src/resources/submodules/appium-skills/.github/dependabot.yml +11 -0
  307. package/src/resources/submodules/appium-skills/.github/workflows/pr-title.yml +10 -0
  308. package/src/resources/submodules/appium-skills/AGENTS.md +214 -0
  309. package/src/resources/submodules/appium-skills/LICENSE +201 -0
  310. package/src/resources/submodules/appium-skills/README.md +33 -0
  311. package/src/resources/submodules/appium-skills/skills/appium-troubleshooting/SKILL.md +66 -0
  312. package/src/resources/submodules/appium-skills/skills/appium-troubleshooting/references/community-search.md +51 -0
  313. package/src/resources/submodules/appium-skills/skills/appium-troubleshooting/references/uiautomator2-locators.md +34 -0
  314. package/src/resources/submodules/appium-skills/skills/appium-troubleshooting/references/uiautomator2-session-startup.md +53 -0
  315. package/src/resources/submodules/appium-skills/skills/appium-troubleshooting/references/xcuitest-element-lookup.md +23 -0
  316. package/src/resources/submodules/appium-skills/skills/appium-troubleshooting/references/xcuitest-locators.md +16 -0
  317. package/src/resources/submodules/appium-skills/skills/appium-troubleshooting/references/xcuitest-troubleshooting.md +52 -0
  318. package/src/resources/submodules/appium-skills/skills/environment-setup-android/SKILL.md +346 -0
  319. package/src/resources/submodules/appium-skills/skills/environment-setup-bundletool/SKILL.md +91 -0
  320. package/src/resources/submodules/appium-skills/skills/environment-setup-chromium/SKILL.md +260 -0
  321. package/src/resources/submodules/appium-skills/skills/environment-setup-espresso/SKILL.md +216 -0
  322. package/src/resources/submodules/appium-skills/skills/environment-setup-ffmpeg/SKILL.md +91 -0
  323. package/src/resources/submodules/appium-skills/skills/environment-setup-node/SKILL.md +128 -0
  324. package/src/resources/submodules/appium-skills/skills/environment-setup-uiautomator2/SKILL.md +225 -0
  325. package/src/resources/submodules/appium-skills/skills/environment-setup-xcuitest/SKILL.md +153 -0
  326. package/src/resources/submodules/appium-skills/skills/xcuitest-real-device-config/SKILL.md +488 -0
  327. package/src/resources/submodules/appium-uiautomator2-driver/CHANGELOG.md +1506 -0
  328. package/src/resources/submodules/appium-uiautomator2-driver/README.md +2253 -0
  329. package/src/resources/submodules/appium-uiautomator2-driver/docs/actions.md +72 -0
  330. package/src/resources/submodules/appium-uiautomator2-driver/docs/activity-startup.md +47 -0
  331. package/src/resources/submodules/appium-uiautomator2-driver/docs/android-appbundle.md +69 -0
  332. package/src/resources/submodules/appium-uiautomator2-driver/docs/android-mobile-gestures.md +352 -0
  333. package/src/resources/submodules/appium-uiautomator2-driver/docs/android-multiwindow.md +872 -0
  334. package/src/resources/submodules/appium-uiautomator2-driver/docs/architecture.md +34 -0
  335. package/src/resources/submodules/appium-uiautomator2-driver/docs/bidi.md +50 -0
  336. package/src/resources/submodules/appium-uiautomator2-driver/docs/capability-sets.md +136 -0
  337. package/src/resources/submodules/appium-uiautomator2-driver/docs/mjpeg.md +111 -0
  338. package/src/resources/submodules/appium-uiautomator2-driver/docs/scheduled-actions.md +155 -0
  339. package/src/resources/submodules/appium-uiautomator2-driver/docs/uiautomator-uiselector.md +51 -0
  340. package/src/resources/submodules/appium-uiautomator2-driver/docs/unlock/main.md +95 -0
  341. package/src/resources/submodules/appium-uiautomator2-driver/docs/unlock/screen1.png +0 -0
  342. package/src/resources/submodules/appium-uiautomator2-driver/docs/unlock/screen2.png +0 -0
  343. package/src/resources/submodules/appium-uiautomator2-driver/test/functional/assets/checkered-squares.png +0 -0
  344. package/src/resources/submodules/appium-uiautomator2-driver/test/functional/assets/start-button.png +0 -0
  345. package/src/resources/submodules/appium-uiautomator2-driver/test/functional/assets/stop-button.png +0 -0
  346. package/src/resources/submodules/appium-xcuitest-driver/.github/ISSUE_TEMPLATE.md +4 -0
  347. package/src/resources/submodules/appium-xcuitest-driver/CHANGELOG.md +3373 -0
  348. package/src/resources/submodules/appium-xcuitest-driver/README.md +55 -0
  349. package/src/resources/submodules/appium-xcuitest-driver/docs/assets/images/appium-logo-white.png +0 -0
  350. package/src/resources/submodules/appium-xcuitest-driver/docs/assets/images/appium-logo.png +0 -0
  351. package/src/resources/submodules/appium-xcuitest-driver/docs/assets/images/appium-plus-xctest.png +0 -0
  352. package/src/resources/submodules/appium-xcuitest-driver/docs/contributing.md +45 -0
  353. package/src/resources/submodules/appium-xcuitest-driver/docs/endpoints-wda.md +61 -0
  354. package/src/resources/submodules/appium-xcuitest-driver/docs/endpoints.md +95 -0
  355. package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/device-setup.md +81 -0
  356. package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/index.md +36 -0
  357. package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/installation.md +38 -0
  358. package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/assets/images/check-prov-prof.png +0 -0
  359. package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/assets/images/create-new-project.png +0 -0
  360. package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/assets/images/create-single-page.png +0 -0
  361. package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/assets/images/no-prov-prof.png +0 -0
  362. package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/assets/images/project-prov-prof.png +0 -0
  363. package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/assets/images/set-up-bundle.png +0 -0
  364. package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/assets/images/untrusted-dev.png +0 -0
  365. package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/assets/images/xcode-bundle-id.png +0 -0
  366. package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/assets/images/xcode-config.png +0 -0
  367. package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/assets/images/xcode-facebook-fail.png +0 -0
  368. package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/assets/images/xcode-facebook-succeed.png +0 -0
  369. package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/auto-config.md +54 -0
  370. package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/basic-manual-config.md +40 -0
  371. package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/full-manual-config.md +49 -0
  372. package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/generic-device-config.md +75 -0
  373. package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/index.md +117 -0
  374. package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/system-requirements.md +131 -0
  375. package/src/resources/submodules/appium-xcuitest-driver/docs/guides/assets/images/ios-xctest-file-movement/keynote.png +0 -0
  376. package/src/resources/submodules/appium-xcuitest-driver/docs/guides/assets/images/ios-xctest-file-movement/on_my_iphone.png +0 -0
  377. package/src/resources/submodules/appium-xcuitest-driver/docs/guides/assets/images/ios-xctest-file-movement/top_files.png +0 -0
  378. package/src/resources/submodules/appium-xcuitest-driver/docs/guides/attach-to-running-wda.md +43 -0
  379. package/src/resources/submodules/appium-xcuitest-driver/docs/guides/audio-capture.md +78 -0
  380. package/src/resources/submodules/appium-xcuitest-driver/docs/guides/biometric-auth.md +29 -0
  381. package/src/resources/submodules/appium-xcuitest-driver/docs/guides/capability-sets.md +169 -0
  382. package/src/resources/submodules/appium-xcuitest-driver/docs/guides/ci-setup.md +47 -0
  383. package/src/resources/submodules/appium-xcuitest-driver/docs/guides/clipboard.md +47 -0
  384. package/src/resources/submodules/appium-xcuitest-driver/docs/guides/file-transfer.md +147 -0
  385. package/src/resources/submodules/appium-xcuitest-driver/docs/guides/gestures.md +55 -0
  386. package/src/resources/submodules/appium-xcuitest-driver/docs/guides/hybrid.md +137 -0
  387. package/src/resources/submodules/appium-xcuitest-driver/docs/guides/input-events.md +67 -0
  388. package/src/resources/submodules/appium-xcuitest-driver/docs/guides/install-certificate.md +20 -0
  389. package/src/resources/submodules/appium-xcuitest-driver/docs/guides/mjpeg.md +98 -0
  390. package/src/resources/submodules/appium-xcuitest-driver/docs/guides/multiple-xcode-versions.md +37 -0
  391. package/src/resources/submodules/appium-xcuitest-driver/docs/guides/parallel-tests.md +39 -0
  392. package/src/resources/submodules/appium-xcuitest-driver/docs/guides/remotexpc-tunnels-real-devices.md +148 -0
  393. package/src/resources/submodules/appium-xcuitest-driver/docs/guides/run-prebuilt-wda.md +147 -0
  394. package/src/resources/submodules/appium-xcuitest-driver/docs/guides/run-preinstalled-wda.md +177 -0
  395. package/src/resources/submodules/appium-xcuitest-driver/docs/guides/tvos.md +246 -0
  396. package/src/resources/submodules/appium-xcuitest-driver/docs/guides/wda-custom-server.md +283 -0
  397. package/src/resources/submodules/appium-xcuitest-driver/docs/index.md +36 -0
  398. package/src/resources/submodules/appium-xcuitest-driver/docs/overview.md +137 -0
  399. package/src/resources/submodules/appium-xcuitest-driver/docs/reference/assets/images/useXctestrunFile.png +0 -0
  400. package/src/resources/submodules/appium-xcuitest-driver/docs/reference/bidi.md +192 -0
  401. package/src/resources/submodules/appium-xcuitest-driver/docs/reference/capabilities.md +164 -0
  402. package/src/resources/submodules/appium-xcuitest-driver/docs/reference/commands.md +468 -0
  403. package/src/resources/submodules/appium-xcuitest-driver/docs/reference/element-attributes.md +157 -0
  404. package/src/resources/submodules/appium-xcuitest-driver/docs/reference/env-vars.md +18 -0
  405. package/src/resources/submodules/appium-xcuitest-driver/docs/reference/execute-methods.md +2269 -0
  406. package/src/resources/submodules/appium-xcuitest-driver/docs/reference/ios-predicate.md +196 -0
  407. package/src/resources/submodules/appium-xcuitest-driver/docs/reference/locator-strategies.md +107 -0
  408. package/src/resources/submodules/appium-xcuitest-driver/docs/reference/scripts.md +555 -0
  409. package/src/resources/submodules/appium-xcuitest-driver/docs/reference/security-flags.md +28 -0
  410. package/src/resources/submodules/appium-xcuitest-driver/docs/reference/server-args.md +19 -0
  411. package/src/resources/submodules/appium-xcuitest-driver/docs/reference/settings.md +467 -0
  412. package/src/resources/submodules/appium-xcuitest-driver/docs/reference/xpath-extensions.md +167 -0
  413. package/src/resources/submodules/appium-xcuitest-driver/docs/troubleshooting/element-lookup.md +202 -0
  414. package/src/resources/submodules/appium-xcuitest-driver/docs/troubleshooting/index.md +204 -0
  415. package/src/resources/submodules/appium-xcuitest-driver/docs/troubleshooting/wda-slowness.md +206 -0
  416. package/src/resources/submodules/appium-xcuitest-driver/test/assets/test.png +0 -0
  417. package/src/resources/submodules.zip +0 -0
@@ -0,0 +1,2253 @@
1
+ # Appium UiAutomator2 Driver
2
+
3
+ [![NPM version](http://img.shields.io/npm/v/appium-uiautomator2-driver.svg)](https://npmjs.org/package/appium-uiautomator2-driver)
4
+ [![Downloads](http://img.shields.io/npm/dm/appium-uiautomator2-driver.svg)](https://npmjs.org/package/appium-uiautomator2-driver)
5
+
6
+ [![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)
7
+
8
+
9
+ Appium 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.
10
+
11
+ UiAutomator2 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.
12
+
13
+ See the [end-to-end architecture diagram](./docs/architecture.md).
14
+
15
+ > [!IMPORTANT]
16
+ > Since major version *5.0.0*, this driver is only compatible with Appium 3. Use the `appium driver install uiautomator2`
17
+ > command to add it to your distribution.
18
+
19
+
20
+ ## Requirements
21
+
22
+ On top of standard Appium requirements UiAutomator2 driver also expects the following prerequisites:
23
+
24
+ - Windows, Linux and macOS are supported as hosts
25
+ - [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.
26
+ - ANDROID_HOME or ANDROID_SDK_ROOT [environment variable](https://developer.android.com/studio/command-line/variables) must be set
27
+ - 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.
28
+ - [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.
29
+ - 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.
30
+ - Since driver version 6.0.0 the minimum supported version of Android API is 8/Oreo (API level 26).
31
+ Before version 6.0.0 the minimum supported version of Android API is 5 (API level 21).
32
+ 6.0 is recommended as version 5 has some known compatibility issues.
33
+
34
+ ### Doctor
35
+
36
+ Since driver version 2.39.0 you can automate the validation for the most of the above
37
+ requirements as well as various optional ones needed by driver extensions by running the
38
+ `appium driver doctor uiautomator2` server command.
39
+
40
+ ## Capabilities
41
+
42
+ ### General
43
+
44
+ Capability Name | Description
45
+ --- | ---
46
+ platformName | 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.
47
+ appium:automationName | Must always be set to `uiautomator2`. Values of `automationName` are compared case-insensitively.
48
+ appium: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
49
+ appium:platformVersion | The platform version of an emulator or a real device. This capability is used for device autodetection if `udid` is not provided
50
+ appium: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.
51
+ appium: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
52
+ appium:fullReset | Being set to `true` always enforces the application under test to be fully uninstalled before starting a new session. `false` by default
53
+ appium:printPageSourceOnFindFailure | Enforces the server to dump the actual XML page source into the log if any error happens. `false` by default.
54
+
55
+ ### Driver/Server
56
+
57
+ Capability Name | Description
58
+ --- | ---
59
+ appium: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.
60
+ appium: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
61
+ appium:uiautomator2ServerLaunchTimeout | The maximum number of milliseconds to wait util UiAutomator2Server is listening on the device. `30000` ms by default
62
+ appium:uiautomator2ServerInstallTimeout | The maximum number of milliseconds to wait util UiAutomator2Server is installed on the device. `20000` ms by default
63
+ appium: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
64
+ appium: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
65
+ appium: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
66
+
67
+ ### App
68
+
69
+ Capability Name | Description
70
+ --- | ---
71
+ appium: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.
72
+ browserName | 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`.
73
+ appium: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
74
+ appium: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
75
+ appium: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
76
+ appium: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
77
+ appium: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
78
+ appium:androidInstallTimeout | Maximum amount of milliseconds to wait until the application under test is installed. `90000` ms by default
79
+ appium: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`).
80
+ appium: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.
81
+ appium: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.
82
+ appium: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.
83
+ appium: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)
84
+ appium: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
85
+ appium: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
86
+ appium: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
87
+ appium:autoLaunch | Whether to launch the application under test automatically (`true`, the default value) after a test starts
88
+ appium: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
89
+ appium: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
90
+ appium:uninstallOtherPackages | Allows to set one or more comma-separated package identifiers to be uninstalled from the device before a test starts
91
+ appium: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
92
+ appium: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.
93
+ appium: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.
94
+
95
+ ### App Localization
96
+
97
+ Capability Name | Description
98
+ --- | ---
99
+ appium: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.
100
+ appium: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`
101
+ appium: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`
102
+
103
+ ### ADB
104
+
105
+ Capability Name | Description
106
+ --- | ---
107
+ appium:adbPort | Number of the port on the host machine where ADB is running. `5037` by default
108
+ appium:remoteAdbHost | Address of the host where ADB is running (the value of `-H` ADB command line option). Unset by default
109
+ appium:adbExecTimeout | Maximum number of milliseconds to wait until single ADB command is executed. `20000` ms by default
110
+ appium:clearDeviceLogsOnStart | If set to `true` then UiAutomator2 deletes all the existing logs in the device buffer before starting a new test
111
+ appium: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`
112
+ appium:skipLogcatCapture | Being set to `true` disables automatic logcat output collection during the test run. `false` by default
113
+ appium: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
114
+ appium: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.
115
+ appium: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.
116
+ appium: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.
117
+ appium:logcatFormat | The log print format, where `format` is one of: `brief` `process` `tag` `thread` `raw` `time` `threadtime` `long`. `threadtime` is the default value.
118
+ appium: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'.
119
+ appium: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.
120
+ appium: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.
121
+
122
+ ### Emulator (Android Virtual Device)
123
+
124
+ Capability Name | Description
125
+ --- | ---
126
+ appium: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.
127
+ appium:avdLaunchTimeout | Maximum number of milliseconds to wait until Android Emulator is started. `60000` ms by default
128
+ appium:avdReadyTimeout | Maximum number of milliseconds to wait until Android Emulator is fully booted and is ready for usage. `60000` ms by default
129
+ appium: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.
130
+ appium:avdEnv | Mapping of emulator [environment variables](https://developer.android.com/studio/command-line/variables).
131
+ appium: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.
132
+ appium: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
133
+ appium: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.
134
+ appium: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.
135
+
136
+ ### App Signing
137
+
138
+ Capability Name | Description
139
+ --- | ---
140
+ appium: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.
141
+ appium: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
142
+ appium: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
143
+ appium: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
144
+ appium: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
145
+ appium: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.
146
+
147
+ ### Device Locking
148
+
149
+ Capability Name | Description
150
+ --- | ---
151
+ appium: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.
152
+ appium:unlockType | Set one of the possible types of Android lock screens to unlock. Read the [Unlock tutorial](./docs/unlock/main.md) for more details.
153
+ appium:unlockKey | Allows to set an unlock key. Read the [Unlock tutorial](./docs/unlock/main.md) for more details.
154
+ appium:unlockStrategy | Either 'locksettings' (default) or 'uiautomator'. Read the [Unlock tutorial](./docs/unlock/main.md) for more details.
155
+ appium: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.
156
+
157
+ ### MJPEG
158
+
159
+ Read the [MJPEG guide](docs/mjpeg.md) for capabilities, settings, and usage details.
160
+
161
+ Capability Name | Description
162
+ --- | ---
163
+ appium: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).
164
+ appium: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.
165
+
166
+ ### Web Context
167
+
168
+ Capability Name | Description
169
+ --- | ---
170
+ appium: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.
171
+ appium: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.
172
+ appium: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.
173
+ appium: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.
174
+ appium: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.
175
+ appium: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.
176
+ appium:chromedriverPort | The port number to use for Chromedriver communication. Any free port number is selected by default if unset.
177
+ appium: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.
178
+ appium: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.
179
+ appium:chromedriverExecutable | Full path to the chromedriver executable on the server file system.
180
+ appium: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.
181
+ appium: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.
182
+ appium: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.
183
+ appium:chromedriverDisableBuildCheck | Being set to `true` disables the compatibility validation between the current chromedriver and the destination browser/web view. Use it with care.
184
+ appium: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
185
+ appium: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.
186
+ appium: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.
187
+ appium:showChromedriverLog | If set to `true` then all the output from chromedriver binary will be forwarded to the Appium server log. `false` by default.
188
+ pageLoadStrategy | One of the available page load strategies. See https://www.w3.org/TR/webdriver/#capabilities
189
+ appium:chromeOptions | A mapping, that allows to customize chromedriver options. See https://chromedriver.chromium.org/capabilities for the list of available entries.
190
+ appium: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.
191
+ appium: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.
192
+
193
+ ### Other
194
+
195
+ Capability Name | Description
196
+ --- | ---
197
+ appium: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
198
+ appium: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.
199
+ appium: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.
200
+ appium: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`.
201
+ appium: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`
202
+
203
+
204
+ ## Element Attributes
205
+
206
+ UiAutomator2 driver supports the following element attributes:
207
+
208
+ Name | Description | Example
209
+ --- | --- | ---
210
+ checkable | Whether the element is checkable or not | 'true'
211
+ checked | Whether the element is checked. Always `false` if the element is not checkable | 'false'
212
+ class or className | The full name of the element's class. Could be `null` for some elements | 'android.view.View'
213
+ clickable | Whether the element could be clicked | 'false'
214
+ content-desc or contentDescription | The content-description attribute of the accessible element | 'foo'
215
+ enabled | Whether the element could be clicked | 'true'
216
+ focusable | Whether the element could be focused | 'true'
217
+ focused | Whether the element could is focused. Always `false` if the element is not focusable | 'false'
218
+ long-clickable or longClickable | Whether the element accepts long clicks | 'false'
219
+ package | Identifier of the package the element belongs to | 'com.mycompany'
220
+ password | Whether the element is a password input field | 'true'
221
+ resource-id or resourceId | Element's resource identifier. Could be `null` | 'com.mycompany:id/resId'
222
+ scrollable | Whether the element is scrollable | 'true'
223
+ selection-start | Contains the index of the char where the selection starts. Could be `null` if the element provides no range info | '5'
224
+ selection-end | Contains the index of the char where the selection ends. Could be `null` if the element provides no range info | '8'
225
+ selected | Whether the element is selected | 'false'
226
+ text or name | The element's text. It never equals to null | 'my text'
227
+ hint | Element's hint text. On Android versions below Oreo it always equals to `null`. | 'my hint text'
228
+ bounds | The element's visible frame (`[left, top][right, bottom]`) | `[0,0][100,100]`
229
+ displayed | Whether the element is visible to the user | 'true'
230
+ contentSize | The dimensions of the element's content area | `{"left": 0, "top":0, "width": 100, "height": 100, "scrollableOffset": 10, "touchPadding": 0}`
231
+ extras | 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:<br> `AccessibilityNodeInfo.roleDescription=;`<br>`AccessibilityNodeInfo.chromeRole=rootWebArea;`<br> `ACTION_ARGUMENT_HTML_ELEMENT_STRING_VALUES=`<br> `ARTICLE,BLOCKQUOTE,BUTTON,CHECKBOX`
232
+ a11y-important | Whether the element originates from a view considered important for accessibility. Available for API 24+ | 'true'
233
+ screen-reader-focusable | Whether the element is explicitly marked as a focusable unit by a screen reader. Available for API 28+ | 'true'
234
+ input-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'
235
+ drawing-order | The drawing position of the view corresponding to this element relative to its siblings. Available for API 24+ | '3'
236
+ showing-hint | Whether the element's text represents a hint for the user to enter text. Available for API 26+ | 'true'
237
+ text-entry-key | Whether the element represents a text entry key that is part of a keyboard or keypad. Available for API 29+ | 'true'
238
+ multiline | If the element is a multi line editable text. Available only for text input fields. | 'true'
239
+ dismissable | If the element can be dismissed | 'true'
240
+ a11y-focused | Whether this element is accessibility focused | 'true'
241
+ heading | Whether element represents a heading. Available for API 28+ | 'true'
242
+ live-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'
243
+ context-clickable | Whether this element is context clickable. Available for API 23+ | 'true'
244
+ max-text-length | The maximum text length for the editable text element. Available only for text input fields. | '300'
245
+ content-invalid | If the content of this element is invalid. For example, a date is not well-formed. | 'true'
246
+ error | The error text of the element. | 'text string'
247
+ pane-title | Title of the pane represented by this element. Available for API 28+ | 'text string'
248
+ actions | 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'
249
+ tooltip-text | The result of [getTooltipText](https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo#getTooltipText()). Could be `null`, available for API 28+ | 'Paste'
250
+ text-has-clickable-span | Indicates whether the `TextView` content contains `ClickableSpan` or `URLSpan` elements, `null` in all other cases. | 'true'
251
+ window-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
252
+
253
+
254
+ ## Element Location
255
+
256
+ UiAutomator2 driver supports the following location strategies:
257
+
258
+ Name | Description | Speed Ranking | Example
259
+ --- | --- | --- | ---
260
+ id | 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'
261
+ accessibilityId | 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'
262
+ className | 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'
263
+ -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\"))
264
+ xpath | 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\"]")
265
+
266
+ > [!NOTE] For testing multi-window applications, see the [Multi-Window Testing Guide](docs/android-multiwindow.md).
267
+
268
+ > [!WARNING]
269
+ > Google is going to [deprecate](https://developer.android.com/training/testing/other-components/ui-automator-legacy#ui-automator)
270
+ > and remove `UiCollection`, `UiObject`, `UiScrollable`, and `UiSelector` support from the UiAutomator framework.
271
+ > This will render all `-android uiautomator`-based locators invalid, so please keep it in mind while
272
+ > using them or plan to use them in the future.
273
+
274
+
275
+ ## BiDi Protocol Support
276
+
277
+ UIAutomator2 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.
278
+
279
+
280
+ ## Parallel Tests
281
+
282
+ It is possible to execute tests in parallel using UiAutomator2 driver.
283
+ Appium allows to do this on per-process (multiple server processes running on different ports managing single session)
284
+ or per-request basis (single server process managing multiple sessions, more preferable, uses less resources and ensures better control over running sessions).
285
+
286
+ _Note_: If you are not going to run your tests in parallel then consider enabling the `--session-override` Appium server argument.
287
+ It forces the server to close all pending sessions before a new one could be opened,
288
+ which allows you to avoid possible issues with such sessions silently running/expiring in the background.
289
+
290
+ ### Important Real Device Capabilities
291
+
292
+ - `udid`: The unique device id.
293
+ - `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).
294
+ - `chromedriverPort`: The unique chromedriver port if testing web views or Chrome.
295
+ - `mjpegServerPort`: Set a unique MJPEG server port for each parallel session if you are going to record a video.
296
+
297
+ ### Important Emulator Capabilities
298
+
299
+ - `avd`: The unique emulator name.
300
+ - `systemPort`: Set a unique system port number for each parallel session.
301
+ - `chromedriverPort`: The unique chromedriver port (if testing web views or Chrome).
302
+ - `mjpegServerPort`: Set a unique MJPEG server port for each parallel session if you are going to record a video.
303
+
304
+
305
+ ## Settings API
306
+
307
+ UiAutomator2 driver supports Appium [Settings API](https://appium.io/docs/en/latest/guides/settings/).
308
+ Along with the common settings the following driver-specific settings are currently available:
309
+
310
+ Name | Type | Description
311
+ --- | --- | ---
312
+ actionAcknowledgmentTimeout | 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
313
+ allowInvisibleElements | 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
314
+ ignoreUnimportantViews | 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
315
+ elementResponseAttributes | 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/<element_attribute_name>`. It is required that `shouldUseCompactResponses` setting is set to `false` in order for this one to apply.
316
+ enableMultiWindows | 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.
317
+ enableTopmostWindowFromActivePackage | 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.
318
+ enableNotificationListener | 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.
319
+ keyInjectionDelay | long | Delay in milliseconds between key presses when injecting text input. 0 ms by default
320
+ scrollAcknowledgmentTimeout | 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
321
+ shouldUseCompactResponses | 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
322
+ waitForIdleTimeout | 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.
323
+ waitForSelectorTimeout | 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
324
+ normalizeTagNames | 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
325
+ shutdownOnPowerDisconnect | 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.
326
+ simpleBoundsCalculation | 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.
327
+ trackScrollEvents | 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.
328
+ wakeLockTimeout | 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.
329
+ serverPort | 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
330
+ mjpegServerPort | 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
331
+ mjpegServerFramerate | int | The maximum count of screenshots per second taken by the MJPEG screenshots broadcaster. Must be in range 1..60. `10` by default
332
+ mjpegScalingFactor | 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.
333
+ mjpegServerScreenshotQuality | 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.
334
+ mjpegBilinearFiltering | 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.
335
+ useResourcesForOrientationDetection | 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.
336
+ enforceXPath1 | 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.
337
+ limitXPathContextScope | 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")`.
338
+ disableIdLocatorAutocompletion | boolean | According to internal Android standards it is expected that each resource identifier is prefixed with `<packageName>: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`.
339
+ alwaysTraversableViewClasses | 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.
340
+ includeExtrasInPageSource | 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.
341
+ includeA11yActionsInPageSource | 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.
342
+ snapshotMaxDepth | 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.
343
+ currentDisplayId | 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.
344
+
345
+
346
+ ## Platform-Specific Extensions
347
+
348
+ Beside 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:
349
+
350
+ ```java
351
+ // Java 11+
352
+ var result = driver.executeScript("mobile: <methodName>", Map.ofEntries(
353
+ Map.entry("arg1", "value1"),
354
+ Map.entry("arg2", "value2")
355
+ // you may add more pairs if needed or skip providing the map completely
356
+ // if all arguments are defined as optional
357
+ ));
358
+ ```
359
+
360
+ ```js
361
+ // WebdriverIO
362
+ const result = await driver.executeScript('mobile: <methodName>', [{
363
+ arg1: "value1",
364
+ arg2: "value2",
365
+ }]);
366
+ ```
367
+
368
+ ```python
369
+ # Python
370
+ result = driver.execute_script('mobile: <methodName>', {
371
+ 'arg1': 'value1',
372
+ 'arg2': 'value2',
373
+ })
374
+ ```
375
+
376
+ ```ruby
377
+ # Ruby
378
+ result = @driver.execute_script 'mobile: <methodName>', {
379
+ arg1: 'value1',
380
+ arg2: 'value2',
381
+ }
382
+ ```
383
+
384
+ ```csharp
385
+ // Dotnet
386
+ object result = driver.ExecuteScript("mobile: <methodName>", new Dictionary<string, object>() {
387
+ {"arg1", "value1"},
388
+ {"arg2", "value2"}
389
+ });
390
+ ```
391
+
392
+ ### mobile: shell
393
+
394
+ Executes 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.
395
+
396
+ #### Arguments
397
+
398
+ Name | Type | Required | Description | Example
399
+ --- | --- | --- | --- | ---
400
+ command | string | yes | Shell command name to execute, for example `echo` or `rm` | echo
401
+ args | Array&lt;string&gt; | no | Array of command arguments | `['-f', '/sdcard/myfile.txt']`
402
+ timeout | 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
403
+ includeStderr | boolean | no | Whether to include stderr stream into the returned result. `false` by default | true
404
+
405
+ #### Returned Result
406
+
407
+ Depending 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.
408
+
409
+ ### mobile: execEmuConsoleCommand
410
+
411
+ Executes a command through emulator telnet console interface and returns its output.
412
+ The `emulator_console` server feature must be enabled in order to use this method.
413
+
414
+ #### Arguments
415
+
416
+ Name | Type | Required | Description | Example
417
+ --- | --- | --- | --- | ---
418
+ command | 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
419
+ execTimeout | number | no | Timeout used to wait for a server reply to the given command in milliseconds. `60000` ms by default | 100000
420
+ connTimeout | boolean | no | Console connection timeout in milliseconds. `5000` ms by default | 10000
421
+ initTimeout | boolean | no | Telnet console initialization timeout in milliseconds (the time between the connection happens and the command prompt). `5000` ms by default | 10000
422
+
423
+ #### Returned Result
424
+
425
+ The actual command output. An error is thrown if command execution fails.
426
+
427
+ ### Mobile Gesture Commands
428
+
429
+ UiAutomator2 provides several extensions that allow to automate popular mobile gesture shortcuts:
430
+
431
+ - mobile: dragGesture
432
+ - mobile: flingGesture
433
+ - mobile: doubleClickGesture
434
+ - mobile: clickGesture
435
+ - mobile: longClickGesture
436
+ - mobile: pinchCloseGesture
437
+ - mobile: pinchOpenGesture
438
+ - mobile: swipeGesture
439
+ - mobile: scrollGesture
440
+
441
+ These 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
442
+ [Low-Level Insights on Android Input Events](docs/actions.md) if you need to automate more complicated gestures.
443
+
444
+ ### mobile: scroll
445
+
446
+ Scrolls 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.
447
+
448
+ #### Arguments
449
+
450
+ Name | Type | Required | Description | Example
451
+ --- | --- | --- | --- | ---
452
+ elementId | 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
453
+ strategy | string | yes | The following strategies are supported: `accessibility id` (UiSelector().description), `class name` (UiSelector().className), `-android uiautomator` (UiSelector) | 'accessibility id'
454
+ selector | string | yes | The corresponding lookup value for the selected strategy. | 'com.mycompany:id/table'
455
+ maxSwipes | 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
456
+
457
+ ### mobile: deepLink
458
+
459
+ Start 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.
460
+
461
+ #### Arguments
462
+
463
+ Name | Type | Required | Description | Example
464
+ --- | --- | --- | --- | ---
465
+ url | string | yes | The URL to start | theapp://login/
466
+ package | 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'
467
+ waitForLaunch | boolean | no | If `false` then ADB won't wait for the started activity to return the control. `true` by default | false
468
+
469
+ ### mobile: startLogsBroadcast
470
+
471
+ Starts 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.
472
+
473
+ Consider using [logs broadcast via BiDi](./docs/bidi.md#logentryadded) over this extension.
474
+
475
+ ### mobile: stopLogsBroadcast
476
+
477
+ Stops 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.
478
+
479
+ Consider using [logs broadcast via BiDi](./docs/bidi.md#logentryadded) over this extension.
480
+
481
+ ### mobile: deviceidle
482
+
483
+ This is a wrapper to 'adb shell dumpsys deviceidle' interface.
484
+ Read [Diving Into Android 'M' Doze](https://www.protechtraining.com/blog/post/diving-into-android-m-doze-875) for more details.
485
+ This API only exists since Android 6.
486
+
487
+ #### Arguments
488
+
489
+ Name | Type | Required | Description | Example
490
+ --- | --- | --- | --- | ---
491
+ action | whitelistAdd or whitelistRemove | yes | The name of the action to perform | whitelistAdd
492
+ packages | string or string[] | yes | One or more package names to perfom the above action on | 'com.mycompany'
493
+
494
+ ### mobile: acceptAlert
495
+
496
+ Tries 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.
497
+
498
+ #### Arguments
499
+
500
+ Name | Type | Required | Description | Example
501
+ --- | --- | --- | --- | ---
502
+ buttonLabel | 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
503
+
504
+ ### mobile: dismissAlert
505
+
506
+ Tries 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.
507
+
508
+ #### Arguments
509
+
510
+ Name | Type | Required | Description | Example
511
+ --- | --- | --- | --- | ---
512
+ buttonLabel | 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
513
+
514
+ ### mobile: batteryInfo
515
+
516
+ Retrieves the battery information from the device under test.
517
+
518
+ #### Returned Result
519
+
520
+ The extension returns a dictionary whose entries are:
521
+
522
+ Name | Type | Description | Example
523
+ --- | --- | --- | ---
524
+ level | 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
525
+ state | 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
526
+
527
+ ### mobile: deviceInfo
528
+
529
+ Retrieves the information about the device under test, like the device model, serial number, network connectivity info, etc.
530
+
531
+ #### Returned Result
532
+
533
+ The 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.
534
+
535
+ ### mobile: resetAccessibilityCache
536
+
537
+ Resets the accessibility cache on the device. This can be useful when the accessibility
538
+ service cache becomes stale and needs to be refreshed to reflect the current UI state.
539
+ The driver does cache reset automatically before any element lookup as well as before
540
+ retrieving 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
541
+ highly dynamic elements. Note that this methods also waits until app under test becomes
542
+ idle, so it might also slow down your automation if called too often under non-idling
543
+ circumstances.
544
+
545
+ ### mobile: listWindows
546
+
547
+ Gets 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.
548
+
549
+ #### Arguments
550
+
551
+ Name | Type | Required | Description | Example
552
+ --- | --- | --- | --- | ---
553
+ filters | 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}`
554
+ | | | | `packageName` (string): Package name pattern with glob support (e.g., `com.example.*`) |
555
+ | | | | `windowId` (number): Window identifier |
556
+ | | | | `displayId` (number): Display identifier |
557
+ | | | | `physicalDisplayId` (string): Physical display identifier (as string to avoid JavaScript number precision issues) |
558
+ | | | | `type` (number): Window type (see [AccessibilityWindowInfo.TYPE_*](https://developer.android.com/reference/android/view/accessibility/AccessibilityWindowInfo#TYPE_APPLICATION) constants) |
559
+ | | | | `title` (string): Window title pattern with glob support |
560
+ | | | | `layer` (number): Window Z-order layer (higher values are on top) |
561
+ | | | | `isAccessibilityFocused` (boolean): Whether the window has accessibility focus |
562
+ | | | | `isActive` (boolean): Whether the window is active |
563
+ | | | | `isFocused` (boolean): Whether the window has input focus |
564
+ | | | | `isInPictureInPictureMode` (boolean): Whether the window is in picture-in-picture mode |
565
+ skipScreenshots | 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
566
+
567
+ #### Returned Result
568
+
569
+ The extension returns an array of window information objects. Each object contains:
570
+
571
+ Name | Type | Description | Example
572
+ --- | --- | --- | ---
573
+ windowId | number \| null | Window identifier (may be null if the window ID cannot be determined) | 42
574
+ displayId | number | Display identifier where the window is located | 0
575
+ physicalDisplayId | string \| null | Physical display identifier (may be null). Returned as a string to avoid JavaScript number precision issues with large values. | '1234567890'
576
+ virtualDisplayId | 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'
577
+ rect | object | Window bounds rectangle with `left`, `top`, `right`, `bottom` properties | `{left: 0, top: 0, right: 1080, bottom: 1920}`
578
+ packageName | string \| null | Package name of the application that owns this window (may be null) | `com.example.app`
579
+ screenshot | string \| null | Base64-encoded PNG screenshot of the window (may be null). Only available on Android API 34+ and when `skipScreenshots` is `false`. | `iVBORw0KGgoAAAANSUhEUgAA...`
580
+ type | 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
581
+ title | string \| null | Window title (may be null) | 'My App Window'
582
+ layer | number | Window Z-order layer. Higher values indicate windows that are drawn on top of windows with lower layer values. | 100
583
+ isAccessibilityFocused | boolean | Whether the window has accessibility focus | true
584
+ isActive | boolean | Whether the window is active | true
585
+ isFocused | boolean | Whether the window has input focus | true
586
+ isInPictureInPictureMode | boolean | Whether the window is in picture-in-picture mode | false
587
+
588
+ ### mobile: listDisplays
589
+
590
+ Gets a list of all displays available on the device.
591
+
592
+ #### Returned Result
593
+
594
+ The extension returns an array of display information objects. Each object contains:
595
+
596
+ Name | Type | Description | Example
597
+ --- | --- | --- | ---
598
+ id | number | Display identifier (logical display ID). This is the value used by the `currentDisplayId` setting. | 0
599
+ name | string \| null | Display name (may be null) | 'Built-in Screen'
600
+ physicalId | 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'
601
+ virtualId | 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'
602
+ metrics | object | Display metrics containing size and density information. See below for details. | See metrics table
603
+ isDefault | boolean | Whether this is the default display | true
604
+
605
+ #### Display Metrics
606
+
607
+ The `metrics` object contains the following properties:
608
+
609
+ Name | Type | Description | Example
610
+ --- | --- | --- | ---
611
+ widthPixels | number | Display width in pixels | 1080
612
+ heightPixels | number | Display height in pixels | 1920
613
+ density | number | Display density (logical density factor). This is a scaling factor for the display. | 2.625
614
+ densityDpi | number | Display density in DPI (dots per inch) | 420
615
+ scaledDensity | 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
616
+ xdpi | number | Exact physical pixels per inch of the screen in the X dimension | 420.0
617
+ ydpi | number | Exact physical pixels per inch of the screen in the Y dimension | 420.0
618
+
619
+ **Example:**
620
+ ```python
621
+ # List all displays
622
+ displays = driver.execute_script('mobile: listDisplays')
623
+
624
+ for display in displays:
625
+ print(f"Display ID: {display['id']}")
626
+ print(f" Name: {display['name']}")
627
+ print(f" Physical ID: {display['physicalId']}")
628
+ if display.get('virtualId'):
629
+ print(f" Virtual ID: {display['virtualId']}")
630
+ print(f" Is default: {display['isDefault']}")
631
+ print(f" Size: {display['metrics']['widthPixels']}x{display['metrics']['heightPixels']}")
632
+ print(f" Density: {display['metrics']['density']} ({display['metrics']['densityDpi']} DPI)")
633
+ ```
634
+
635
+ ### mobile: getDeviceTime
636
+
637
+ Retrieves the current device's timestamp.
638
+
639
+ #### Arguments
640
+
641
+ Name | Type | Required | Description | Example
642
+ --- | --- | --- | --- | ---
643
+ format | 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
644
+
645
+ #### Returned Result
646
+
647
+ The device timestamp string formatted according to the given specifiers
648
+
649
+ ### mobile: changePermissions
650
+
651
+ Changes package permissions in runtime.
652
+
653
+ #### Arguments
654
+
655
+ Name | Type | Required | Description | Example
656
+ --- | --- | --- | --- | ---
657
+ permissions | string or Array&lt;string&gt; | 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']`
658
+ appPackage | string | no | The application package to set change permissions on. Defaults to the package name under test | com.mycompany.myapp
659
+ action | string | no | Either `grant` (the default action) or `revoke` if `target` is set to `pm`, otherwise one of: `allow` (default), `deny`, `ignore`, `default`. | allow
660
+ target | 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
661
+
662
+ ### mobile: getPermissions
663
+
664
+ Gets runtime permissions list for the given application package.
665
+
666
+ #### Arguments
667
+
668
+ Name | Type | Required | Description | Example
669
+ --- | --- | --- | --- | ---
670
+ type | string | no | One of possible permission types to get. Can be one of: `denied`, `granted` or `requested` (the default value). | granted
671
+ appPackage | string | no | The application package to get permissions from. Defaults to the package name under test | com.mycompany.myapp
672
+
673
+ #### Returned Result
674
+
675
+ Array of strings, where each string is a permission name. the array could be empty.
676
+
677
+ ### mobile: performEditorAction
678
+
679
+ Performs IME action on the _currently focused_ edit element.
680
+
681
+ Very 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.
682
+
683
+ #### Arguments
684
+
685
+ Name | Type | Required | Description | Example
686
+ --- | --- | --- | --- | ---
687
+ action | 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
688
+
689
+ ### mobile: startScreenStreaming
690
+
691
+ Starts 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).
692
+
693
+ #### Arguments
694
+
695
+ Name | Type | Required | Description | Example
696
+ --- | --- | --- | --- | ---
697
+ width | 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
698
+ height | 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
699
+ bitRate | 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
700
+ host | 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
701
+ pathname | 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
702
+ tcpPort | 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
703
+ port | number | no | The port number to start the MJPEG server on. `8093` by default | 5023
704
+ quality | 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
705
+ considerRotation | 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
706
+ logPipelineDetails | boolean | no | Whether to log GStreamer pipeline events into the standard log output. Might be useful for debugging purposes. `false` by default | true
707
+
708
+ ### mobile: stopScreenStreaming
709
+
710
+ Stop the previously started screen streaming. If no screen streaming server has been started then nothing is done.
711
+
712
+ ### mobile: getNotifications
713
+
714
+ Retrieves 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.
715
+
716
+ Appium 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.
717
+ See 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.
718
+
719
+ #### Returned Result
720
+
721
+ The example output is:
722
+ ```json
723
+ {
724
+ "statusBarNotifications":[
725
+ {
726
+ "isGroup":false,
727
+ "packageName":"io.appium.settings",
728
+ "isClearable":false,
729
+ "isOngoing":true,
730
+ "id":1,
731
+ "tag":null,
732
+ "notification":{
733
+ "title":null,
734
+ "bigTitle":"Appium Settings",
735
+ "text":null,
736
+ "bigText":"Keep this service running, so Appium for Android can properly interact with several system APIs",
737
+ "tickerText":null,
738
+ "subText":null,
739
+ "infoText":null,
740
+ "template":"android.app.Notification$BigTextStyle"
741
+ },
742
+ "userHandle":0,
743
+ "groupKey":"0|io.appium.settings|1|null|10133",
744
+ "overrideGroupKey":null,
745
+ "postTime":1576853518850,
746
+ "key":"0|io.appium.settings|1|null|10133",
747
+ "isRemoved":false
748
+ }
749
+ ]
750
+ }
751
+ ```
752
+
753
+ ### mobile: openNotifications
754
+
755
+ Opens notifications drawer on the device under test. Does nothing if the drawer is already opened. Available since driver version 2.23
756
+
757
+ ### mobile: listSms
758
+
759
+ Retrieves the list of the most recent SMS properties list via Appium Settings helper. Messages are sorted by date in descending order.
760
+
761
+ #### Arguments
762
+
763
+ Name | Type | Required | Description | Example
764
+ --- | --- | --- | --- | ---
765
+ max | number | no | The maximum count of recent messages to retrieve. `100` by default | 10
766
+
767
+ #### Returned Result
768
+
769
+ The example output is:
770
+ ```json
771
+ {
772
+ "items":[
773
+ {
774
+ "id":"2",
775
+ "address":"+123456789",
776
+ "person":null,
777
+ "date":"1581936422203",
778
+ "read":"0",
779
+ "status":"-1",
780
+ "type":"1",
781
+ "subject":null,
782
+ "body":"\"text message2\"",
783
+ "serviceCenter":null
784
+ },
785
+ {
786
+ "id":"1",
787
+ "address":"+123456789",
788
+ "person":null,
789
+ "date":"1581936382740",
790
+ "read":"0",
791
+ "status":"-1",
792
+ "type":"1",
793
+ "subject":null,
794
+ "body":"\"text message\"",
795
+ "serviceCenter":null
796
+ }
797
+ ],
798
+ "total":2
799
+ }
800
+ ```
801
+
802
+ ### mobile: type
803
+
804
+ Types 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.
805
+
806
+ #### Arguments
807
+
808
+ Name | Type | Required | Description | Example
809
+ --- | --- | --- | --- | ---
810
+ text | string | yes | The text to type | testing
811
+
812
+ ### mobile: sensorSet
813
+
814
+ Emulate changing of sensor values on the connected emulator.
815
+ This extension does not work on real devices.
816
+
817
+ #### Arguments
818
+
819
+ Name | Type | Required | Description | Example
820
+ --- | --- | --- | --- | ---
821
+ sensorType | 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
822
+ value | string | yes | Check the output of `sensor get <sensorType>` 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
823
+
824
+ ### mobile: pullFile
825
+
826
+ Pulls a remote file from the device.
827
+
828
+ #### Arguments
829
+
830
+ Name | Type | Required | Description | Example
831
+ --- | --- | --- | --- | ---
832
+ remotePath | 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
833
+
834
+ #### Returned Result
835
+
836
+ Base64-encoded string, which represents the content of the remote file.
837
+
838
+ ### mobile: pushFile
839
+
840
+ Pushes a local file to the device.
841
+
842
+ #### Arguments
843
+
844
+ Name | Type | Required | Description | Example
845
+ --- | --- | --- | --- | ---
846
+ remotePath | 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
847
+ payload | string | yes | Base64-encoded content of the file to be pushed. | QXBwaXVt
848
+
849
+ ### mobile: pullFolder
850
+
851
+ Pulls a remote folder from the device.
852
+
853
+ #### Arguments
854
+
855
+ Name | Type | Required | Description | Example
856
+ --- | --- | --- | --- | ---
857
+ remotePath | string | yes | Same as for [pullFile](#mobile-pullfile) extension, but should be pointing to a remote folder | /sdcard/yolo/
858
+
859
+ #### Returned Result
860
+
861
+ Base64-encoded string, which represents the zipped content of the remote folder.
862
+
863
+ ### mobile: deleteFile
864
+
865
+ Deletes a file on the remote device.
866
+
867
+ #### Arguments
868
+
869
+ Name | Type | Required | Description | Example
870
+ --- | --- | --- | --- | ---
871
+ remotePath | 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`
872
+
873
+ ### mobile: isAppInstalled
874
+
875
+ Verify whether an application is installed on the device under test.
876
+
877
+ #### Arguments
878
+
879
+ Name | Type | Required | Description | Example
880
+ --- | --- | --- | --- | ---
881
+ appId | string | yes | The identifier of the application package to be checked | `my.app.id`
882
+ user | number or string | no | The user ID for which the package is installed. The `current` user is used by default | 1006
883
+
884
+ #### Returned Result
885
+
886
+ True or false
887
+
888
+ ### mobile: listApps
889
+
890
+ Lists all installed packages on the Android device, optionally filtered by user.
891
+ An exception will be thrown on devices running Android API below level 26.
892
+
893
+ #### Arguments
894
+
895
+ Name | Type | Required | Description | Example
896
+ --- | --- | --- | --- | ---
897
+ user | number or string | no | The user ID for which the package is installed. The `current` user is used by default | 1006
898
+
899
+ #### Returned Result
900
+
901
+ A map where keys are packageName and values are maps of platform-specific app properties since UIAutomator2 driver v7.0.0.
902
+ UIAutomator2 driver v6.9.0 and v6.9.1 were a list of installed package names.
903
+
904
+ ### mobile: queryAppState
905
+
906
+ Queries the current state of the app.
907
+
908
+ #### Arguments
909
+
910
+ Name | Type | Required | Description | Example
911
+ --- | --- | --- | --- | ---
912
+ appId | string | yes | The identifier of the application package to be checked | `my.app.id`
913
+
914
+ #### Returned Result
915
+
916
+ The following numbers could returned:
917
+ - The app is not installed: `0`
918
+ - The app is installed and is not running: `1`
919
+ - The app is running in background: `3`
920
+ - The app is running in foreground: `4`
921
+
922
+ ### mobile: activateApp
923
+
924
+ Activates the given application or launches it if necessary.
925
+ The action literally simulates
926
+ clicking the corresponding application icon on the dashboard.
927
+
928
+ #### Arguments
929
+
930
+ Name | Type | Required | Description | Example
931
+ --- | --- | --- | --- | ---
932
+ appId | string | yes | The identifier of the application package to be activated | `my.app.id`
933
+
934
+ ### mobile: removeApp
935
+
936
+ Remove the corresponding application if is installed.
937
+ The call is ignored if the app is not installed.
938
+
939
+ #### Arguments
940
+
941
+ Name | Type | Required | Description | Example
942
+ --- | --- | --- | --- | ---
943
+ appId | string | yes | The identifier of the application package to be removed | `my.app.id`
944
+ timeout | number | no | The count of milliseconds to wait until the app is terminated. 20000ms by default. | 1500, 0
945
+ keepData | boolean | no | Set to true in order to keep the application data and cache folders after uninstall. | true
946
+
947
+ #### Returned Result
948
+
949
+ True is the app has been found on the device and successfully removed. Otherwise false.
950
+
951
+ ### mobile: terminateApp
952
+
953
+ Terminates the app and waits until the app is terminated up to the given timeout
954
+ by checking the app state to ensure if the app process is actually stopped.
955
+
956
+ The app state check can be skipped if the given timeout is lower or equal to zero since UIAutomator driver 2.9.0.
957
+ The skip helps when you want to terminate the app process but do not want to check the process existence
958
+ because the app under test may, for example, restart it automatically.
959
+
960
+ #### Arguments
961
+
962
+ Name | Type | Required | Description | Example
963
+ --- | --- | --- | --- | ---
964
+ appId | string | yes | The identifier of the application package to be terminated | `my.app.id`
965
+ timeout | number | no | The count of milliseconds to wait until the app is terminated. 500ms by default. | 1500, 0
966
+
967
+ #### Returned Result
968
+
969
+ True if the app has been successfully terminated.
970
+
971
+ ### mobile: installApp
972
+
973
+ Installs the given application package to the device under test.
974
+ It might raise the `INSTALL_FAILED_VERSION_DOWNGRADE` error if the installation was a version downgrade.
975
+
976
+ #### Arguments
977
+
978
+ Name | Type | Required | Description | Example
979
+ --- | --- | --- | --- | ---
980
+ appPath | string | yes | The local .apk(s) path on the server filesystem or a remote url. | `/app/path.apk`
981
+ timeout | number | no | The count of milliseconds to wait until the app is installed.. 6000ms by default. | 120000
982
+ allowTestPackages | boolean | no | Set to true in order to allow test packages installation. false by default | true
983
+ useSdcard | boolean | no | Set to true to install the app on sdcard instead of the device memory. false by default | true
984
+ grantPermissions | 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
985
+ replace | 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
986
+ checkVersion | 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
987
+
988
+ ### mobile: clearApp
989
+
990
+ Deletes all data associated with a package. Calls `adb shell pm clear` under the hood.
991
+ The app should be accessible, should not be running,
992
+ and should exist on the device under test for this extension to work properly.
993
+
994
+ #### Arguments
995
+
996
+ Name | Type | Required | Description | Example
997
+ --- | --- | --- | --- | ---
998
+ appId | string | yes | The identifier of the application package to be cleared | `my.app.id`
999
+
1000
+ #### Returned Result
1001
+
1002
+ Stdout of the corresponding adb command.
1003
+
1004
+ ### mobile: startActivity
1005
+
1006
+ Starts the given activity intent. Invokes `am start`/`am start-activity` command under the hood.
1007
+ This method extends the functionality of the [Start Activity](#applications-management) app management API.
1008
+
1009
+ #### Arguments
1010
+
1011
+ Name | Type | Required | Description | Example
1012
+ --- | --- | --- | --- | ---
1013
+ intent | string | yes | The full name of the activity intent to start | `com.some.package.name/.YourActivityClassName`
1014
+ user | number or string | no | The user ID for which the service is started. The `current` user is used by default | 1006
1015
+ wait | 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
1016
+ stop | boolean | no | Set it to `true` to force stop the target app before starting the activity. | false
1017
+ windowingMode | 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
1018
+ activityType | 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
1019
+ action | string | no | Action name. The actual value for the Activity Manager's `-a` argument. | android.intent.action.MAIN
1020
+ uri | string | no | Unified resource identifier. The actual value for the Activity Manager's `-d` argument. | https://appium.io
1021
+ mimeType | string | no | Mime type. The actual value for the Activity Manager's `-t` argument. | application/json
1022
+ identifier | string | no | Optional identifier. The actual value for the Activity Manager's `-i` argument. | my_identifier
1023
+ categories | string or Array&lt;string&gt; | no | One or more category names. The actual value(s) for the Activity Manager's `-c` argument. | android.intent.category.LAUNCHER
1024
+ component | string | no | Component name. The actual value for the Activity Manager's `-n` argument. | com.myapp/com.myapp.SplashActivity
1025
+ package | string | no | Package name. The actual value for the Activity Manager's `-p` argument. | com.myapp
1026
+ extras | Array&lt;Array&lt;string&gt;&gt; | 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&lt;Integer&gt;. Value must be a string of comma-separated integers; `la`: Long[]. Value must be a string of comma-separated long numbers; `lal`: List&lt;Long&gt;. Value must be a string of comma-separated long numbers; `fa`: Float[]. Value must be a string of comma-separated float numbers; `fal`: List&lt;Float&gt;. 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&lt;String&gt;. 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']]
1027
+ flags | 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`
1028
+
1029
+ #### Returned Result
1030
+
1031
+ The actual stdout of the downstream `am` command.
1032
+
1033
+ #### Example
1034
+
1035
+ Use 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.
1036
+ If 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.
1037
+
1038
+ Please 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.
1039
+
1040
+ ```ruby
1041
+ # Ruby
1042
+ driver.execute_script 'mobile: startActivity', {
1043
+ wait: true,
1044
+ stop: true,
1045
+ action: 'android.intent.action.MAIN',
1046
+ component: 'io.appium.android.apis/io.appium.android.apis.ApiDemos',
1047
+ categories: ['android.intent.category.LAUNCHER'],
1048
+ flags: '0x10200000'
1049
+ }
1050
+ ```
1051
+
1052
+ ### mobile: startService
1053
+
1054
+ Starts the given service intent. Invokes `am startservice` or `am start-service` command under the hood.
1055
+
1056
+ #### Arguments
1057
+
1058
+ Name | Type | Required | Description | Example
1059
+ --- | --- | --- | --- | ---
1060
+ intent | string | no | The full name of the service intent to start | `com.some.package.name/.YourServiceSubClassName`
1061
+ user | number or string | no | The user ID for which the service is started. The `current` user id is used by default | 1006
1062
+ foreground | 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
1063
+ action | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | android.intent.action.MAIN
1064
+ uri | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | https://appium.io
1065
+ mimeType | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | application/json
1066
+ identifier | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | my_identifier
1067
+ categories | string or Array&lt;string&gt; | no | See the documentation for [startActivity extension](#mobile-startactivity) | com.myapp/com.myapp.SplashActivity
1068
+ component | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | android.intent.category.LAUNCHER
1069
+ package | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | com.myapp
1070
+ extras | Array&lt;Array&lt;string&gt;&gt; | no | See the documentation for [startActivity extension](#mobile-startactivity) | [['s', 'varName1', 'My String1'], ['s', 'varName2', 'My String2'], ['ia', 'arrName', '1,2,3,4']]
1071
+ flags | 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`
1072
+
1073
+ #### Returned Result
1074
+
1075
+ The actual stdout of the downstream `am` command.
1076
+
1077
+ ### mobile: stopService
1078
+
1079
+ Stops the given service intent. Invokes `am stopservice` or `am stop-service` command under the hood.
1080
+
1081
+ #### Arguments
1082
+
1083
+ Name | Type | Required | Description | Example
1084
+ --- | --- | --- | --- | ---
1085
+ intent | string | no | The full name of the service intent to stop | `com.some.package.name/.YourServiceSubClassName`
1086
+ user | number or string | no | The user ID for which the service is started. The `current` user id is used by default | 1006
1087
+ action | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | android.intent.action.MAIN
1088
+ uri | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | https://appium.io
1089
+ mimeType | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | application/json
1090
+ identifier | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | my_identifier
1091
+ categories | string or Array&lt;string&gt; | no | See the documentation for [startActivity extension](#mobile-startactivity) | com.myapp/com.myapp.SplashActivity
1092
+ component | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | android.intent.category.LAUNCHER
1093
+ package | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | com.myapp
1094
+ extras | Array&lt;Array&lt;string&gt;&gt; | no | See the documentation for [startActivity extension](#mobile-startactivity) | [['s', 'varName1', 'My String1'], ['s', 'varName2', 'My String2'], ['ia', 'arrName', '1,2,3,4']]
1095
+ flags | 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`
1096
+
1097
+ ### mobile: broadcast
1098
+
1099
+ Send a broadcast Intent. Invokes `am broadcast` command under the hood.
1100
+
1101
+ #### Arguments
1102
+
1103
+ Name | Type | Required | Description | Example
1104
+ --- | --- | --- | --- | ---
1105
+ intent | string | no | The full name of the intent to broadcast | `com.some.package.name/.YourIntentClassName`
1106
+ user | number or string | no | Specify which user to send to; if not specified then send to all users. Possible values are `all`/`current`/`<numeric user id>` | current
1107
+ receiverPermission | string | no | Require receiver to hold the given permission | android.permission.READ_PROFILE
1108
+ allowBackgroundActivityStarts | boolean | no | The receiver may start activities even if in the background if set to `true` | false
1109
+ action | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | android.intent.action.MAIN
1110
+ uri | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | https://appium.io
1111
+ mimeType | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | application/json
1112
+ identifier | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | my_identifier
1113
+ categories | string or Array&lt;string&gt; | no | See the documentation for [startActivity extension](#mobile-startactivity) | com.myapp/com.myapp.SplashActivity
1114
+ component | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | android.intent.category.LAUNCHER
1115
+ package | string | no | See the documentation for [startActivity extension](#mobile-startactivity) | com.myapp
1116
+ extras | Array&lt;Array&lt;string&gt;&gt; | no | See the documentation for [startActivity extension](#mobile-startactivity) | [['s', 'varName1', 'My String1'], ['s', 'varName2', 'My String2'], ['ia', 'arrName', '1,2,3,4']]
1117
+ flags | 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`
1118
+
1119
+ #### Returned Result
1120
+
1121
+ The actual stdout of the downstream `am` command.
1122
+
1123
+ ### mobile: getContexts
1124
+
1125
+ Retrieves a WebViews mapping based on CDP endpoints
1126
+
1127
+ #### Arguments
1128
+
1129
+ Name | Type | Required | Description | Example
1130
+ --- | --- | --- | --- | ---
1131
+ waitForWebviewMs | number | no | Tells UiAutomator2 driver for how long (in milliseconds) to wait for web view(s) to appear since UiAutomator2 driver v2.53.0. If a Chrome process running on the device under test fails to create a connection to the devtools socket, then the chromedriver will rise an error similar to `failed to connect to socket 'localabstract:chrome_devtools_remote'` in UiAutomator2 driver. It could cause no WebViews found result, although a couple of retrials may fix it. This argument helps to keep trying to get WebView(s) up to the given time milliseconds as one command call. This issue tends to occur Chrome v115 and over so far. [issues#19251](https://github.com/appium/appium/issues/19251) contains more details. If set to `0`ms (the default value), then UiAutomator2 driver only checks the WebView(s) availability once. | 10000
1132
+
1133
+ #### Returned Result
1134
+
1135
+ The following json demonstrates the example of WebviewsMapping object.
1136
+ Note that `description` in `page` can be an empty string most likely when it comes to Mobile Chrome)
1137
+
1138
+ ```json
1139
+ {
1140
+ "proc": "@webview_devtools_remote_22138",
1141
+ "webview": "WEBVIEW_22138",
1142
+ "info": {
1143
+ "Android-Package": "io.appium.settings",
1144
+ "Browser": "Chrome/74.0.3729.185",
1145
+ "Protocol-Version": "1.3",
1146
+ "User-Agent": "Mozilla/5.0 (Linux; Android 10; Android SDK built for x86 Build/QSR1.190920.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.185 Mobile Safari/537.36",
1147
+ "V8-Version": "7.4.288.28",
1148
+ "WebKit-Version": "537.36 (@22955682f94ce09336197bfb8dffea991fa32f0d)",
1149
+ "webSocketDebuggerUrl": "ws://127.0.0.1:10900/devtools/browser"
1150
+ },
1151
+ "pages": [
1152
+ {
1153
+ "description": "{\"attached\":true,\"empty\":false,\"height\":1458,\"screenX\":0,\"screenY\":336,\"visible\":true,\"width\":1080}",
1154
+ "devtoolsFrontendUrl": "http://chrome-devtools-frontend.appspot.com/serve_rev/@22955682f94ce09336197bfb8dffea991fa32f0d/inspector.html?ws=127.0.0.1:10900/devtools/page/27325CC50B600D31B233F45E09487B1F",
1155
+ "id": "27325CC50B600D31B233F45E09487B1F",
1156
+ "title": "Releases · appium/appium · GitHub",
1157
+ "type": "page",
1158
+ "url": "https://github.com/appium/appium/releases",
1159
+ "webSocketDebuggerUrl": "ws://127.0.0.1:10900/devtools/page/27325CC50B600D31B233F45E09487B1F"
1160
+ }
1161
+ ],
1162
+ "webviewName": "WEBVIEW_com.io.appium.setting"
1163
+ }
1164
+ ```
1165
+
1166
+ ### mobile: getChromeCapabilities
1167
+
1168
+ Retrieves the Chrome capabilities that are being used for the current
1169
+ Chromedriver session. This method is useful for debugging Chrome/webview
1170
+ automation issues and understanding what capabilities are being applied to the
1171
+ Chromedriver instance.
1172
+
1173
+ #### Returned Result
1174
+
1175
+ The extension returns a dictionary containing the Chrome capabilities that are
1176
+ currently being used by the Chromedriver session. The structure of the returned
1177
+ object follows the standard Chrome/Chromium capabilities format and may include
1178
+ properties such as:
1179
+
1180
+ - `browserName`: The name of the browser (typically "chrome")
1181
+ - `browserVersion`: The version of Chrome/Chromium being automated
1182
+ - `platformName`: The platform name
1183
+ - Other standard WebDriver capabilities
1184
+
1185
+ The exact structure and properties may vary depending on
1186
+ the Chrome version and the capabilities that were set during session creation.
1187
+
1188
+ ### mobile: installMultipleApks
1189
+
1190
+ Install applications via `install-multiple` option.
1191
+ Please read more details in the corresponding section of the `adb --help` command output.
1192
+
1193
+ #### Arguments
1194
+
1195
+ Name | Type | Required | Description | Example
1196
+ --- | --- | --- | --- | ---
1197
+ apks | Array&lt;string&gt; | yes | The path to APKs. Each path should be the full path to the apk to be installed, or an URL to a remote location. | `['/path/to/local.apk', 'https://github.com/appium/ruby_lib_core/blob/master/test/functional/app/api.apk.zip?raw=true']`
1198
+ options | object | no | Installation options. If you want enable `-g` option, you could specify that `{grantPermissions: true}`. `allowTestPackages` corresponds `-t`, `useSdcard` corresponds `-s`, `replace` corresponds `-r` (`-r` is enabled by default), `partialInstall` corresponds `-p`. | `{grantPermissions: true, partialInstall: true}`
1199
+
1200
+ ### mobile: lock
1201
+
1202
+ Lock the device (and optionally unlock it after a certain amount of time). Only simple (e.g. without a password) locks are supported.
1203
+
1204
+ #### Arguments
1205
+
1206
+ Name | Type | Required | Description | Example
1207
+ --- | --- | --- | --- | ---
1208
+ seconds | number|string | no | The number of seconds after which to unlock the device. Set to `0` or leave it empty to require manual unlock (e.g. do not block and automatically unlock afterwards). | 5
1209
+
1210
+ ### mobile: unlock
1211
+
1212
+ Unlocks the device if it is locked. Noop if the device's screen is not locked.
1213
+
1214
+ #### Arguments
1215
+
1216
+ Name | Type | Required | Description | Example
1217
+ --- | --- | --- | --- | ---
1218
+ key | string | yes | The unlock key. See the documentation on [appium:unlockKey](#device-locking) capability for more details | 12345
1219
+ type | string | yes | The unlock type. See the documentation on [appium:unlockType](#device-locking) capability for more details | password
1220
+ strategy | string | no | Unlock strategy. See the documentation on [appium:unlockStrategy](#device-locking) capability for more details | uiautomator
1221
+ timeoutMs | number | no | Unlock timeout. See the documentation on [appium:unlockSuccessTimeout](#device-locking) capability for more details | 5000
1222
+
1223
+ ### mobile: isLocked
1224
+
1225
+ Determine whether the device is locked.
1226
+
1227
+ #### Returned Result
1228
+
1229
+ Either `true` or `false`
1230
+
1231
+ ### mobile: setGeolocation
1232
+
1233
+ Sets emulated geolocation coordinates on the device under test.
1234
+
1235
+ #### Arguments
1236
+
1237
+ Name | Type | Required | Description | Example
1238
+ --- | --- | --- | --- | ---
1239
+ latitude | number | yes | [Latitude](https://en.wikipedia.org/wiki/Latitude) value | 32.456
1240
+ longitude | number | yes | [longitude](https://en.wikipedia.org/wiki/Longitude) value | 32.456
1241
+ altitude | number | no | [Altitude](https://en.wikipedia.org/wiki/Altitude) value. Zero by default | 5.678
1242
+ satellites | number | no | Number of satellites being tracked (1-12). Available for emulators. | 2
1243
+ speed | number | no | [Set the speed](https://developer.android.com/reference/android/location/Location#setSpeed(float)) in meters per second. Valid value is `0.0` or greater. | 30.0
1244
+ bearing | number | no | [Set the bearing](https://developer.android.com/reference/android/location/Location#setBearing(float)) at the time of this location, in degrees. Available for real devices. Valid values should be in range `[0, 360)`. | 10
1245
+ accuracy | number | no | [Set the horizontal accuracy](https://developer.android.com/reference/android/location/Location#setAccuracy(float)) in meters of this location. Available for real devices. Valid value is `0.0` or greater. | 10.0
1246
+
1247
+ ### mobile: getGeolocation
1248
+
1249
+ Retrieves current geolocation coordinates from the device under test. If coordinates are mocked/emulated
1250
+ then these coordinates would be returned.
1251
+
1252
+ #### Returned Result
1253
+
1254
+ A map with the following entries:
1255
+
1256
+ Name | Type | Description | Example
1257
+ --- | --- | --- | ---
1258
+ latitude | number | [Latitude](https://en.wikipedia.org/wiki/Latitude) value | 32.456
1259
+ longitude | number | [longitude](https://en.wikipedia.org/wiki/Longitude) value | 32.456
1260
+ altitude | number | [Altitude](https://en.wikipedia.org/wiki/Altitude) value | 5.678
1261
+
1262
+ ### mobile: resetGeolocation
1263
+
1264
+ Resets mocked geolocation provider to the default/system one. Only works for real devices.
1265
+
1266
+ ### mobile: refreshGpsCache
1267
+
1268
+ Sends a request to refresh the GPS cache on the device under test.
1269
+ By default the location tracking is configured for
1270
+ [low battery consumption](https://github.com/appium/io.appium.settings/blob/master/app/src/main/java/io/appium/settings/LocationTracker.java),
1271
+ so you might need to call this extension periodically to get the updated geo
1272
+ location if the actual (or mocked) device location is changed too frequently.
1273
+ The feature only works if the device under test has Google Play Services installed.
1274
+ In case the vanilla
1275
+ [LocationManager](https://developer.android.com/reference/android/location/LocationManager)
1276
+ is used the device API level must be at version 30 (Android R) or higher.
1277
+
1278
+ #### Arguments
1279
+
1280
+ Name | Type | Required | Description | Example
1281
+ --- | --- | --- | --- | ---
1282
+ timeoutMs | number | no | The maximum number of milliseconds to block until GPS cache is refreshed. If the API call does not receive a confirmation about successful cache refresh within this timeout then an error is thrown. Providing zero or a negative value to it skips waiting completely and does not check for any errors. 20000 ms by default. | 60000
1283
+
1284
+ ### mobile: startMediaProjectionRecording
1285
+
1286
+ Starts a new recording of the device activity using [Media Projection](https://developer.android.com/reference/android/media/projection/MediaProjection) API. This API is available since Android 10 (API level 29) and allows to record device screen and audio in high quality. Video and audio encoding is done by Android itself.
1287
+ The recording is done by [Appium Settings helper](https://github.com/appium/io.appium.settings#internal-audio--video-recording).
1288
+
1289
+ #### Arguments
1290
+
1291
+ Name | Type | Required | Description | Example
1292
+ --- | --- | --- | --- | ---
1293
+ resolution | string | no | The resolution of the resulting video, which usually equals to Full HD 1920x1080 on most phones, however you could change it to one of the following supported resolutions: "1920x1080", "1280x720", "720x480", "320x240", "176x144" | 1280x720
1294
+ maxDurationSec | number | no | The maximum number of seconds allowed for the recording to run. 900 seconds by default (15 minutes) | 300
1295
+ priority | string | no | Recording thread priority is set to maximum (`high`) by default. However if you face performance drops during testing with recording enabled, you could reduce the recording priority to `normal` or `low`. | low
1296
+ filename | string | no | You can type recording video file name as you want, but recording currently supports only "mp4" format so your filename must end with ".mp4". An invalid file name will fail to start the recording. If not provided then the current timestamp will be used as file name. | screen.mp4
1297
+
1298
+ #### Returned Result
1299
+
1300
+ `true` if a new recording has successfully started. `false` if another recording is currently running.
1301
+
1302
+ ### mobile: isMediaProjectionRecordingRunning
1303
+
1304
+ Check if a media projection recording is currently running
1305
+
1306
+ #### Returned Result
1307
+
1308
+ `true` if a recording is running.
1309
+
1310
+ ### mobile: stopMediaProjectionRecording
1311
+
1312
+ Stops a recording and retrieves the recently recorded media. If no recording has been started before then an error is thrown. If the recording has been already finished before this API has been called then the most recent recorded media is returned.
1313
+
1314
+ #### Arguments
1315
+
1316
+ Name | Type | Required | Description | Example
1317
+ --- | --- | --- | --- | ---
1318
+ remotePath | string | no | The path to the remote location, where the resulting video should be uploaded. The following protocols are supported: http/https, ftp. Null or empty string value (the default setting) means the content of resulting file should be encoded as Base64 and passed as the endpoont response value. An exception will be thrown if the generated media file is too big to fit into the available process memory. | https://myserver.com/upload
1319
+ user | string | no | The name of the user for the remote authentication. | admin
1320
+ pass | string | no | The password for the remote authentication. | pa$$w0rd
1321
+ method | string | no | The http multipart upload method name. The 'PUT' one is used by default. | POST
1322
+ headers | Map&lt;string, string&gt; | no | Additional headers mapping for multipart http(s) uploads | {'Agent': '007'}
1323
+ fileFieldName | string | no | The name of the form field, where the file content BLOB should be stored for http(s) uploads. `file` by default | blob
1324
+ formFields | Map&lt;string, string&gt; or Array&lt;Pair&gt; | no | Additional form fields for multipart http(s) uploads. | {'name': 'yolo.mp4'}
1325
+ uploadTimeout | number | no | The maximum number of milliseconds to wait until the media file is uploaded to the remote location. 240000 ms by default. | 30000
1326
+
1327
+ #### Returned Result
1328
+
1329
+ Base64-encoded content of the recorded media file if `remotePath` argument is falsy or an empty string.
1330
+
1331
+ ### mobile: getConnectivity
1332
+
1333
+ Returns connectivity states for different services
1334
+
1335
+ #### Arguments
1336
+
1337
+ Name | Type | Required | Description | Example
1338
+ --- | --- | --- | --- | ---
1339
+ services | string or string[] | no | One or more services to get the connectivity for. Supported service names are: wifi, data, airplaneMode. If no service names are provided then all supported names are assumed by default. | [wifi, data]
1340
+
1341
+ #### Returned Result
1342
+
1343
+ A map is returned containing the following possible items (depending on which values have been passed to `services` argument):
1344
+
1345
+ Name | Type | Description
1346
+ --- | --- | ---
1347
+ wifi | boolean | True if wifi is enabled
1348
+ data | boolean | True if mobile data connection is enabled
1349
+ airplaneMode | boolean | True if Airplane Mode is enabled
1350
+
1351
+ ### mobile: setConnectivity
1352
+
1353
+ Set the connectivity state for different services. At least one valid service name must be provided in arguments.
1354
+ Missing values tell the driver to not change the corresponding service's state.
1355
+
1356
+ > [!Note]
1357
+ >
1358
+ > Switching Wi-Fi and mobile data states reliably work on emulators for all Android versions.
1359
+ > Real devices support proper state switching only since Android 11.
1360
+
1361
+ > [!Note]
1362
+ >
1363
+ > UiAutomator2 REST server app is running on the device under test and might be terminated/disconnected by Android
1364
+ > thus failing the driver session as a result of using this API. The only way to restore the session would be to quit it
1365
+ > after the network state is changed and then reopen it with `noReset` capability being set to `true` when the connectivity
1366
+ > is restored.
1367
+
1368
+ #### Arguments
1369
+
1370
+ Name | Type | Required | Description | Example
1371
+ --- | --- | --- | --- | ---
1372
+ wifi | booolean | no | Either to enable or disable Wi-Fi. | false
1373
+ data | booolean | no | Either to enable or disable mobile data. | false
1374
+ airplaneMode | booolean | no | Either to enable or disable Airplane Mode. | false
1375
+
1376
+ ### mobile: getAppStrings
1377
+
1378
+ Retrieves string resources for the given app language. An error is thrown if strings cannot be fetched or no strings exist
1379
+ for the given language abbreviation. Available since driver version 2.15.0
1380
+
1381
+ #### Arguments
1382
+
1383
+ Name | Type | Required | Description | Example
1384
+ --- | --- | --- | --- | ---
1385
+ language | string | no | The language abbreviation to fetch app strings mapping for. If no language is provided then strings for the default language on the device under test would be returned | fr
1386
+
1387
+ #### Returned Result
1388
+
1389
+ App strings map, where keys are resource identifiers.
1390
+
1391
+ ### mobile: hideKeyboard
1392
+
1393
+ Tries to hide the on-screen keyboard. Throws an exception if the keyboard cannot be hidden.
1394
+ Does nothing if the keyboard is already hidden.
1395
+
1396
+ #### Returned Result
1397
+
1398
+ `true` if the keyboard was successfully hidden or `false` if it was already invisible.
1399
+
1400
+ ### mobile: isKeyboardShown
1401
+
1402
+ Checks if the system on-screen keyboard is visible.
1403
+
1404
+ #### Returned Result
1405
+
1406
+ `true` if the keyboard is visible
1407
+
1408
+ ### mobile: pressKey
1409
+
1410
+ Emulates single key press on the key with the given code. Available since driver version 2.17.0
1411
+
1412
+ #### Arguments
1413
+
1414
+ Name | Type | Required | Description | Example
1415
+ --- | --- | --- | --- | ---
1416
+ keycode | number | yes | A valid Android key code. See [KeyEvent documentation](https://developer.android.com/reference/android/view/KeyEvent) for the list of available key codes | 0x00000099 (which is KEYCODE_NUMPAD_9)
1417
+ metastate | number | no | An integer in which each bit set to 1 represents a pressed meta key. See [KeyEvent documentation](https://developer.android.com/reference/android/view/KeyEvent) for more details. | 0x00000010 (which is META_ALT_LEFT_ON)
1418
+ flags | number | no | Flags for the particular key event. See [KeyEvent documentation](https://developer.android.com/reference/android/view/KeyEvent) for more details. | 0x00000001 (which is FLAG_WOKE_HERE)
1419
+ isLongPress | boolean | no | Whether to emulate long key press. `false` by default. | true
1420
+ source | number | no | Input device source. One or more [InputDevice.SOURCE_*](https://developer.android.com/reference/android/view/InputDevice) values (e.g. SOURCE_KEYBOARD, SOURCE_DPAD, SOURCE_GAMEPAD). Default is `257` or `0x101`, which maps to SOURCE_KEYBOARD. Multiple values can be combined using the logical OR operator. | 0x00000101 (SOURCE_KEYBOARD), 0x00000101 | 0x00000201 (SOURCE_KEYBOARD or SOURCE_DPAD)
1421
+
1422
+ ### mobile: backgroundApp
1423
+
1424
+ Puts the app to the background and waits the given number of seconds. Then restores the app
1425
+ if necessary. The call is blocking. Available since driver version 2.19.0
1426
+
1427
+ #### Arguments
1428
+
1429
+ Name | Type | Required | Description | Example
1430
+ --- | --- | --- | --- | ---
1431
+ seconds | number | no | The amount of seconds to wait between putting the app to background and restoring it. Any negative value means to not restore the app after putting it to background (the default behavior). | 5
1432
+
1433
+ ### mobile: getCurrentActivity
1434
+
1435
+ Returns the name of the currently focused app activity. Available since driver version 2.20
1436
+
1437
+ #### Returned Result
1438
+
1439
+ The activity class name. Could be `null`
1440
+
1441
+ ### mobile: getCurrentPackage
1442
+
1443
+ Returns the name of the currently focused app package identifier. Available since driver version 2.20
1444
+
1445
+ #### Returned Result
1446
+
1447
+ The package class name. Could be `null`
1448
+
1449
+ ### mobile: getDisplayDensity
1450
+
1451
+ Returns the display density value measured in DPI. Available since driver version 2.21
1452
+
1453
+ #### Returned Result
1454
+
1455
+ The actual DPI value as integer number
1456
+
1457
+ ### mobile: getSystemBars
1458
+
1459
+ Returns properties of various system bars. Available since driver version 2.21
1460
+
1461
+ #### Returned Result
1462
+
1463
+ A dictionary whose entries are:
1464
+ - `statusBar`
1465
+ - `navigationBar`
1466
+
1467
+ Values are dictionaries with the following properties:
1468
+ - `visible`: Whether the bar is visible (equals to `false` if the bar is not present in the system info output)
1469
+ - `x`: Bar x coordinate (might be zero if the bar is not present in the system info output)
1470
+ - `y`: Bar y coordinate (might be zero if the bar is not present in the system info output)
1471
+ - `width`: Bar width (might be zero if the bar is not present in the system info output)
1472
+ - `height`: Bar height (might be zero if the bar is not present in the system info output)
1473
+
1474
+ ### mobile: fingerprint
1475
+
1476
+ Emulate [fingerprint](https://learn.microsoft.com/en-us/xamarin/android/platform/fingerprint-authentication/enrolling-fingerprint) on Android Emulator. Only works on API 23+. Available since driver version 2.22
1477
+
1478
+ #### Arguments
1479
+
1480
+ Name | Type | Required | Description | Example
1481
+ --- | --- | --- | --- | ---
1482
+ fingerprintId | number | yes | The value is the id for the finger that was "scanned". It is a unique integer that you assign for each virtual fingerprint. When the app is running you can run this same command each time the emulator prompts you for a fingerprint, you can run the adb command and pass it the fingerprintId to simulate the fingerprint scan. | 1
1483
+
1484
+ ### mobile: sendSms
1485
+
1486
+ Emulate sending an SMS to the given phone number. Only works on emulators. Available since driver version 2.22
1487
+
1488
+ #### Arguments
1489
+
1490
+ Name | Type | Required | Description | Example
1491
+ --- | --- | --- | --- | ---
1492
+ phoneNumber | string | yes | The phone number to send SMS to | 0123456789
1493
+ message | string | yes | The SMS message payload | Hello
1494
+
1495
+ ### mobile: gsmCall
1496
+
1497
+ Emulate a GSM call to the given phone number. Only works on emulators. Available since driver version 2.22
1498
+
1499
+ #### Arguments
1500
+
1501
+ Name | Type | Required | Description | Example
1502
+ --- | --- | --- | --- | ---
1503
+ phoneNumber | string | yes | The phone number to call to | 0123456789
1504
+ action | call or accept or cancel or hold | yes | One of possible actions to take | accept
1505
+
1506
+ ### mobile: gsmSignal
1507
+
1508
+ Emulate GSM signal strength change event. Only works on emulators. Available since driver version 2.22
1509
+
1510
+ #### Arguments
1511
+
1512
+ Name | Type | Required | Description | Example
1513
+ --- | --- | --- | --- | ---
1514
+ strength | 0 or 1 or 2 or 3 or 4 | yes | One of possible signal strength values, where 4 is the best signal. | 3
1515
+
1516
+ ### mobile: gsmVoice
1517
+
1518
+ Emulate GSM voice state change event. Only works on emulators. Available since driver version 2.22
1519
+
1520
+ #### Arguments
1521
+
1522
+ Name | Type | Required | Description | Example
1523
+ --- | --- | --- | --- | ---
1524
+ state | on or off or denied or searching or roaming or home or unregistered | yes | Voice state | off
1525
+
1526
+ ### mobile: powerAC
1527
+
1528
+ Emulate AC power state change. Only works on emulators. Available since driver version 2.22
1529
+
1530
+ #### Arguments
1531
+
1532
+ Name | Type | Required | Description | Example
1533
+ --- | --- | --- | --- | ---
1534
+ state | on or off | yes | AC Power state | off
1535
+
1536
+ ### mobile: powerCapacity
1537
+
1538
+ Emulate power capacity change. Only works on emulators. Available since driver version 2.22
1539
+
1540
+ #### Arguments
1541
+
1542
+ Name | Type | Required | Description | Example
1543
+ --- | --- | --- | --- | ---
1544
+ percent | 0 to 100 | yes | Percentage value in range [0, 100] | 50
1545
+
1546
+ ### mobile: networkSpeed
1547
+
1548
+ Emulate different network connection speed modes. Only works on emulators. Available since driver version 2.22
1549
+
1550
+ #### Arguments
1551
+
1552
+ Name | Type | Required | Description | Example
1553
+ --- | --- | --- | --- | ---
1554
+ speed | gsm or scsd or gprs or edge or umts or hsdpa or lte or evdo or full | yes | Mobile network speed mode name | edge
1555
+
1556
+ ### mobile: replaceElementValue
1557
+
1558
+ Sends a text to the given element by replacing its previous content. Available since driver version 2.22
1559
+
1560
+ #### Arguments
1561
+
1562
+ Name | Type | Required | Description | Example
1563
+ --- | --- | --- | --- | ---
1564
+ elementId | string | yes | Hexadecimal identifier of the destination text input | 123456-3456-3435-3453453
1565
+ text | string | yes | The text to enter. It could also contain Unicode characters. If the text ends with `\\n` (the backslash must be escaped, so the char is NOT translated into `0x0A`) then the Enter key press is going to be emulated after it is entered (the `\\n` substring itself will be cut off from the typed text). | yolo
1566
+
1567
+ ### mobile: toggleGps
1568
+
1569
+ Switches GPS setting state. This API only works reliably since Android 12 (API 31). Available since driver version 2.23
1570
+
1571
+ ### mobile: isGpsEnabled
1572
+
1573
+ Returns `true` if GPS is enabled on the device under test. Available since driver version 2.23
1574
+
1575
+ ### mobile: getPerformanceDataTypes
1576
+
1577
+ Fetches the list of supported performance data types that could be used as `dataType` argument value to [mobile: getPerformanceData](#mobile-getperformancedata) extension. Available since driver version 2.24
1578
+
1579
+ #### Returned Result
1580
+
1581
+ List of strings, where each item is data type name.
1582
+
1583
+ ### mobile: getClipboard
1584
+
1585
+ Retrieves the plaintext content of the device's clipboard. Available since driver version 3.7
1586
+
1587
+ #### Returned Result
1588
+
1589
+ Base64-encoded content of the clipboard or an empty string if the clipboard is empty.
1590
+
1591
+ ### mobile: setClipboard
1592
+
1593
+ Allows to set the plain text content of the device's clipboard. Available since driver version 3.7
1594
+
1595
+ #### Arguments
1596
+
1597
+ Name | Type | Required | Description | Example
1598
+ --- | --- | --- | --- | ---
1599
+ content | string | yes | Base64-encoded clipboard payload. | YXBwaXVt
1600
+ contentType | string | no | The only supported and the default value is `plaintext` | plaintext
1601
+ lable | string | no | Optinal label to identify the current clipboard payload. | yolo
1602
+
1603
+ ### mobile: getPerformanceData
1604
+
1605
+ Retrieves performance data about the given Android subsystem. The data is parsed from the output of the dumpsys utility. Available since driver version 2.24
1606
+
1607
+ #### Arguments
1608
+
1609
+ Name | Type | Required | Description | Example
1610
+ --- | --- | --- | --- | ---
1611
+ packageName | string | yes | The name of the package identifier to fetch the data for | com.myapp
1612
+ dataType | string | yes | One of supported subsystem names. The full list of supported values is returned by [mobile: getPerformanceDataTypes](#mobile-getperformancedatatypes) extension. | batteryinfo or cpuinfo or memoryinfo or networkinfo
1613
+
1614
+ #### Returned Result
1615
+
1616
+ The output depends on the selected subsystem. It is organized into a table, where the first row represents column names and the following rows represent the sampled data for each column.
1617
+ Example output for different data types:
1618
+
1619
+ - batteryinfo:
1620
+ ```
1621
+ [
1622
+ [power],
1623
+ [23]
1624
+ ]
1625
+ ```
1626
+ - memoryinfo:
1627
+ ```
1628
+ [
1629
+ [totalPrivateDirty, nativePrivateDirty, dalvikPrivateDirty, eglPrivateDirty, glPrivateDirty, totalPss, nativePss, dalvikPss, eglPss, glPss, nativeHeapAllocatedSize, nativeHeapSize],
1630
+ [18360, 8296, 6132, null, null, 42588, 8406, 7024, null, null, 26519, 10344]
1631
+ ]
1632
+ ```
1633
+ - networkinfo:
1634
+ ```
1635
+ // emulator
1636
+ [
1637
+ [bucketStart, activeTime, rxBytes, rxPackets, txBytes, txPackets, operations, bucketDuration],
1638
+ [1478091600000, null, 1099075, 610947, 928, 114362, 769, 0, 3600000],
1639
+ [1478095200000, null, 1306300, 405997, 509, 46359, 370, 0, 3600000]
1640
+ ]
1641
+ // real devices
1642
+ [
1643
+ [st, activeTime, rb, rp, tb, tp, op, bucketDuration],
1644
+ [1478088000, null, null, 32115296, 34291, 2956805, 25705, 0, 3600],
1645
+ [1478091600, null, null, 2714683, 11821, 1420564, 12650, 0, 3600],
1646
+ [1478095200, null, null, 10079213, 19962, 2487705, 20015, 0, 3600],
1647
+ [1478098800, null, null, 4444433, 10227, 1430356, 10493, 0, 3600]
1648
+ ]
1649
+ ```
1650
+ - cpuinfo:
1651
+ ```
1652
+ [
1653
+ [user, kernel],
1654
+ [0.9, 1.3]
1655
+ ]
1656
+ ```
1657
+
1658
+ ### mobile: statusBar
1659
+
1660
+ Performs commands on the system status bar. A thin wrapper over `adb shell cmd statusbar` CLI. Works on Android 8 (Oreo) and newer. Available since driver version 2.25
1661
+
1662
+ #### Arguments
1663
+
1664
+ Name | Type | Required | Description | Example
1665
+ --- | --- | --- | --- | ---
1666
+ command | string | yes | One of [supported status bar commands](#status-bar-commands). | expandNotifications
1667
+ component | string | no | The name of the tile component. It is only required for (add\|remove\|click)Tile commands. | com.package.name/.service.QuickSettingsTileComponent
1668
+
1669
+ #### Status Bar Commands
1670
+
1671
+ - expandNotifications: Open the notifications panel.
1672
+ - expandSettings: Open the notifications panel and expand quick settings if present.
1673
+ - collapse: Collapse the notifications and settings panel.
1674
+ - addTile: Add a TileService of the specified component.
1675
+ - removeTile: Remove a TileService of the specified component.
1676
+ - clickTile: Click on a TileService of the specified component.
1677
+ - getStatusIcons: Returns the list of status bar icons and the order they appear in. Each list item is separated with a new line character.
1678
+
1679
+ #### Returned Result
1680
+
1681
+ The actual downstream command output. It depends on the selected command and might be empty.
1682
+
1683
+ ### mobile: scheduleAction
1684
+ ### mobile: unscheduleAction
1685
+ ### mobile: getActionHistory
1686
+
1687
+ These extensions allow to deal with short-living UI elements. Read [the documentation on Scheduled Actions](docs/scheduled-actions.md) for more details and code examples.
1688
+
1689
+ ### mobile: screenshots
1690
+
1691
+ Retrieves a screenshot of each display available to Android.
1692
+ This functionality is only supported since Android 10.
1693
+
1694
+ **Important:** This method uses **physical or virtual display IDs**, which are different from logical display IDs used by the `currentDisplayId` setting. Display IDs can be obtained from:
1695
+ - The `physicalId` or `virtualId` field returned by [`mobile: listDisplays`](#mobile-listdisplays) (recommended)
1696
+ - The `physicalDisplayId` or `virtualDisplayId` field returned by [`mobile: listWindows`](#mobile-listwindows)
1697
+ - The `adb shell dumpsys SurfaceFlinger --display-id` command output
1698
+
1699
+ **Note:** For physical displays, use the `physicalId` from `mobile: listDisplays` or `physicalDisplayId` from `mobile: listWindows`. For virtual displays, use the `virtualId` from `mobile: listDisplays` or `virtualDisplayId` from `mobile: listWindows`.
1700
+
1701
+ #### Arguments
1702
+
1703
+ Name | Type | Required | Description | Example
1704
+ --- | --- | --- | --- | ---
1705
+ displayId | number or string | no | **Physical or virtual display identifier** to take a screenshot for. If not provided then screenshots of all displays are going to be returned. If no matches were found then an error is thrown. **Note:** This is a physical or virtual display ID, not a logical display ID. Use `mobile: listDisplays` to get the correct `physicalId` (for physical displays) or `virtualId` (for virtual displays) value. | 1234567890
1706
+
1707
+ #### Returns
1708
+
1709
+ A dictionary where each key is the physical or virtual display identifier (as a string) and the value has the following keys:
1710
+ - `id`: The physical or virtual display identifier (same as the key)
1711
+ - `name`: Display name
1712
+ - `isDefault`: Whether this display is the default one
1713
+ - `payload`: The actual PNG screenshot data encoded to base64 string
1714
+
1715
+ ### mobile: setUiMode
1716
+
1717
+ Set the device UI appearance. A thin wrapper over `adb shell cmd uimode` CLI.
1718
+ Works on Android 10 and newer. Available since driver version 2.34
1719
+
1720
+ #### Arguments
1721
+
1722
+ Name | Type | Required | Description | Example
1723
+ --- | --- | --- | --- | ---
1724
+ mode | string | yes | One of the supported UI mode names: `night` or `car`. | night
1725
+ value | string | yes | The actual mode value to set. Supported values for different UI modes are: `night`: yes,no,auto,custom_schedule,custom_bedtime, `car`: yes,no. For example, to switch the device UI to the dark mode you should set `mode` to `night` and `value` to `yes`, or to `no` in order to switch back to the light mode. | yes
1726
+
1727
+ ### mobile: getUiMode
1728
+
1729
+ Gets the device UI appearance for the given mode. A thin wrapper over `adb shell cmd uimode` CLI. Works on Android 10 and newer. Available since driver version 2.34
1730
+
1731
+ #### Arguments
1732
+
1733
+ Name | Type | Required | Description | Example
1734
+ --- | --- | --- | --- | ---
1735
+ mode | string | yes | One of the supported UI mode names: `night` or `car`. | night
1736
+
1737
+ #### Returned Result
1738
+
1739
+ The actual mode value. Supported values for different UI modes are:
1740
+
1741
+ - `night`: yes,no,auto,custom_schedule,custom_bedtime
1742
+ - `car`: yes,no
1743
+
1744
+ ### mobile: sendTrimMemory
1745
+
1746
+ Simulates the [onTrimMemory()](https://developer.android.com/reference/android/content/ComponentCallbacks2#onTrimMemory(int)) event for the given package, which allows to verify the app functinality under different RAM-related circumstances.
1747
+ Read [Manage your app's memory](https://developer.android.com/topic/performance/memory) for more details.
1748
+ Available since driver version 2.41
1749
+
1750
+ #### Arguments
1751
+
1752
+ Name | Type | Required | Description | Example
1753
+ --- | --- | --- | --- | ---
1754
+ pkg | string | yes | The package name to send the `trimMemory` event to. | com.my.company
1755
+ level | 'COMPLETE' or 'MODERATE' or 'BACKGROUND' or 'UI_HIDDEN' or 'RUNNING_CRITICAL' or 'RUNNING_LOW' or 'RUNNING_MODERATE' | yes | The actual memory trim level to simulate | RUNNING_CRITICAL
1756
+
1757
+ ### mobile: injectEmulatorCameraImage
1758
+
1759
+ Simulates an image injection into the VirtualScene emulator camera background.
1760
+ Calls to this extension should seamlessly change the foreground picture
1761
+ in the VirtualScene emulator camera view to the supplied one.
1762
+ This extension could, for example, be useful if you need to verify QR codes scanning
1763
+ by the application under test.
1764
+ Available since driver version 3.2.0
1765
+
1766
+ #### Arguments
1767
+
1768
+ Name | Type | Required | Description | Example
1769
+ --- | --- | --- | --- | ---
1770
+ payload | string | yes | A valid base64-encoded .PNG image payload. Other image formats are not supported. This image will be shown on the virtual scene foreground as soon as you open a camera client app. | iVBORw0KGgoAAAANSUh...
1771
+
1772
+ #### Required Preconditions
1773
+
1774
+ This feature only works on Android emulators.
1775
+ It is mandatory to provide a value (it could also be an empty map to use defaults) to
1776
+ the [appium:injectedImageProperties capability](#emulator-android-virtual-device)
1777
+ in order to prepare the emulator for image injection if this extension is used
1778
+ on a newly created or resetted device.
1779
+
1780
+ There is also a possiblity to perform a manual configuration of the necessary preconditions
1781
+ if you don't want to restart the emulator on session startup. For that replace the content
1782
+ of the `Toren1BD.posters` file located in `$ANDROID_HOME/emulator/resources` folder with the
1783
+ following text:
1784
+
1785
+ ```
1786
+ poster wall
1787
+ size 2 2
1788
+ position -0.807 0.320 5.316
1789
+ rotation 0 -150 0
1790
+ default poster.png
1791
+
1792
+ poster table
1793
+ size 1 1
1794
+ position 0 0 -1.5
1795
+ rotation 0 0 0
1796
+ ```
1797
+
1798
+ Save the changed file and re(start) the emulator to pick up the changes.
1799
+ You may also customize values for different image properties under `poster table` in the above
1800
+ text snippet.
1801
+
1802
+ ### mobile: bluetooth
1803
+
1804
+ Allows to control the bluetooth adapter in the device under test.
1805
+ An error is thrown if the device has no default bluetooth adapter.
1806
+ Available since driver version 3.4.0
1807
+
1808
+ #### Arguments
1809
+
1810
+ Name | Type | Required | Description | Example
1811
+ --- | --- | --- | --- | ---
1812
+ action | string | yes | The action to execute on the bluetooth adapter. The following actions are supported: `enable`, `disable`, `unpairAll`. Calling the same action more than once is a noop. | disable
1813
+
1814
+ ### mobile: nfc
1815
+
1816
+ Allows to control the NFC adapter in the device under test.
1817
+ An error is thrown if the device has no default NFC adapter.
1818
+ Available since driver version 3.4.0
1819
+
1820
+ #### Arguments
1821
+
1822
+ Name | Type | Required | Description | Example
1823
+ --- | --- | --- | --- | ---
1824
+ action | string | yes | The action to execute on the NFC adapter. The following actions are supported: `enable`, `disable`. Calling the same action more than once is a noop. | disable
1825
+
1826
+ ### mobile: setStylusHandwriting
1827
+
1828
+ Allows to control the stylus handwriting feature on the device under test. Available since driver version 7.1.0.
1829
+ This extension requires the `uiautomation2:set_stylus_handwriting` server command line feature to be enabled.
1830
+
1831
+ Disabling the stylus handwriting will help to prevent blocking text input by the demo view.
1832
+ See [this ticket](https://github.com/appium/appium-uiautomator2-driver/issues/909) for more details.
1833
+
1834
+ #### Arguments
1835
+
1836
+ Name | Type | Required | Description | Example
1837
+ --- | --- | --- | --- | ---
1838
+ enabled | boolean | yes | Whether to enable or disable the stylus handwriting feature. | true
1839
+
1840
+ ## Applications Management
1841
+
1842
+ UiAutomator2 driver supports Appium endpoints for applications management:
1843
+ - Check if app is installed ([mobile: isAppInstalled](#mobile-isappinstalled))
1844
+ - Lists all installed packages ([mobile: listApps](#mobile-listapps))
1845
+ - Install/upgrade app ([mobile: installApp](#mobile-installapp))
1846
+ - Activate app ([mobile: activateApp](#mobile-activateapp))
1847
+ - Since UIAutomator2 driver v2.2.0, the server calls `am start`/`am start-activity` to start the application on devices with API level 24+. [monkey](https://developer.android.com/studio/test/other-testing-tools/monkey) tool is called on devices below API level 24.
1848
+ - UIAutomator2 driver v2.1.2 and lower versions call the `monkey` tool on all devices.
1849
+ - The `monkey` tool [turns on auto rotation](https://stackoverflow.com/questions/56684778/adb-shell-monkey-command-changing-device-orientation-lock), so please consider using [mobile: startActivity](#mobile-startactivity) if you would like to keep your current rotation preferences.
1850
+ - Uninstall app ([mobile: removeApp](#mobile-removeapp))
1851
+ - Terminate app ([mobile: terminateApp](#mobile-terminateapp))
1852
+ - Start app activity ([mobile: startActivity](#mobile-startactivity))
1853
+ - Query the current app state ([mobile: queryAppState](#mobile-queryappstate))
1854
+ - Background app ([mobile: backgroundApp](#mobile-backgroundapp))
1855
+
1856
+ Refer to the corresponding Appium client tutorial to find out the names of the corresponding wrappers for these APIs.
1857
+
1858
+ Useful links:
1859
+ - https://appiumpro.com/editions/9-testing-android-app-upgrades
1860
+ - https://github.com/appium/python-client/blob/master/appium/webdriver/extensions/applications.py
1861
+ - https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/InteractsWithApps.java
1862
+
1863
+
1864
+ ## Files Management
1865
+
1866
+ UiAutomator2 driver supports Appium endpoints for files management:
1867
+ - Push file ([mobile: pushFile](#mobile-pushfile))
1868
+ - Pull file ([mobile: pullFile](#mobile-pullfile))
1869
+ - Pull folder ([mobile: pullFolder](#mobile-pullfolder))
1870
+
1871
+ Refer to the corresponding Appium client tutorial to find out the names of the corresponding wrappers for these APIs.
1872
+
1873
+ Useful links:
1874
+ - https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/PushesFiles.java
1875
+ - https://github.com/appium/python-client/blob/master/appium/webdriver/extensions/remote_fs.py
1876
+
1877
+
1878
+ ## Clipboard Management
1879
+
1880
+ UiAutomator2 driver supports Appium endpoints for clipboard management:
1881
+ - Set clipboard content (`POST /appium/device/set_clipboard'`)
1882
+ - Get clipboard content (`POST /appium/device/get_clipboard`)
1883
+ - [mobile: getClipboard](#mobile-getclipboard)
1884
+ - [mobile: setClipboard](#mobile-setclipboard)
1885
+
1886
+ Useful links:
1887
+ - https://github.com/appium/python-client/blob/master/appium/webdriver/extensions/clipboard.py
1888
+ - https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/clipboard/HasClipboard.java
1889
+ - https://appiumpro.com/editions/16-automating-the-clipboard-on-ios-and-android
1890
+
1891
+
1892
+ ## Hybrid Mode
1893
+
1894
+ UIA2 driver supports automation of web pages opened in mobile Chrome or Chromium, and
1895
+ hybrid apps that use Chrome-based web views, by managing a
1896
+ [Chromedriver](https://sites.google.com/a/chromium.org/chromedriver/) instance and
1897
+ proxying commands to it when necessary.
1898
+
1899
+ The following endpoints are used to control the current context:
1900
+
1901
+ - POST `/session/:sessionId/context`: To set the current context. The body contains a single mandatory `name` parameter, which has the name of the context to be set. The name of the default context is `NATIVE_APP`.
1902
+ - GET `/session/:sessionId/context`: To retrieve the name of the current context
1903
+ - GET `/session/:sessionId/contexts`: To retrieve the list of available context names
1904
+ - [mobile: getContexts](#mobile-getcontexts)
1905
+ - [mobile: getChromeCapabilities](#mobile-getchromecapabilities)
1906
+
1907
+ By default, the driver starts in the native context, which means that most of REST API commands are being
1908
+ forwarded to the downstream [appium-uiautomator2-server](https://github.com/appium/appium-uiautomator2-server).
1909
+ This server is running on the device under test, and trasforms API commands to appropriate low-level UiAutomator framework calls. There is always only one native context, although multiple web contexts are possible.
1910
+ Each web context could contain zero or more pages/windows. It is possible to start UIA2 driver session in web context by default by setting the `browserName` capability value or by enabling the `appium:autoWebview` capability.
1911
+
1912
+ Web context(s) could be detected if a browser or a web view is active on the device. If a context is switched to
1913
+ a web one then UIA2 driver spins up a Chromedriver instance for it and forwards most of the commands
1914
+ to that Chromedriver instance. Note that web views must be properly configured and
1915
+ debuggable in order to connect to them or get their names in the list of available contexts.
1916
+ The availability of a particular web view could be easily verified by using
1917
+ [Chrome Remote Debugger](https://developer.chrome.com/docs/devtools/remote-debugging/).
1918
+ You could switch between different contexts (and windows in them) at any time during the session.
1919
+
1920
+ The [appium-chromedriver](https://github.com/appium/appium-chromedriver) package bundled with UIA2 always
1921
+ tries to download the most recent version of Chromedriver known to it. Google requires that the used Chromedriver version must always match to the version of the browser or a web view engine being automated. If these versions do not match then Chromedriver fails its creation, and context switch API shows a failure message
1922
+ similar to:
1923
+
1924
+ ```
1925
+ An unknown server-side error occurred while processing the command.
1926
+ Original error: unknown error: Chrome version must be >= 55.0.2883.0
1927
+ ```
1928
+
1929
+ To work around this issue it is necessary to provide UIA2 driver with a proper Chromedriver binary
1930
+ that matches to the Chrome engine version running on the device under test.
1931
+ Read the [Chromedriver/Chrome compatibility](#chromedriverchrome-compatibility) topic below to
1932
+ know more about finding a matching Chromedriver executable.
1933
+
1934
+ There are several ways to provide a customized Chromedriver to UIA2 driver:
1935
+
1936
+ #### When installing the driver
1937
+
1938
+ _Note_: This only works for driver versions below 3.8.0
1939
+
1940
+ Specify the Chromedriver version in the `CHROMEDRIVER_VERSION` environment variable:
1941
+
1942
+ ```bash
1943
+ CHROMEDRIVER_VERSION=2.20 appium install driver uiautomator2
1944
+ ```
1945
+
1946
+ #### When starting a session (manual discovery)
1947
+
1948
+ Chromedriver version can be specified in session capabilities, by providing the
1949
+ `appium:chromedriverExecutable` [capability](#web-context),
1950
+ containing the full path to a matching Chromedriver executable, which must be manually
1951
+ downloaded and put to the server file system.
1952
+
1953
+ #### When starting a session (automated discovery)
1954
+
1955
+ UIA2 driver could also try to detect the version of the target Chrome engine and
1956
+ download matching chromedriver for it automatically if it does not exist on the local file system.
1957
+ Read the [Automatic discovery of compatible Chromedriver](#automatic-discovery-of-compatible-chromedriver)
1958
+ topic below for more details.
1959
+
1960
+ ### Chromedriver/Chrome Compatibility
1961
+
1962
+ Since version *2.46* Google has changed their rules for Chromedriver versioning, so now the major Chromedriver version corresponds to the major web view/browser version, that it can automate. Follow the [Version Selection](https://chromedriver.chromium.org/downloads/version-selection) document in order to manually find the Chromedriver, that supports your current browser/web view if its major version is equal or above *73*.
1963
+
1964
+ To find the minimum supported browsers for older Chromedriver versions (below *73*), get the
1965
+ [Chromium](https://www.chromium.org/Home)
1966
+ [source code](https://chromium.googlesource.com/chromium/src/+/master/docs/get_the_code.md),
1967
+ check out the release commit, and check the variable `kMinimumSupportedChromeVersion`
1968
+ in the file `src/chrome/test/chromedriver/chrome/version.cc`. (To find the
1969
+ release commits, you could use `git log --pretty=format:'%h | %s%d' | grep -i "Release Chromedriver version"`.)
1970
+
1971
+ The complete list of available Chromedriver releases and release notes is located at [Chromedriver Storage](https://chromedriver.storage.googleapis.com/index.html).
1972
+
1973
+ The list of Chromedriver versions and their matching minimum
1974
+ Chrome versions known to appium-chromedriver package is stored at
1975
+ https://raw.githubusercontent.com/appium/appium-chromedriver/master/config/mapping.json
1976
+
1977
+ ### Automatic Discovery of Compatible Chromedriver
1978
+
1979
+ UIA2 driver is able to pick the correct Chromedriver for the
1980
+ version of Chrome/web view under test. While appium-chromedriver only comes bundled with the Chromedriver
1981
+ most recently released at the time of the corresponding package version's release, more Chromedriver
1982
+ versions could be downloaded and placed into a custom location indicated to UIA2 driver via the `appium:chromedriverExecutableDir` [capability](#web-context).
1983
+
1984
+ A custom mapping of Chromedrivers to the minimum
1985
+ Chrome/web view version they support could be given to UIA2 driver through the
1986
+ `appium:chromedriverChromeMappingFile` [capability](#web-context). This should be the
1987
+ absolute path to a file with the mapping
1988
+ in it. The contents of the file needs to be parsable as a JSON object, like:
1989
+
1990
+ ```json
1991
+ {
1992
+ "2.42": "63.0.3239",
1993
+ "2.41": "62.0.3202"
1994
+ }
1995
+ ```
1996
+
1997
+ There is a possibility to automatically download the necessary chromedriver(s) into `appium:chromedriverExecutableDir` from the official Google storage. The script will automatically search for the newest chromedriver version that supports the given browser/web view, download it (the hash sum is verified as well for the downloaded archive) and add to the `appium:chromedriverChromeMappingFile` mapping. Everything, which is needed to be done from your side is to execute the server with `uiautomator2:chromedriver_autodownload` feature enabled (like `appium server --allow-insecure uiautomator2:chromedriver_autodownload`).
1998
+
1999
+ ### Troubleshooting Chromedriver Download Issues
2000
+
2001
+ Check the [Custom binaries url](https://github.com/appium/appium-chromedriver?tab=readme-ov-file#custom-binaries-url)
2002
+ section of appium-chromedriver README for more details on how to customize the download CDN.
2003
+
2004
+ It may also be necessary to adjust network proxy and firewall settings for the above to work.
2005
+
2006
+ If you use a UIA2 driver below version 3.8.0, and you
2007
+ would like skip the automated download of Chromedriver upon driver install, do it by
2008
+ defining the `APPIUM_SKIP_CHROMEDRIVER_INSTALL` environment variable:
2009
+
2010
+ ```bash
2011
+ APPIUM_SKIP_CHROMEDRIVER_INSTALL=1 appium driver install uiautomator2
2012
+ ```
2013
+
2014
+ ### W3C Support in Web Context
2015
+
2016
+ Chromedriver did not follow the W3C standard until version 75. If you encounter proxy command error like [this issue](https://github.com/appium/python-client/issues/234), please update your Chromedriver version.
2017
+ Old Android devices can't use newer Chromedriver versions. You could avoid the error if you enforce
2018
+ Mobile JSON Wire Protocol for Chromedriver. This could be done by providing `{'w3c': False}` item
2019
+ to `appium:chromeOptions` capability value.
2020
+ Since major version *75* W3C mode is the default one for Chromedriver, although it could be still switched to JSONWP one as described above (keep in mind that eventually Chromedriver will drop the support of
2021
+ JSON Wire protocol completely).
2022
+ The history of W3C support in Chromedriver is available for reading at
2023
+ [downloads section](https://sites.google.com/a/chromium.org/chromedriver/downloads).
2024
+
2025
+
2026
+ ## Troubleshooting
2027
+
2028
+ ### Activity Startup
2029
+
2030
+ If you experience issues with application activities being not found or not starting then consider checking [How To Troubleshoot Activities Startup](docs/activity-startup.md) article.
2031
+
2032
+ ### Poor Elements Interaction Performance
2033
+
2034
+ If you observe automated tests need at least 10 seconds or more to locate/interact with a single element then consider changing the default value for [waitForIdleTimeout setting](#settings-api). By default, UiAutomator framework (and all other Accessibility-based frameworks) always waits for the accessibility event stream to become idle before interacting with it (the default timeout there is 10000ms). This is needed to make sure all animations/transitions are finished before you, for example, interact with an element by clicking it. In case the application under test constantly runs some background animations or hogs the accessibility event stream in some other way these waits may significantly slow down the automation flow.
2035
+
2036
+ Setting the value of `waitForIdleTimeout` to zero `0` ms should completely disable any waits, and enforce interactions to happen immediately ignoring the accessibility event stream state. The downside of that would be that all interactions are never going to be delayed, so clicks and other actions might happen at wrong places of the application UI. That is why is it important to check the app under test first and fix its source to get rid of activities hogging the event loop. Sometimes it makes sence to disable animations completely for the app build under test, which could speed up your flows significantly in some situations.
2037
+
2038
+ > [!Warning]
2039
+ > `waitForIdleTimeout` is a setting, not a capability.
2040
+
2041
+ ### Session Startup Issues
2042
+
2043
+ Sometimes various legacy driver parts might be cached on the device under test (like settings.apk), which would prevent a new/upgraded driver version from starting a session. Run
2044
+
2045
+ ```bash
2046
+ appium driver run uiautomator2 reset
2047
+ ```
2048
+
2049
+ in order to cleanup the cached UIA2 driver binaries from all connected devices on the current machine.
2050
+
2051
+ ### Socket Hangup Error
2052
+
2053
+ This type of error means the driver is unable to connect to the UiAutomator2 REST server, which is running on the device under test. There might be multiple causes to this issue:
2054
+ - The automation session gets unexpectedly deleted if your test code sends the `DELETE /session/<id>` request to it, also the corresponding session and the server itself are terminated as a result. Sending further commands to the same server would create the error above because it is not listening anymore and must be newly started by the instrumentation first. Such issues usually happen if the session management is not configured properly in your code, so one starts a new session while an existing one is still running and has not been quit properly, or there is a timeout while waiting for a new command. Fixing session management logic (e.g. make sure each session is being properly created in the test setup section and is terminated in the test teardown) or changing/disabling the commands' timeout (check the [newCommandTimeout capability](#other)) might help to address such type of errors.
2055
+ - The server has been unexpectedly killed by Android OS itself. There might be several reasons to that. Usually fetching the [logcat](https://developer.android.com/studio/command-line/logcat) output and finding occurrences of `io.appium.uiautomator2.server` traces with `error` or `exception` label might help to figure out what happens. Sometimes it is necessary to turn off some internal phone optimizations, sometimes the server crashes because of an internal UiAutomator framework bug, sometimes because of a bug in the server code itself. Each case should be investigated separately if the search over the internet shows no matches…
2056
+ - The connectivity between the phone and the host is unstable. Nothing much to add on this one. Maybe the phone has a defect, or the USB cable is damaged, or the installed Android SDK is out of date…
2057
+
2058
+ ### Element(s) Cannot be Found
2059
+
2060
+ All element location strategies in UIA2 driver work similarly under the hood except of the xpath one.
2061
+ If some element is not found, but you see/assume it is present in the page source then make sure no race condition
2062
+ happens. Add a timer and wait for a couple of seconds before giving up on the element location. In case the lookup
2063
+ still fails after the timeout and your non-xpath locator is used then, most likely, it contains a typo, or the
2064
+ destination element is not present. There is not much that could be done in UIA2 to change/influence that, since it passes such lookup calls directly to Google's UiAutomator framework.
2065
+
2066
+ In case of _xpath_ locators you could try to change values of the following settings:
2067
+
2068
+ 1. [allowInvisibleElements](#settings-api)
2069
+ 2. [ignoreUnimportantViews](#settings-api)
2070
+ 3. [enableMultiWindows](#settings-api)
2071
+ 4. [snapshotMaxDepth](#settings-api)
2072
+ 5. [alwaysTraversableViewClasses](#settings-api) for Jetpack Compose
2073
+
2074
+ By default, the first setting is set to `false`, which hides
2075
+ elements that are not visible from the page source and from the xpath location. Changing the setting value
2076
+ to `true` would add such invisible elements to the page source and make them locatable.
2077
+
2078
+ The second one is enabled by default (e.g. `true`). By disabling it the page source could receive more elements
2079
+ that are normally hidden, because of their unimportance.
2080
+
2081
+ The third setting being set to `true` extends the page source by adding the actual content of other windows that are currently present on the device's screen. For example, the on-screen keyboard in Android is not a part of the current app hierarchy, but rather belongs to a separate window.
2082
+
2083
+ It only makes sense to change the default value of the `snapshotMaxDepth` setting if the application under test
2084
+ has deeply nested elements in the page tree hierarchy (e.g. more than 70 levels), and the destination element
2085
+ is suspected to be a part of these deeply nested views. Increasing the value of this
2086
+ setting will reduce the performance of xPath searches and page tree retrievals, so be careful while assigning too
2087
+ high values to it.
2088
+
2089
+ In case of _id_ locators you could try to change the value of the following setting:
2090
+
2091
+ 1. [disableIdLocatorAutocompletion](#settings-api)
2092
+
2093
+ The general resources naming convention for Android apps is `<app_id>:id/<resource_name>`. This should guarantee uniqueness of each identifier accross the user interface. Although, this is only a convention and it is still allowed to have various resource names that do not follow it. If you have gotten one of such applications for automated testing then consider assigning `disableIdLocatorAutocompletion` setting value to `true`, so UiAutomator2 driver does not automatically rewrite supplied id values by adding `<app_id>:id/` prefixes to them.
2094
+
2095
+ > [!Warning]
2096
+ > Default values for settings above have been selected to optimize xpath lookup and page source generation performance.
2097
+ > Having these settings always different from their default values may sometimes significantly (especially in case of huge accessbility hierarchies) reduce xpath lookup and page source generation speed.
2098
+
2099
+ > [!Warning]
2100
+ > All items above are settings, not capabilities.
2101
+
2102
+ ### ClassCastException: java.util.ArrayList$ListItr cannot be cast to org.eclipse.wst.xml.xpath2.processor
2103
+
2104
+ This exception was caused by a bug in the [Eclipse's Psychopath](https://wiki.eclipse.org/PsychoPathXPathProcessor) library used by UiAutomator2 driver to support [XPath2](https://www.w3.org/TR/xpath20/) syntax. The issue was observed while using `following::` or `preceding::` axes in xpath queries (for example, `(//android.widget.TextView[@text='some, text']/following::android.widget.ImageButton)[1]`).
2105
+
2106
+ The bug has been fixed in UiAutomator2 driver version `7.5.2+`. Upgrade to use XPath2 `following::` and `preceding::` axes in your element lookup queries.
2107
+
2108
+ If you still encounter this exception on an older driver version, the workaround is to forcefully switch the driver's XPath processor to the standard Android's Apache Harmony-based XPath1, which does not have this issue (but also does not support XPath2 syntax). See the Appium issue [#16142](https://github.com/appium/appium/issues/16142#issuecomment-1003954166) for more details.
2109
+
2110
+ ### A gesture, like scroll or swipe, does not have any effect / It is unclear how to do it
2111
+
2112
+ The UiAutomator2 driver provides multiple options for touch gestures automation.
2113
+ For simple gestures, like swipe, scroll, drag, double click, fling or pinch use the corresponding
2114
+ [gesture shortcuts](#mobile-gesture-commands).
2115
+ You may also use [UiScrollable-based UiAutomator locators](./docs/uiautomator-uiselector.md)
2116
+ to automate various scrolling behaviours.
2117
+ For more sophisticated gestures
2118
+ consider using [W3C actions](https://w3c.github.io/webdriver/#actions).
2119
+
2120
+
2121
+ Make sure you don't use deprecated JWP touch actions APIs. They have been
2122
+ removed from the UIA2 driver since version 3.
2123
+
2124
+ If the action code in the client source looks good and satisfies the above requirements,
2125
+ but its execution still does not deliver the expected result then the following debugging
2126
+ meassures might be applied:
2127
+
2128
+ - Enable `Show taps` and `Pointer location` Developer options in the device Settings. After running
2129
+ your automation code with the above options enabled you would be able to see the exact pointer trace path
2130
+ and check the velocity of the gesture. It also works for multi-touch gestures. Compare the trace
2131
+ to how the same gesture is usually done manually and apply the necessary updates to your code.
2132
+ - Check the device [logcat](https://developer.android.com/studio/debug/logcat) output for possible
2133
+ error messages. Usually a single gesture consists of hundreds of atomic steps. If any of these steps
2134
+ receives incorrect/unsupported parameters then the whole gesture might fail. The log has details
2135
+ about each step being executed and arguments passed to it.
2136
+ - Make sure the gesture has valid coordinates and respects pauses between pointer state changes.
2137
+ For example, it is always mandatory to provide a valid element or valid `absolute` coordinates
2138
+ to any gesture at the beginning. Android only registers
2139
+ a long touch/click if the pointer has been depressed for longer than 500ms. For shorter actions
2140
+ a simple click is registered instead.
2141
+ - Do not mix webview and native elements in actions arguments. It simply won't work. Native
2142
+ actions could only consume native elements. A single possibility to perform a native action
2143
+ on a web element would be to traslate its coordinates into the native context and pass these
2144
+ coordinates as native action arguments.
2145
+
2146
+ Check the below tutorials for more details on how to build reliable action chains:
2147
+
2148
+ - [Automating Complex Gestures with the W3C Actions API](https://appiumpro.com/editions/29-automating-complex-gestures-with-the-w3c-actions-api)
2149
+ - [Swiping your way through Appium by Wim Selles #AppiumConf2021](https://www.youtube.com/watch?v=oAJ7jwMNFVU)
2150
+ - [Low-Level Insights on Android Input Events](./docs/actions.md)
2151
+
2152
+ ### window/tab hanlding in WEBVIEW context implemented by chrome custom tabs
2153
+
2154
+ [Chrome custom tabs](https://developer.chrome.com/docs/android/custom-tabs/) could have its own window handlings as same as regular Selenium Web automation.
2155
+
2156
+ Appium lets you switch the context from `NATIVE_APP` to `WEBVIEW_xyz`, for example, to interact with the WEBVIEW contents over chromedriver. Then, if the WEBVIEW was chrome custom tabs implementation, the WEBVIEW context may require you to switch the window handler properly to interact with contents in a handler.
2157
+ It is worth to try out this idea if `chrome://inspect` or [mobile: getContexts](#mobile-getcontexts) shows you available pages more than availale contexts.
2158
+
2159
+ ```ruby
2160
+ # Ruby
2161
+ # Change the context to WebView (Attach to a chromedriver session)
2162
+ driver.set_context('WEBVIEW_XYZ')
2163
+
2164
+ # Get available tabs/windows in the chrome instance
2165
+ driver.window_handles
2166
+
2167
+ # Change the tab/window in the "chrome" instance
2168
+ driver.switch_to.window('a window_handle name')
2169
+
2170
+ # interact with the tab/window
2171
+ ```
2172
+
2173
+ ## Usage Examples
2174
+
2175
+ ```python
2176
+ # Python3 + PyTest
2177
+ import pytest
2178
+
2179
+ from appium import webdriver
2180
+ # Options are available in Python client since v2.6.0
2181
+ from appium.options.android import UiAutomator2Options
2182
+
2183
+
2184
+ def generate_options():
2185
+ common_caps = {
2186
+ # A real device udid could be retrieved from `adb devices -l` output
2187
+ # If it is ommitted then the first available device will be used
2188
+ 'appium:udid': '123456',
2189
+ # ...or run the test on an emulator
2190
+ # 'appium:avd': 'emulator-5554',
2191
+ }
2192
+ app_options = UiAutomator2Options().load_capabilities(common_caps)
2193
+ app_options.app = '/Projects/myapp.apk'
2194
+ # It might also be necessary to provide more info about app activities
2195
+ # Read [How To Troubleshoot Activities Startup](docs/activity-startup.md)
2196
+ # for more details
2197
+ # app_options.appPackage = 'com.mypackage'
2198
+ # app_options.appActivity = '.myMainActivity'
2199
+ # app_options.appWaitActivity = '.mySplashScreenActivity'
2200
+ chrome_options = UiAutomator2Options().load_capabilities(common_caps)
2201
+ chrome_options.browser_name = 'chrome'
2202
+ # Read [Hybrid Mode](#hybrid-mode)
2203
+ chrome_options.chromedriver_executable = '/Project/chromedriver_linux64'
2204
+ return [app_options, chrome_options]
2205
+
2206
+
2207
+ @pytest.fixture(params=generate_options())
2208
+ def driver(request):
2209
+ # The default URL is http://127.0.0.1:4723/wd/hub in Appium1
2210
+ drv = webdriver.Remote('http://localhost:4723', options=request.param)
2211
+ yield drv
2212
+ drv.quit()
2213
+
2214
+
2215
+ def test_edit_text(driver):
2216
+ locator = 'android.view.TextEdit' if driver.current_context == 'NATIVE_APP' else 'input'
2217
+ edit_field = driver.find_element_by_class_name(locator)
2218
+ edit_field.send_keys('hello world')
2219
+ assert edit_field.text == 'hello world'
2220
+ edit_field.clear()
2221
+ assert edit_field.text == ''
2222
+
2223
+ ```
2224
+
2225
+
2226
+ ## API Notes
2227
+
2228
+ `lock` behaves differently in Android than it does in iOS. In Android it does not take any arguments, and locks the screen and returns immediately.
2229
+
2230
+
2231
+ ## Development
2232
+
2233
+ ```
2234
+ npm install appium-uiautomator2-driver
2235
+ npm run dev
2236
+ ```
2237
+
2238
+ Unit tests:
2239
+
2240
+ ```
2241
+ npm run test
2242
+ ```
2243
+
2244
+ Functional tests:
2245
+
2246
+ ```
2247
+ npm run e2e-test:commands
2248
+ npm run e2e-test:commands:find
2249
+ npm run e2e-test:commands:general
2250
+ npm run e2e-test:commands:keyboard
2251
+ npm run e2e-test:driver
2252
+ ```
2253
+