appium-mac2-driver 4.3.5 → 4.4.0

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 (372) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/WebDriverAgentMac/IntegrationTests/AMSessionTests.m +14 -0
  3. package/WebDriverAgentMac/WebDriverAgentLib/Commands/FBSessionCommands.m +17 -5
  4. package/WebDriverAgentMac/WebDriverAgentLib/Routing/FBSession.m +5 -1
  5. package/WebDriverAgentMac/WebDriverAgentLib/Utilities/FBXPath.m +48 -2
  6. package/WebDriverAgentMac/WebDriverAgentMac.xcodeproj/project.pbxproj +4 -0
  7. package/build/lib/driver.d.ts +3 -0
  8. package/build/lib/driver.d.ts.map +1 -1
  9. package/build/lib/driver.js +52 -32
  10. package/build/lib/driver.js.map +1 -1
  11. package/build/lib/session-claim-handler.d.ts +41 -0
  12. package/build/lib/session-claim-handler.d.ts.map +1 -0
  13. package/build/lib/session-claim-handler.js +236 -0
  14. package/build/lib/session-claim-handler.js.map +1 -0
  15. package/build/lib/wda-mac.d.ts +6 -2
  16. package/build/lib/wda-mac.d.ts.map +1 -1
  17. package/build/lib/wda-mac.js +43 -14
  18. package/build/lib/wda-mac.js.map +1 -1
  19. package/lib/driver.ts +55 -31
  20. package/lib/session-claim-handler.ts +306 -0
  21. package/lib/wda-mac.ts +45 -15
  22. package/node_modules/@appium/logger/CHANGELOG.md +8 -0
  23. package/node_modules/@appium/logger/package.json +3 -3
  24. package/node_modules/@appium/strongbox/build/lib/index.d.ts.map +1 -1
  25. package/node_modules/@appium/strongbox/build/lib/index.js +6 -1
  26. package/node_modules/@appium/strongbox/build/lib/index.js.map +1 -1
  27. package/node_modules/@appium/strongbox/lib/index.ts +6 -1
  28. package/node_modules/@appium/strongbox/package.json +2 -2
  29. package/node_modules/@appium/support/build/lib/fs.d.ts.map +1 -1
  30. package/node_modules/@appium/support/build/lib/fs.js +7 -0
  31. package/node_modules/@appium/support/build/lib/fs.js.map +1 -1
  32. package/node_modules/@appium/support/build/lib/index.d.ts.map +1 -1
  33. package/node_modules/@appium/support/build/lib/net.d.ts.map +1 -1
  34. package/node_modules/@appium/support/build/lib/net.js +6 -2
  35. package/node_modules/@appium/support/build/lib/net.js.map +1 -1
  36. package/node_modules/@appium/support/build/lib/util.d.ts.map +1 -1
  37. package/node_modules/@appium/support/build/lib/util.js +10 -4
  38. package/node_modules/@appium/support/build/lib/util.js.map +1 -1
  39. package/node_modules/@appium/support/build/lib/zip.d.ts.map +1 -1
  40. package/node_modules/@appium/support/build/lib/zip.js +2 -7
  41. package/node_modules/@appium/support/build/lib/zip.js.map +1 -1
  42. package/node_modules/@appium/support/lib/fs.ts +8 -1
  43. package/node_modules/@appium/support/lib/net.ts +7 -2
  44. package/node_modules/@appium/support/lib/util.ts +9 -3
  45. package/node_modules/@appium/support/lib/zip.ts +3 -9
  46. package/node_modules/@appium/support/package.json +9 -9
  47. package/node_modules/@appium/types/package.json +4 -4
  48. package/node_modules/@img/sharp-darwin-arm64/index.cjs +1 -1
  49. package/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64-0.35.5.node +0 -0
  50. package/node_modules/@img/sharp-darwin-arm64/package.json +2 -2
  51. package/node_modules/@img/sharp-libvips-darwin-arm64/README.md +1 -1
  52. package/node_modules/@img/sharp-libvips-darwin-arm64/lib/glib-2.0/include/glibconfig.h +2 -2
  53. package/node_modules/@img/sharp-libvips-darwin-arm64/lib/{libvips-cpp.8.18.6.dylib → libvips-cpp.8.18.7.dylib} +0 -0
  54. package/node_modules/@img/sharp-libvips-darwin-arm64/package.json +2 -2
  55. package/node_modules/@img/sharp-libvips-darwin-arm64/versions.json +11 -11
  56. package/node_modules/appium-xcode/CHANGELOG.md +35 -0
  57. package/node_modules/appium-xcode/README.md +1 -1
  58. package/node_modules/appium-xcode/package.json +14 -18
  59. package/node_modules/async-lock/AUTHORS +21 -0
  60. package/node_modules/async-lock/History.md +132 -0
  61. package/node_modules/async-lock/LICENSE +22 -0
  62. package/node_modules/async-lock/README.md +177 -0
  63. package/node_modules/async-lock/index.js +2 -0
  64. package/node_modules/async-lock/lib/index.js +312 -0
  65. package/node_modules/async-lock/package.json +48 -0
  66. package/node_modules/b4a/browser.js +5 -0
  67. package/node_modules/b4a/index.d.ts +144 -0
  68. package/node_modules/b4a/index.js +5 -0
  69. package/node_modules/b4a/package.json +4 -1
  70. package/node_modules/b4a/runtime.d.ts +14 -0
  71. package/node_modules/bare-fs/binding.c +52 -23
  72. package/node_modules/bare-fs/index.d.ts +12 -10
  73. package/node_modules/bare-fs/index.js +43 -10
  74. package/node_modules/bare-fs/package.json +2 -1
  75. package/node_modules/bare-fs/prebuilds/android-arm/bare-fs.bare +0 -0
  76. package/node_modules/bare-fs/prebuilds/android-arm64/bare-fs.bare +0 -0
  77. package/node_modules/bare-fs/prebuilds/android-ia32/bare-fs.bare +0 -0
  78. package/node_modules/bare-fs/prebuilds/android-x64/bare-fs.bare +0 -0
  79. package/node_modules/bare-fs/prebuilds/darwin-arm64/bare-fs.bare +0 -0
  80. package/node_modules/bare-fs/prebuilds/darwin-x64/bare-fs.bare +0 -0
  81. package/node_modules/bare-fs/prebuilds/ios-arm64/bare-fs.bare +0 -0
  82. package/node_modules/bare-fs/prebuilds/ios-arm64-simulator/bare-fs.bare +0 -0
  83. package/node_modules/bare-fs/prebuilds/ios-x64-simulator/bare-fs.bare +0 -0
  84. package/node_modules/bare-fs/prebuilds/linux-arm64/bare-fs.bare +0 -0
  85. package/node_modules/bare-fs/prebuilds/linux-x64/bare-fs.bare +0 -0
  86. package/node_modules/bare-fs/prebuilds/win32-arm64/bare-fs.bare +0 -0
  87. package/node_modules/bare-fs/prebuilds/win32-x64/bare-fs.bare +0 -0
  88. package/node_modules/bplist-creator/README.md +26 -6
  89. package/node_modules/bplist-creator/dist/index.cjs +508 -0
  90. package/node_modules/bplist-creator/dist/index.cjs.map +7 -0
  91. package/node_modules/bplist-creator/dist/index.d.cts +12 -0
  92. package/node_modules/bplist-creator/dist/index.d.ts +12 -0
  93. package/node_modules/bplist-creator/dist/index.mjs +472 -0
  94. package/node_modules/bplist-creator/dist/index.mjs.map +7 -0
  95. package/node_modules/bplist-creator/package.json +43 -9
  96. package/node_modules/bplist-parser/README.md +37 -3
  97. package/node_modules/bplist-parser/dist/index.cjs +385 -0
  98. package/node_modules/bplist-parser/dist/index.cjs.map +7 -0
  99. package/node_modules/bplist-parser/dist/index.d.cts +13 -0
  100. package/node_modules/bplist-parser/dist/index.d.ts +13 -0
  101. package/node_modules/bplist-parser/{bplistParser.js → dist/index.mjs} +141 -171
  102. package/node_modules/bplist-parser/dist/index.mjs.map +7 -0
  103. package/node_modules/bplist-parser/package.json +39 -12
  104. package/node_modules/brace-expansion/dist/commonjs/index.d.ts +4 -0
  105. package/node_modules/brace-expansion/dist/commonjs/index.d.ts.map +1 -1
  106. package/node_modules/brace-expansion/dist/commonjs/index.js +69 -25
  107. package/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -1
  108. package/node_modules/brace-expansion/dist/esm/index.d.ts +4 -0
  109. package/node_modules/brace-expansion/dist/esm/index.d.ts.map +1 -1
  110. package/node_modules/brace-expansion/dist/esm/index.js +68 -24
  111. package/node_modules/brace-expansion/dist/esm/index.js.map +1 -1
  112. package/node_modules/brace-expansion/package.json +2 -1
  113. package/node_modules/follow-redirects/index.js +10 -1
  114. package/node_modules/follow-redirects/package.json +1 -1
  115. package/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel-react-native.d.ts.map +1 -0
  116. package/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel-react-native.js.map +1 -0
  117. package/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel.d.ts +5 -0
  118. package/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel.js +7 -0
  119. package/node_modules/lru-cache/dist/commonjs/react-native/index.d.ts +1400 -0
  120. package/node_modules/lru-cache/dist/commonjs/react-native/index.d.ts.map +1 -0
  121. package/node_modules/lru-cache/dist/commonjs/react-native/index.js +1733 -0
  122. package/node_modules/lru-cache/dist/commonjs/react-native/index.js.map +1 -0
  123. package/node_modules/lru-cache/dist/commonjs/react-native/perf.d.ts +12 -0
  124. package/node_modules/lru-cache/dist/commonjs/react-native/perf.d.ts.map +1 -0
  125. package/node_modules/lru-cache/dist/commonjs/react-native/perf.js +10 -0
  126. package/node_modules/lru-cache/dist/commonjs/react-native/perf.js.map +1 -0
  127. package/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel-react-native.d.ts.map +1 -0
  128. package/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel-react-native.js.map +1 -0
  129. package/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel.d.ts +5 -0
  130. package/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel.js +4 -0
  131. package/node_modules/lru-cache/dist/esm/react-native/index.d.ts +1400 -0
  132. package/node_modules/lru-cache/dist/esm/react-native/index.d.ts.map +1 -0
  133. package/node_modules/lru-cache/dist/esm/react-native/index.js +1729 -0
  134. package/node_modules/lru-cache/dist/esm/react-native/index.js.map +1 -0
  135. package/node_modules/lru-cache/dist/esm/react-native/perf.d.ts +12 -0
  136. package/node_modules/lru-cache/dist/esm/react-native/perf.d.ts.map +1 -0
  137. package/node_modules/lru-cache/dist/esm/react-native/perf.js +7 -0
  138. package/node_modules/lru-cache/dist/esm/react-native/perf.js.map +1 -0
  139. package/node_modules/lru-cache/package.json +27 -1
  140. package/node_modules/p-limit/index.d.ts +2 -0
  141. package/node_modules/p-limit/index.js +17 -1
  142. package/node_modules/p-limit/package.json +1 -1
  143. package/node_modules/p-limit/readme.md +2 -0
  144. package/node_modules/readable-stream/lib/internal/shims/process.js +19 -0
  145. package/node_modules/readable-stream/lib/internal/streams/destroy.js +1 -1
  146. package/node_modules/readable-stream/lib/internal/streams/duplexify.js +1 -1
  147. package/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +1 -1
  148. package/node_modules/readable-stream/lib/internal/streams/from.js +1 -1
  149. package/node_modules/readable-stream/lib/internal/streams/legacy.js +6 -1
  150. package/node_modules/readable-stream/lib/internal/streams/pipeline.js +1 -1
  151. package/node_modules/readable-stream/lib/internal/streams/readable.js +1 -1
  152. package/node_modules/readable-stream/lib/internal/streams/writable.js +1 -1
  153. package/node_modules/readable-stream/package.json +3 -2
  154. package/node_modules/sharp/dist/index.d.cts +2 -2
  155. package/node_modules/sharp/dist/index.d.mts +3 -3
  156. package/node_modules/sharp/dist/is.cjs +8 -2
  157. package/node_modules/sharp/dist/is.mjs +8 -2
  158. package/node_modules/sharp/dist/operation.cjs +2 -2
  159. package/node_modules/sharp/dist/operation.mjs +2 -2
  160. package/node_modules/sharp/dist/output.cjs +1 -0
  161. package/node_modules/sharp/dist/output.mjs +1 -0
  162. package/node_modules/sharp/dist/resize.cjs +14 -14
  163. package/node_modules/sharp/dist/resize.mjs +14 -14
  164. package/node_modules/sharp/dist/sharp.cjs +3 -3
  165. package/node_modules/sharp/dist/sharp.mjs +3 -3
  166. package/node_modules/sharp/lib/index.d.ts +2 -2
  167. package/node_modules/sharp/package.json +35 -35
  168. package/node_modules/sharp/src/binding.gyp +1 -1
  169. package/node_modules/sharp/src/common.cc +4 -4
  170. package/node_modules/sharp/src/common.h +2 -2
  171. package/node_modules/sharp/src/pipeline.cc +31 -6
  172. package/node_modules/sharp/src/utilities.cc +1 -1
  173. package/node_modules/spdx-license-ids/index.json +13 -0
  174. package/node_modules/spdx-license-ids/package.json +1 -1
  175. package/node_modules/stream-buffers/.codeclimate.yml +12 -0
  176. package/node_modules/stream-buffers/.eslintignore +1 -0
  177. package/node_modules/stream-buffers/.eslintrc +25 -0
  178. package/node_modules/stream-buffers/.github/workflows/codeql-analysis.yml +71 -0
  179. package/node_modules/stream-buffers/.github/workflows/node.js.yml +31 -0
  180. package/node_modules/stream-buffers/.mailmap +1 -0
  181. package/node_modules/stream-buffers/.nvmrc +1 -0
  182. package/node_modules/stream-buffers/README.md +65 -65
  183. package/node_modules/stream-buffers/lib/constants.js +8 -6
  184. package/node_modules/stream-buffers/lib/readable_streambuffer.js +114 -136
  185. package/node_modules/stream-buffers/lib/streambuffer.js +5 -3
  186. package/node_modules/stream-buffers/lib/writable_streambuffer.js +72 -97
  187. package/node_modules/stream-buffers/package.json +7 -5
  188. package/node_modules/tar-stream/package.json +7 -7
  189. package/node_modules/type-fest/index.d.ts +7 -7
  190. package/node_modules/type-fest/package.json +2 -1
  191. package/node_modules/type-fest/readme.md +7 -16
  192. package/node_modules/type-fest/source/all-extend.d.ts +9 -7
  193. package/node_modules/type-fest/source/array-reverse.d.ts +13 -12
  194. package/node_modules/type-fest/source/array-tail.d.ts +3 -3
  195. package/node_modules/type-fest/source/delimiter-case.d.ts +1 -1
  196. package/node_modules/type-fest/source/get.d.ts +1 -1
  197. package/node_modules/type-fest/source/int-closed-range.d.ts +4 -1
  198. package/node_modules/type-fest/source/int-range.d.ts +56 -9
  199. package/node_modules/type-fest/source/internal/array.d.ts +14 -13
  200. package/node_modules/type-fest/source/internal/numeric.d.ts +0 -38
  201. package/node_modules/type-fest/source/internal/object.d.ts +30 -1
  202. package/node_modules/type-fest/source/is-boolean-literal.d.ts +39 -0
  203. package/node_modules/type-fest/source/is-literal.d.ts +43 -269
  204. package/node_modules/type-fest/source/is-numeric-literal.d.ts +50 -0
  205. package/node_modules/type-fest/source/is-string-literal.d.ts +72 -0
  206. package/node_modules/type-fest/source/is-symbol-literal.d.ts +39 -0
  207. package/node_modules/type-fest/source/is-tuple.d.ts +3 -3
  208. package/node_modules/type-fest/source/jsonify.d.ts +1 -5
  209. package/node_modules/type-fest/source/merge-deep.d.ts +3 -3
  210. package/node_modules/type-fest/source/remove-prefix.d.ts +1 -1
  211. package/node_modules/type-fest/source/remove-suffix.d.ts +1 -1
  212. package/node_modules/type-fest/source/rename-keys.d.ts +163 -0
  213. package/node_modules/type-fest/source/set-required.d.ts +10 -9
  214. package/node_modules/type-fest/source/shared-union-fields-deep.d.ts +6 -4
  215. package/node_modules/type-fest/source/some-extend.d.ts +9 -7
  216. package/node_modules/type-fest/source/split-on-rest-element.d.ts +14 -13
  217. package/node_modules/type-fest/source/split.d.ts +22 -11
  218. package/node_modules/type-fest/source/string-repeat.d.ts +1 -1
  219. package/node_modules/type-fest/source/string-to-array.d.ts +1 -1
  220. package/node_modules/type-fest/source/tsconfig-json.d.ts +1 -1
  221. package/node_modules/type-fest/source/typed-array.d.ts +6 -0
  222. package/node_modules/type-fest/source/union-max.d.ts +56 -0
  223. package/node_modules/type-fest/source/writable.d.ts +2 -2
  224. package/package.json +5 -3
  225. package/node_modules/@appium/support/node_modules/asyncbox/LICENSE +0 -203
  226. package/node_modules/@appium/support/node_modules/asyncbox/README.md +0 -215
  227. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts +0 -103
  228. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts.map +0 -1
  229. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.js +0 -301
  230. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.js.map +0 -1
  231. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.d.ts +0 -84
  232. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.d.ts.map +0 -1
  233. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.js +0 -3
  234. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.js.map +0 -1
  235. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/package.json +0 -3
  236. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts +0 -103
  237. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts.map +0 -1
  238. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.js +0 -288
  239. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.js.map +0 -1
  240. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.d.ts +0 -84
  241. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.d.ts.map +0 -1
  242. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.js +0 -2
  243. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.js.map +0 -1
  244. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/package.json +0 -3
  245. package/node_modules/@appium/support/node_modules/asyncbox/lib/asyncbox.ts +0 -365
  246. package/node_modules/@appium/support/node_modules/asyncbox/lib/types.ts +0 -88
  247. package/node_modules/@appium/support/node_modules/asyncbox/package.json +0 -74
  248. package/node_modules/@appium/support/node_modules/axios/CHANGELOG.md +0 -1872
  249. package/node_modules/@appium/support/node_modules/axios/LICENSE +0 -7
  250. package/node_modules/@appium/support/node_modules/axios/MIGRATION_GUIDE.md +0 -877
  251. package/node_modules/@appium/support/node_modules/axios/README.md +0 -2623
  252. package/node_modules/@appium/support/node_modules/axios/dist/axios.js +0 -5509
  253. package/node_modules/@appium/support/node_modules/axios/dist/axios.min.js +0 -5
  254. package/node_modules/@appium/support/node_modules/axios/dist/axios.min.js.map +0 -1
  255. package/node_modules/@appium/support/node_modules/axios/dist/browser/axios.cjs +0 -5469
  256. package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.js +0 -5490
  257. package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.min.js +0 -3
  258. package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.min.js.map +0 -1
  259. package/node_modules/@appium/support/node_modules/axios/dist/node/axios.cjs +0 -6356
  260. package/node_modules/@appium/support/node_modules/axios/index.d.cts +0 -762
  261. package/node_modules/@appium/support/node_modules/axios/index.d.ts +0 -783
  262. package/node_modules/@appium/support/node_modules/axios/index.js +0 -45
  263. package/node_modules/@appium/support/node_modules/axios/lib/adapters/README.md +0 -36
  264. package/node_modules/@appium/support/node_modules/axios/lib/adapters/adapters.js +0 -132
  265. package/node_modules/@appium/support/node_modules/axios/lib/adapters/fetch.js +0 -643
  266. package/node_modules/@appium/support/node_modules/axios/lib/adapters/http.js +0 -1406
  267. package/node_modules/@appium/support/node_modules/axios/lib/adapters/xhr.js +0 -228
  268. package/node_modules/@appium/support/node_modules/axios/lib/axios.js +0 -89
  269. package/node_modules/@appium/support/node_modules/axios/lib/cancel/CancelToken.js +0 -135
  270. package/node_modules/@appium/support/node_modules/axios/lib/cancel/CanceledError.js +0 -22
  271. package/node_modules/@appium/support/node_modules/axios/lib/cancel/isCancel.js +0 -5
  272. package/node_modules/@appium/support/node_modules/axios/lib/core/Axios.js +0 -301
  273. package/node_modules/@appium/support/node_modules/axios/lib/core/AxiosError.js +0 -219
  274. package/node_modules/@appium/support/node_modules/axios/lib/core/AxiosHeaders.js +0 -474
  275. package/node_modules/@appium/support/node_modules/axios/lib/core/InterceptorManager.js +0 -72
  276. package/node_modules/@appium/support/node_modules/axios/lib/core/README.md +0 -8
  277. package/node_modules/@appium/support/node_modules/axios/lib/core/buildFullPath.js +0 -88
  278. package/node_modules/@appium/support/node_modules/axios/lib/core/dispatchRequest.js +0 -89
  279. package/node_modules/@appium/support/node_modules/axios/lib/core/mergeConfig.js +0 -174
  280. package/node_modules/@appium/support/node_modules/axios/lib/core/setFormDataHeaders.js +0 -27
  281. package/node_modules/@appium/support/node_modules/axios/lib/core/settle.js +0 -27
  282. package/node_modules/@appium/support/node_modules/axios/lib/core/transformData.js +0 -28
  283. package/node_modules/@appium/support/node_modules/axios/lib/defaults/index.js +0 -177
  284. package/node_modules/@appium/support/node_modules/axios/lib/defaults/transitional.js +0 -10
  285. package/node_modules/@appium/support/node_modules/axios/lib/env/README.md +0 -3
  286. package/node_modules/@appium/support/node_modules/axios/lib/env/classes/FormData.js +0 -2
  287. package/node_modules/@appium/support/node_modules/axios/lib/env/data.js +0 -1
  288. package/node_modules/@appium/support/node_modules/axios/lib/helpers/AxiosTransformStream.js +0 -156
  289. package/node_modules/@appium/support/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +0 -59
  290. package/node_modules/@appium/support/node_modules/axios/lib/helpers/Http2Sessions.js +0 -119
  291. package/node_modules/@appium/support/node_modules/axios/lib/helpers/HttpStatusCode.js +0 -78
  292. package/node_modules/@appium/support/node_modules/axios/lib/helpers/README.md +0 -7
  293. package/node_modules/@appium/support/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +0 -29
  294. package/node_modules/@appium/support/node_modules/axios/lib/helpers/bind.js +0 -14
  295. package/node_modules/@appium/support/node_modules/axios/lib/helpers/buildURL.js +0 -69
  296. package/node_modules/@appium/support/node_modules/axios/lib/helpers/callbackify.js +0 -18
  297. package/node_modules/@appium/support/node_modules/axios/lib/helpers/combineURLs.js +0 -23
  298. package/node_modules/@appium/support/node_modules/axios/lib/helpers/composeSignals.js +0 -68
  299. package/node_modules/@appium/support/node_modules/axios/lib/helpers/cookies.js +0 -64
  300. package/node_modules/@appium/support/node_modules/axios/lib/helpers/deprecatedMethod.js +0 -31
  301. package/node_modules/@appium/support/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +0 -166
  302. package/node_modules/@appium/support/node_modules/axios/lib/helpers/formDataToJSON.js +0 -125
  303. package/node_modules/@appium/support/node_modules/axios/lib/helpers/formDataToStream.js +0 -119
  304. package/node_modules/@appium/support/node_modules/axios/lib/helpers/fromDataURI.js +0 -68
  305. package/node_modules/@appium/support/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -19
  306. package/node_modules/@appium/support/node_modules/axios/lib/helpers/isAxiosError.js +0 -14
  307. package/node_modules/@appium/support/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -16
  308. package/node_modules/@appium/support/node_modules/axios/lib/helpers/null.js +0 -2
  309. package/node_modules/@appium/support/node_modules/axios/lib/helpers/parseHeaders.js +0 -71
  310. package/node_modules/@appium/support/node_modules/axios/lib/helpers/parseProtocol.js +0 -6
  311. package/node_modules/@appium/support/node_modules/axios/lib/helpers/progressEventReducer.js +0 -54
  312. package/node_modules/@appium/support/node_modules/axios/lib/helpers/readBlob.js +0 -15
  313. package/node_modules/@appium/support/node_modules/axios/lib/helpers/resolveConfig.js +0 -105
  314. package/node_modules/@appium/support/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +0 -60
  315. package/node_modules/@appium/support/node_modules/axios/lib/helpers/shouldBypassProxy.js +0 -329
  316. package/node_modules/@appium/support/node_modules/axios/lib/helpers/speedometer.js +0 -55
  317. package/node_modules/@appium/support/node_modules/axios/lib/helpers/spread.js +0 -28
  318. package/node_modules/@appium/support/node_modules/axios/lib/helpers/throttle.js +0 -44
  319. package/node_modules/@appium/support/node_modules/axios/lib/helpers/toFormData.js +0 -286
  320. package/node_modules/@appium/support/node_modules/axios/lib/helpers/toURLEncodedForm.js +0 -19
  321. package/node_modules/@appium/support/node_modules/axios/lib/helpers/trackStream.js +0 -89
  322. package/node_modules/@appium/support/node_modules/axios/lib/helpers/validator.js +0 -112
  323. package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/Blob.js +0 -3
  324. package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/FormData.js +0 -3
  325. package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +0 -4
  326. package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/index.js +0 -13
  327. package/node_modules/@appium/support/node_modules/axios/lib/platform/common/utils.js +0 -52
  328. package/node_modules/@appium/support/node_modules/axios/lib/platform/index.js +0 -7
  329. package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/Buffer.js +0 -11
  330. package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/FormData.js +0 -3
  331. package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +0 -4
  332. package/node_modules/@appium/support/node_modules/axios/lib/platform/node/index.js +0 -37
  333. package/node_modules/@appium/support/node_modules/axios/lib/utils.js +0 -1029
  334. package/node_modules/@appium/support/node_modules/axios/package.json +0 -203
  335. package/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64-0.35.4.node +0 -0
  336. package/node_modules/big-integer/BigInteger.d.ts +0 -2393
  337. package/node_modules/big-integer/BigInteger.js +0 -1453
  338. package/node_modules/big-integer/BigInteger.min.js +0 -1
  339. package/node_modules/big-integer/LICENSE +0 -24
  340. package/node_modules/big-integer/README.md +0 -589
  341. package/node_modules/big-integer/bower.json +0 -29
  342. package/node_modules/big-integer/package.json +0 -48
  343. package/node_modules/big-integer/tsconfig.json +0 -24
  344. package/node_modules/bplist-creator/bplistCreator.d.ts +0 -8
  345. package/node_modules/bplist-creator/bplistCreator.js +0 -460
  346. package/node_modules/bplist-creator/test/airplay.bplist +0 -0
  347. package/node_modules/bplist-creator/test/binaryData.bplist +0 -0
  348. package/node_modules/bplist-creator/test/creatorTest.js +0 -211
  349. package/node_modules/bplist-creator/test/iTunes-small.bplist +0 -0
  350. package/node_modules/bplist-creator/test/integers.bplist +0 -0
  351. package/node_modules/bplist-creator/test/sample1.bplist +0 -0
  352. package/node_modules/bplist-creator/test/sample2.bplist +0 -0
  353. package/node_modules/bplist-creator/test/uid.bplist +0 -0
  354. package/node_modules/bplist-creator/test/utf16.bplist +0 -0
  355. package/node_modules/bplist-parser/.editorconfig +0 -12
  356. package/node_modules/bplist-parser/.eslintignore +0 -1
  357. package/node_modules/bplist-parser/.eslintrc.js +0 -296
  358. package/node_modules/bplist-parser/bplistParser.d.ts +0 -8
  359. package/node_modules/stream-buffers/.travis.yml +0 -28
  360. package/node_modules/stream-buffers/coverage/coverage.json +0 -1
  361. package/node_modules/stream-buffers/coverage/lcov-report/base.css +0 -182
  362. package/node_modules/stream-buffers/coverage/lcov-report/index.html +0 -73
  363. package/node_modules/stream-buffers/coverage/lcov-report/lib/constants.js.html +0 -63
  364. package/node_modules/stream-buffers/coverage/lcov-report/lib/index.html +0 -112
  365. package/node_modules/stream-buffers/coverage/lcov-report/lib/readable_streambuffer.js.html +0 -453
  366. package/node_modules/stream-buffers/coverage/lcov-report/lib/streambuffer.js.html +0 -54
  367. package/node_modules/stream-buffers/coverage/lcov-report/lib/writable_streambuffer.js.html +0 -336
  368. package/node_modules/stream-buffers/coverage/lcov-report/prettify.css +0 -1
  369. package/node_modules/stream-buffers/coverage/lcov-report/prettify.js +0 -1
  370. package/node_modules/stream-buffers/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  371. package/node_modules/stream-buffers/coverage/lcov-report/sorter.js +0 -156
  372. package/node_modules/stream-buffers/coverage/lcov.info +0 -305
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## [4.4.0](https://github.com/appium/appium-mac2-driver/compare/v4.3.6...v4.4.0) (2026-10-11)
2
+
3
+ ### Features
4
+
5
+ * enforce a single session, a new session replaces the previous one ([#426](https://github.com/appium/appium-mac2-driver/issues/426)) ([fb10372](https://github.com/appium/appium-mac2-driver/commit/fb10372c16d861fb7ff9463b345ba6fcb3f67387))
6
+
7
+ ## [4.3.6](https://github.com/appium/appium-mac2-driver/compare/v4.3.5...v4.3.6) (2026-10-02)
8
+
9
+ ### Bug Fixes
10
+
11
+ * Isolated process-exit state, page-source xml, Reused geometry during XML serialization ([#423](https://github.com/appium/appium-mac2-driver/issues/423)) ([b4dc1f8](https://github.com/appium/appium-mac2-driver/commit/b4dc1f8aa403e18b3b6c1807403144fd19552492))
12
+
1
13
  ## [4.3.5](https://github.com/appium/appium-mac2-driver/compare/v4.3.4...v4.3.5) (2026-09-10)
2
14
 
3
15
  ### Miscellaneous Chores
@@ -43,6 +43,20 @@ static NSString *const SETTINGS_BUNDLE_ID = @"com.apple.systempreferences";
43
43
  [super tearDown];
44
44
  }
45
45
 
46
+ - (void)testNewSessionOverridesThePreviousOne
47
+ {
48
+ NSString *oldId = self.session.identifier;
49
+ FBSession *newSession = [FBSession initWithApplication:nil];
50
+ XCTAssertNotEqualObjects(oldId, newSession.identifier);
51
+ XCTAssertEqual(FBSession.activeSession, newSession);
52
+ XCTAssertNil([FBSession sessionWithIdentifier:oldId]);
53
+ // Killing the stale session must not drop the active one
54
+ [self.session kill];
55
+ XCTAssertEqual(FBSession.activeSession, newSession);
56
+ [newSession kill];
57
+ XCTAssertNil(FBSession.activeSession);
58
+ }
59
+
46
60
  - (void)testSettingsAppCanBeOpenedInScopeOfTheCurrentSession
47
61
  {
48
62
  [self.session launchApplicationWithBundleId:SETTINGS_BUNDLE_ID
@@ -99,9 +99,15 @@ const static NSString *CAPABILITIES_KEY = @"capabilities";
99
99
  NSString *appPath = requirements[AM_APP_PATH_CAPABILITY];
100
100
  NSString *deepLink = requirements[AM_INITIAL_DEEPLINK_URL_CAPABILITY];
101
101
  BOOL noReset = [requirements[AM_NO_RESET_CAPABILITY] boolValue];
102
- FBSession *session;
102
+
103
+ // XCTest is single-threaded, so there can only be one session. A new one always
104
+ // takes over, and the previous one must be gone before any app gets touched.
105
+ [FBSession.activeSession kill];
106
+
107
+ XCUIApplication *app = nil;
108
+ BOOL didLaunchApp = NO;
103
109
  if (nil == bundleID && nil == appPath && nil == deepLink) {
104
- session = [FBSession initWithApplication:nil];
110
+ // no app to manage
105
111
  } else if (nil != deepLink) {
106
112
  NSURL *url = [NSURL URLWithString:deepLink];
107
113
  NSError *error;
@@ -113,13 +119,12 @@ const static NSString *CAPABILITIES_KEY = @"capabilities";
113
119
  traceback:nil]);
114
120
  }
115
121
  if (nil != bundleID) {
116
- session = [FBSession initWithApplication:[[XCUIApplication alloc] initWithBundleIdentifier:bundleID]];
122
+ app = [[XCUIApplication alloc] initWithBundleIdentifier:bundleID];
117
123
  }
118
124
  } else {
119
- XCUIApplication *app = nil != appPath
125
+ app = nil != appPath
120
126
  ? [[XCUIApplication alloc] initWithURL:[NSURL fileURLWithPath:appPath]]
121
127
  : [[XCUIApplication alloc] initWithBundleIdentifier:bundleID];
122
- session = [FBSession initWithApplication:app];
123
128
  if (noReset && app.state > XCUIApplicationStateNotRunning) {
124
129
  [app activate];
125
130
  } else {
@@ -140,6 +145,7 @@ const static NSString *CAPABILITIES_KEY = @"capabilities";
140
145
  }
141
146
  app.launchEnvironment = [launchEnv copy];
142
147
  [app launch];
148
+ didLaunchApp = YES;
143
149
  if (app.state <= XCUIApplicationStateNotRunning) {
144
150
  NSString *message = [NSString stringWithFormat:@"Failed to launch '%@' application", appPath ?: bundleID];
145
151
  return FBResponseWithStatus([FBCommandStatus sessionNotCreatedError:message
@@ -149,6 +155,10 @@ const static NSString *CAPABILITIES_KEY = @"capabilities";
149
155
  if (nil != bundleID && nil != appPath) {
150
156
  NSString *realBundleID = app.am_bundleID;
151
157
  if (![realBundleID isEqualToString:bundleID]) {
158
+ // no session owns the app, so don't leave it behind
159
+ if (didLaunchApp) {
160
+ [app terminate];
161
+ }
152
162
  NSString *message = [NSString stringWithFormat:@"The bundle identifier %@ of the '%@' does not match to the one provided in capabilities: %@",
153
163
  realBundleID, appPath, bundleID];
154
164
  return FBResponseWithStatus([FBCommandStatus sessionNotCreatedError:message
@@ -156,6 +166,8 @@ const static NSString *CAPABILITIES_KEY = @"capabilities";
156
166
  }
157
167
  }
158
168
  }
169
+ // The session is only registered once startup has fully succeeded
170
+ FBSession *session = [FBSession initWithApplication:app];
159
171
  if (nil != requirements[AM_SKIP_APP_KILL_CAPABILITY]) {
160
172
  session.skipAppTermination = [requirements[AM_SKIP_APP_KILL_CAPABILITY] boolValue];
161
173
  } else if (nil == bundleID) {
@@ -72,6 +72,11 @@ static FBSession *_activeSession = nil;
72
72
  [self.testedApplication terminate];
73
73
  }
74
74
  self.testedApplication = nil;
75
+ [self.elementCache reset];
76
+ // The recording belongs to the active session, so a stale one must not touch it
77
+ if (_activeSession != self) {
78
+ return;
79
+ }
75
80
  FBScreenRecordingContainer *screenRecordingContainer = FBScreenRecordingContainer.sharedInstance;
76
81
  NSUUID *videoRecordingId = screenRecordingContainer.screenRecordingPromise.identifier;
77
82
  if (nil != videoRecordingId) {
@@ -83,7 +88,6 @@ static FBSession *_activeSession = nil;
83
88
  if (nil != screenRecordingContainer.screenRecordingPromise) {
84
89
  [screenRecordingContainer reset];
85
90
  }
86
- [self.elementCache reset];
87
91
  _activeSession = nil;
88
92
  }
89
93
 
@@ -139,7 +139,46 @@ static NSString *const kXMLIndexPathKey = @"private_indexPath";
139
139
  return nil;
140
140
  }
141
141
 
142
- return [[self xmlRepresentationWithSnapshot:snapshot] XMLStringWithOptions:NSXMLNodePrettyPrint];
142
+ return [self xmlStringWithSnapshot:snapshot];
143
+ }
144
+
145
+ // Serialize one native XML node at a time without retaining a document tree.
146
+ + (nullable NSString *)xmlStringWithSnapshot:(id<XCUIElementSnapshot>)snapshot
147
+ {
148
+ NSMutableString *result = [NSMutableString stringWithString:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"];
149
+ [self appendXmlWithSnapshot:snapshot toString:result indentation:@""];
150
+ return result.copy;
151
+ }
152
+
153
+ + (void)appendXmlWithSnapshot:(id<XCUIElementSnapshot>)snapshot
154
+ toString:(NSMutableString *)result
155
+ indentation:(NSString *)indentation
156
+ {
157
+ NSString *type = [FBElementTypeTransformer stringWithElementType:snapshot.elementType];
158
+ NSArray<id<XCUIElementSnapshot>> *children = snapshot.children;
159
+ @autoreleasepool {
160
+ NSXMLElement *node = [NSXMLElement elementWithName:type];
161
+ [self recordElementAttributes:node forSnapshot:snapshot indexPath:nil];
162
+ // Native serialization handles escaping and keeps Foundation's existing
163
+ // attribute whitespace behavior. Compact empty nodes always end in "/>".
164
+ NSString *xml = [node XMLStringWithOptions:NSXMLNodeCompactEmptyElement];
165
+ [result appendString:indentation];
166
+ if (children.count == 0) {
167
+ [result appendString:xml];
168
+ } else {
169
+ [result appendString:[xml substringToIndex:xml.length - 2]];
170
+ [result appendString:@">"];
171
+ }
172
+ [result appendString:@"\n"];
173
+ }
174
+ if (children.count == 0) {
175
+ return;
176
+ }
177
+ NSString *childIndentation = [indentation stringByAppendingString:@" "];
178
+ for (id<XCUIElementSnapshot> child in children) {
179
+ [self appendXmlWithSnapshot:child toString:result indentation:childIndentation];
180
+ }
181
+ [result appendFormat:@"%@</%@>\n", indentation, type];
143
182
  }
144
183
 
145
184
  + (NSArray<XCUIElement *> *)matchesWithRootElement:(XCUIElement *)root
@@ -219,8 +258,15 @@ static NSString *const kXMLIndexPathKey = @"private_indexPath";
219
258
  forSnapshot:(id<XCUIElementSnapshot>)snapshot
220
259
  indexPath:(nullable NSString *)indexPath
221
260
  {
261
+ NSDictionary *rect = nil;
222
262
  for (Class attributeCls in FBElementAttribute.supportedAttributes) {
223
- [attributeCls recordWithNode:node forElement:snapshot];
263
+ if ([attributeCls isSubclassOfClass:FBDimensionAttribute.class]) {
264
+ rect = rect ?: AMCGRectToDict(snapshot.frame);
265
+ [node addAttribute:[NSXMLNode attributeWithName:[attributeCls name]
266
+ stringValue:[rect[[attributeCls name]] description]]];
267
+ } else {
268
+ [attributeCls recordWithNode:node forElement:snapshot];
269
+ }
224
270
  }
225
271
 
226
272
  if (nil != indexPath) {
@@ -7,6 +7,7 @@
7
7
  objects = {
8
8
 
9
9
  /* Begin PBXBuildFile section */
10
+ B182601DDE174B5AB2AD7701 /* AMXPathTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B182601DDE174B5AB2AD7702 /* AMXPathTests.m */; };
10
11
  06865ADF2DB5D6F7819CE2A8 /* AMTCPSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 702867B5FC5F035D1CC8E596 /* AMTCPSocket.h */; };
11
12
  1E964A1C6D82FF8B9E17C024 /* AMHTTPServerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AFF6D8DC9CE6831D94DFA00 /* AMHTTPServerTests.m */; };
12
13
  2A45B1885FA76B1DE65D4E09 /* AMHTTPServer.h in Headers */ = {isa = PBXBuildFile; fileRef = B1768D9362DADEAF91410A76 /* AMHTTPServer.h */; };
@@ -255,6 +256,7 @@
255
256
  /* End PBXCopyFilesBuildPhase section */
256
257
 
257
258
  /* Begin PBXFileReference section */
259
+ B182601DDE174B5AB2AD7702 /* AMXPathTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AMXPathTests.m; sourceTree = "<group>"; };
258
260
  56444252148A6377AB34CC3B /* RouteRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = RouteRequest.m; sourceTree = "<group>"; };
259
261
  56885A73AAD5DB0A05C9882D /* AMTCPSocket.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = AMTCPSocket.m; sourceTree = "<group>"; };
260
262
  6AFF6D8DC9CE6831D94DFA00 /* AMHTTPServerTests.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = AMHTTPServerTests.m; sourceTree = "<group>"; };
@@ -834,6 +836,7 @@
834
836
  isa = PBXGroup;
835
837
  children = (
836
838
  6AFF6D8DC9CE6831D94DFA00 /* AMHTTPServerTests.m */,
839
+ B182601DDE174B5AB2AD7702 /* AMXPathTests.m */,
837
840
  A14FCEABDDD9E126A7774B1F /* Info.plist */,
838
841
  );
839
842
  name = UnitTests;
@@ -1123,6 +1126,7 @@
1123
1126
  buildActionMask = 2147483647;
1124
1127
  files = (
1125
1128
  1E964A1C6D82FF8B9E17C024 /* AMHTTPServerTests.m in Sources */,
1129
+ B182601DDE174B5AB2AD7701 /* AMXPathTests.m in Sources */,
1126
1130
  );
1127
1131
  runOnlyForDeploymentPostprocessing = 0;
1128
1132
  };
@@ -268,6 +268,8 @@ export declare class Mac2Driver extends BaseDriver<Mac2Constraints, StringRecord
268
268
  proxyReqRes: (...args: any) => any;
269
269
  private isProxyActive;
270
270
  private _wda;
271
+ private _wdaSessionId;
272
+ private _hasClaimedHost;
271
273
  constructor(opts?: InitialOpts);
272
274
  get wda(): WDAMacServer;
273
275
  onSettingsUpdate(key: string, value: unknown): Promise<void>;
@@ -279,6 +281,7 @@ export declare class Mac2Driver extends BaseDriver<Mac2Constraints, StringRecord
279
281
  getWindowRect(): Promise<any>;
280
282
  createSession(w3cCaps1: W3CMac2DriverCaps, w3cCaps2?: W3CMac2DriverCaps, w3cCaps3?: W3CMac2DriverCaps, driverData?: DriverData[]): Promise<DefaultCreateSessionResult<Mac2Constraints>>;
281
283
  deleteSession(): Promise<void>;
284
+ private teardownSession;
282
285
  private resetState;
283
286
  }
284
287
  export default Mac2Driver;
@@ -1 +1 @@
1
- {"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../lib/driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,0BAA0B,EAC1B,UAAU,EACV,WAAW,EACX,YAAY,EACZ,cAAc,EAGd,aAAa,EACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,UAAU,EAAiB,MAAM,kBAAkB,CAAC;AAE5D,OAAO,KAAK,sBAAsB,MAAM,8BAA8B,CAAC;AACvE,OAAO,KAAK,mBAAmB,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,iBAAiB,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,6BAA6B,MAAM,oCAAoC,CAAC;AACpF,OAAO,KAAK,kBAAkB,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAyB,EAAC,KAAK,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAIxE,OAAO,EAAiB,KAAK,YAAY,EAAC,MAAM,cAAc,CAAC;AA0B/D,KAAK,iBAAiB,GAAG,aAAa,CAAC,eAAe,CAAC,CAAC;AACxD,qBAAa,UACX,SAAQ,UAAU,CAAC,eAAe,EAAE,YAAY,CAChD,YAAW,cAAc,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AAS,EAAE,MAAM,GAAG,OAAO;IAKvC,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY,EAAE;IAIpD,QAAQ,IAAI,OAAO;IAItB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,GAAE,QAAe,GAAG,OAAO,CAAC,GAAG,CAAC;IAIzE,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC;IAQlC,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC;IAIpB,aAAa,CAC1B,QAAQ,EAAE,iBAAiB,EAC3B,QAAQ,CAAC,EAAE,iBAAiB,EAC5B,QAAQ,CAAC,EAAE,iBAAiB,EAC5B,UAAU,CAAC,EAAE,UAAU,EAAE,GACxB,OAAO,CAAC,0BAA0B,CAAC,eAAe,CAAC,CAAC;IAyCxC,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;YAM/B,eAAe;IAqC7B,OAAO,CAAC,UAAU;CAWnB;AAED,eAAe,UAAU,CAAC"}
@@ -1,4 +1,4 @@
1
- import { BaseDriver, DeviceSettings } from 'appium/driver.js';
1
+ import { BaseDriver, DeviceSettings, errors } from 'appium/driver.js';
2
2
  import * as appManagemenetCommands from './commands/app-management.js';
3
3
  import * as appleScriptCommands from './commands/applescript.js';
4
4
  import * as auditCommands from './commands/audit.js';
@@ -15,6 +15,7 @@ import MAC2_CONSTRAINTS from './constraints.js';
15
15
  import { executeMethodMap } from './execute-method-map.js';
16
16
  import log from './logger.js';
17
17
  import { newMethodMap } from './method-map.js';
18
+ import { sessionClaimHandler } from './session-claim-handler.js';
18
19
  import { WDA_MAC_SERVER } from './wda-mac.js';
19
20
  const NO_PROXY = [
20
21
  ['GET', new RegExp('^/session/[^/]+/appium')],
@@ -70,6 +71,8 @@ export class Mac2Driver extends BaseDriver {
70
71
  proxyReqRes;
71
72
  isProxyActive = false;
72
73
  _wda = null;
74
+ _wdaSessionId = null;
75
+ _hasClaimedHost = false;
73
76
  constructor(opts = {}) {
74
77
  super(opts);
75
78
  this.desiredCapConstraints = structuredClone(MAC2_CONSTRAINTS);
@@ -91,13 +94,18 @@ export class Mac2Driver extends BaseDriver {
91
94
  if (!this._wda) {
92
95
  throw new Error('WDA server is not initialized');
93
96
  }
97
+ // The WDA server is shared and only supports a single session, so a newer
98
+ // session replaces this one. Never send commands on its behalf after that.
99
+ if (this._wdaSessionId && !this._wda.isSessionActive(this._wdaSessionId)) {
100
+ throw new errors.NoSuchDriverError('This session has been replaced by a newer one, because this driver only supports a single session');
101
+ }
94
102
  return this._wda;
95
103
  }
96
104
  async onSettingsUpdate(key, value) {
97
105
  if (!this._wda) {
98
106
  return;
99
107
  }
100
- return await this._wda.proxy.command('/appium/settings', 'POST', {
108
+ return await this.wda.proxy.command('/appium/settings', 'POST', {
101
109
  settings: { [key]: value },
102
110
  });
103
111
  }
@@ -113,10 +121,7 @@ export class Mac2Driver extends BaseDriver {
113
121
  return true;
114
122
  }
115
123
  async proxyCommand(url, method, body = null) {
116
- if (!this._wda) {
117
- throw new Error('WDA server is not initialized');
118
- }
119
- return await this._wda.proxy.command(url, method, body);
124
+ return await this.wda.proxy.command(url, method, body);
120
125
  }
121
126
  async getStatus() {
122
127
  if (!this._wda) {
@@ -126,10 +131,7 @@ export class Mac2Driver extends BaseDriver {
126
131
  }
127
132
  // needed to make image plugin work
128
133
  async getWindowRect() {
129
- if (!this._wda) {
130
- throw new Error('WDA server is not initialized');
131
- }
132
- return await this._wda.proxy.command('/window/rect', 'GET');
134
+ return await this.wda.proxy.command('/window/rect', 'GET');
133
135
  }
134
136
  async createSession(w3cCaps1, w3cCaps2, w3cCaps3, driverData) {
135
137
  const [sessionId, caps] = await super.createSession(w3cCaps1, w3cCaps2, w3cCaps3, driverData);
@@ -137,34 +139,49 @@ export class Mac2Driver extends BaseDriver {
137
139
  this.caps = caps;
138
140
  // oxlint-disable-next-line no-self-assign -- narrows this.opts' type for the rest of the method
139
141
  this.opts = this.opts;
140
- try {
141
- const prerun = caps.prerun;
142
- if (prerun) {
143
- if (typeof prerun.command !== 'string' && typeof prerun.script !== 'string') {
144
- throw new Error(`'prerun' capability value must either contain 'script' or 'command' entry of string type`);
145
- }
146
- log.info('Executing prerun AppleScript');
147
- const output = await this.macosExecAppleScript(prerun.script, undefined, prerun.command);
148
- if (output.trim()) {
149
- log.info(`Prerun script output: ${output}`);
142
+ // The host supports a single session: the previous one has to quit first
143
+ await sessionClaimHandler.runExclusive(async () => {
144
+ // The session might have been deleted while it was waiting for its turn
145
+ if (!this._wda || !this.sessionId) {
146
+ throw new errors.NoSuchDriverError('The session has been deleted before it could start');
147
+ }
148
+ try {
149
+ await sessionClaimHandler.registerActiveSession(this);
150
+ await sessionClaimHandler.claimHost(this);
151
+ this._hasClaimedHost = true;
152
+ const prerun = caps.prerun;
153
+ if (prerun) {
154
+ if (typeof prerun.command !== 'string' && typeof prerun.script !== 'string') {
155
+ throw new Error(`'prerun' capability value must either contain 'script' or 'command' entry of string type`);
156
+ }
157
+ log.info('Executing prerun AppleScript');
158
+ const output = await this.macosExecAppleScript(prerun.script, undefined, prerun.command);
159
+ if (output.trim()) {
160
+ log.info(`Prerun script output: ${output}`);
161
+ }
150
162
  }
163
+ this._wdaSessionId = await this.wda.startSession(caps, {
164
+ reqBasePath: this.basePath,
165
+ });
151
166
  }
152
- await this._wda.startSession(caps, {
153
- reqBasePath: this.basePath,
154
- });
155
- }
156
- catch (e) {
157
- await this.deleteSession();
158
- throw e;
159
- }
160
- this.proxyReqRes = this.wda.proxy.proxyReqRes.bind(this._wda.proxy);
167
+ catch (e) {
168
+ await this.deleteSession();
169
+ throw e;
170
+ }
171
+ });
172
+ this.proxyReqRes = (...args) => this.wda.proxy.proxyReqRes.apply(this.wda.proxy, args);
161
173
  this.isProxyActive = true;
162
174
  return [sessionId, caps];
163
175
  }
164
176
  async deleteSession() {
177
+ sessionClaimHandler.unregisterActiveSession(this);
178
+ // A new session waits for the teardown to complete before it starts
179
+ await sessionClaimHandler.trackTeardown(async () => await this.teardownSession());
180
+ }
181
+ async teardownSession() {
165
182
  await this._screenRecorder?.stop(true);
166
183
  if (this._videoChunksBroadcaster.hasPublishers) {
167
- if (this._wda) {
184
+ if (this._wda?.isSessionActive(this._wdaSessionId)) {
168
185
  try {
169
186
  await this.wda.proxy.command('/wda/video/stop', 'POST', {});
170
187
  }
@@ -173,9 +190,10 @@ export class Mac2Driver extends BaseDriver {
173
190
  await this._videoChunksBroadcaster.shutdown(5000);
174
191
  }
175
192
  if (this._wda) {
176
- await this.wda.stopSession();
193
+ await this._wda.stopSession(this._wdaSessionId);
177
194
  }
178
- const postrun = this.opts.postrun;
195
+ // Skip postrun if the host was never acquired, as the previous session might still be using it
196
+ const postrun = this._hasClaimedHost ? this.opts.postrun : undefined;
179
197
  if (postrun) {
180
198
  if (typeof postrun.command !== 'string' && typeof postrun.script !== 'string') {
181
199
  log.error(`'postrun' capability value must either contain 'script' or 'command' entry of string type`);
@@ -198,6 +216,8 @@ export class Mac2Driver extends BaseDriver {
198
216
  }
199
217
  resetState() {
200
218
  this._wda = null;
219
+ this._wdaSessionId = null;
220
+ this._hasClaimedHost = false;
201
221
  this.isProxyActive = false;
202
222
  this._videoChunksBroadcaster = new nativeScreenRecordingCommands.NativeVideoChunksBroadcaster(this.eventEmitter, this.log);
203
223
  this._screenRecorder = null;
@@ -1 +1 @@
1
- {"version":3,"file":"driver.js","sourceRoot":"","sources":["../../lib/driver.ts"],"names":[],"mappings":"AAaA,OAAO,EAAC,UAAU,EAAE,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAE5D,OAAO,KAAK,sBAAsB,MAAM,8BAA8B,CAAC;AACvE,OAAO,KAAK,mBAAmB,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,iBAAiB,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,YAAY,MAAM,oBAAoB,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,CAAC,UAAU,EAAE,CAAC;QAElB,MAAM,KAAK,CAAC,aAAa,EAAE,CAAC;IAC9B,CAAC;IAEO,UAAU;QAChB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,IAAI,CAAC,uBAAuB,GAAG,IAAI,6BAA6B,CAAC,4BAA4B,CAC3F,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,GAAG,CACT,CAAC;QACF,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;IAC9B,CAAC;;AAGH,eAAe,UAAU,CAAC"}
@@ -0,0 +1,41 @@
1
+ import type { IAppiumIpc } from '@appium/types';
2
+ import type { Mac2Driver } from './driver.js';
3
+ export type SessionIpcMessage = {
4
+ sessionId: string;
5
+ };
6
+ type IpcProvider = () => Promise<IAppiumIpc | undefined>;
7
+ /** Lets a new session make the previous one quit, over a driver-wide IPC (per-session IPCs are isolated). */
8
+ export declare class SessionClaimHandler {
9
+ private readonly getIpc;
10
+ private readonly releaseWaitMs;
11
+ static readonly CLAIMED_TOPIC = "mac2:sessionClaimed";
12
+ static readonly CONTENDED_TOPIC = "mac2:sessionContended";
13
+ static readonly RELEASED_TOPIC = "mac2:sessionReleased";
14
+ private static readonly STARTUP_LOCK_KEY;
15
+ private static readonly CONTENTION_PROBE_MS;
16
+ private static readonly DEFAULT_RELEASE_WAIT_MS;
17
+ private readonly startupLock;
18
+ private readonly pendingTeardowns;
19
+ private readonly subscriptionsBySessionId;
20
+ constructor(getIpc: IpcProvider, releaseWaitMs?: number);
21
+ /** Serializes session startups so the newest wins. Enter before registering the session. */
22
+ runExclusive<T>(fn: () => Promise<T>): Promise<T>;
23
+ /** Subscribe the session to claim messages from newer sessions. */
24
+ registerActiveSession(driver: Mac2Driver): Promise<void>;
25
+ /** Unsubscribe the session from claim messages. */
26
+ unregisterActiveSession(driver: Mac2Driver): void;
27
+ /** Tracks a session teardown, so that a new session does not start before it is complete. */
28
+ trackTeardown(teardown: () => Promise<void>): Promise<void>;
29
+ /** Make any other active session quit and wait until it has released the host. */
30
+ claimHost(driver: Mac2Driver): Promise<void>;
31
+ private waitForPendingTeardowns;
32
+ private requestRelease;
33
+ private dispatchClaimMessage;
34
+ private handleClaimMessage;
35
+ private terminateSession;
36
+ private publish;
37
+ private getPublisherId;
38
+ }
39
+ export declare const sessionClaimHandler: SessionClaimHandler;
40
+ export {};
41
+ //# sourceMappingURL=session-claim-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-claim-handler.d.ts","sourceRoot":"","sources":["../../lib/session-claim-handler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAe,UAAU,EAA+B,MAAM,eAAe,CAAC;AAM1F,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AAE5C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAGF,KAAK,WAAW,GAAG,MAAM,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;AAEzD,6GAA6G;AAC7G,qBAAa,mBAAmB;IAe5B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAfhC,MAAM,CAAC,QAAQ,CAAC,aAAa,yBAAyB;IACtD,MAAM,CAAC,QAAQ,CAAC,eAAe,2BAA2B;IAC1D,MAAM,CAAC,QAAQ,CAAC,cAAc,0BAA0B;IAExD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAyB;IAEjE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAM;IACjD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,uBAAuB,CAAS;IAExD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAmB;IAC/C,OAAO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