@limrun/appium-xcuitest-driver 10.4.3-lim.1

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 (444) hide show
  1. package/CHANGELOG.md +2600 -0
  2. package/LICENSE +201 -0
  3. package/README.md +55 -0
  4. package/build/index.d.ts +5 -0
  5. package/build/index.js +41 -0
  6. package/build/lib/app-infos-cache.d.ts +62 -0
  7. package/build/lib/app-infos-cache.d.ts.map +1 -0
  8. package/build/lib/app-infos-cache.js +180 -0
  9. package/build/lib/app-infos-cache.js.map +1 -0
  10. package/build/lib/app-utils.d.ts +89 -0
  11. package/build/lib/app-utils.d.ts.map +1 -0
  12. package/build/lib/app-utils.js +657 -0
  13. package/build/lib/app-utils.js.map +1 -0
  14. package/build/lib/commands/active-app-info.d.ts +9 -0
  15. package/build/lib/commands/active-app-info.d.ts.map +1 -0
  16. package/build/lib/commands/active-app-info.js +14 -0
  17. package/build/lib/commands/active-app-info.js.map +1 -0
  18. package/build/lib/commands/advanced-battery-types.d.ts +444 -0
  19. package/build/lib/commands/advanced-battery-types.d.ts.map +1 -0
  20. package/build/lib/commands/advanced-battery-types.js +8 -0
  21. package/build/lib/commands/advanced-battery-types.js.map +1 -0
  22. package/build/lib/commands/alert.d.ts +45 -0
  23. package/build/lib/commands/alert.d.ts.map +1 -0
  24. package/build/lib/commands/alert.js +87 -0
  25. package/build/lib/commands/alert.js.map +1 -0
  26. package/build/lib/commands/app-management.d.ts +153 -0
  27. package/build/lib/commands/app-management.d.ts.map +1 -0
  28. package/build/lib/commands/app-management.js +323 -0
  29. package/build/lib/commands/app-management.js.map +1 -0
  30. package/build/lib/commands/app-strings.d.ts +16 -0
  31. package/build/lib/commands/app-strings.d.ts.map +1 -0
  32. package/build/lib/commands/app-strings.js +30 -0
  33. package/build/lib/commands/app-strings.js.map +1 -0
  34. package/build/lib/commands/appearance.d.ts +22 -0
  35. package/build/lib/commands/appearance.d.ts.map +1 -0
  36. package/build/lib/commands/appearance.js +74 -0
  37. package/build/lib/commands/appearance.js.map +1 -0
  38. package/build/lib/commands/audit.d.ts +43 -0
  39. package/build/lib/commands/audit.d.ts.map +1 -0
  40. package/build/lib/commands/audit.js +31 -0
  41. package/build/lib/commands/audit.js.map +1 -0
  42. package/build/lib/commands/battery.d.ts +13 -0
  43. package/build/lib/commands/battery.d.ts.map +1 -0
  44. package/build/lib/commands/battery.js +49 -0
  45. package/build/lib/commands/battery.js.map +1 -0
  46. package/build/lib/commands/bidi/constants.d.ts +6 -0
  47. package/build/lib/commands/bidi/constants.d.ts.map +1 -0
  48. package/build/lib/commands/bidi/constants.js +10 -0
  49. package/build/lib/commands/bidi/constants.js.map +1 -0
  50. package/build/lib/commands/bidi/models.d.ts +9 -0
  51. package/build/lib/commands/bidi/models.d.ts.map +1 -0
  52. package/build/lib/commands/bidi/models.js +54 -0
  53. package/build/lib/commands/bidi/models.js.map +1 -0
  54. package/build/lib/commands/bidi/types.d.ts +26 -0
  55. package/build/lib/commands/bidi/types.d.ts.map +1 -0
  56. package/build/lib/commands/bidi/types.js +4 -0
  57. package/build/lib/commands/bidi/types.js.map +1 -0
  58. package/build/lib/commands/biometric.d.ts +32 -0
  59. package/build/lib/commands/biometric.d.ts.map +1 -0
  60. package/build/lib/commands/biometric.js +54 -0
  61. package/build/lib/commands/biometric.js.map +1 -0
  62. package/build/lib/commands/certificate.d.ts +50 -0
  63. package/build/lib/commands/certificate.d.ts.map +1 -0
  64. package/build/lib/commands/certificate.js +454 -0
  65. package/build/lib/commands/certificate.js.map +1 -0
  66. package/build/lib/commands/clipboard.d.ts +21 -0
  67. package/build/lib/commands/clipboard.d.ts.map +1 -0
  68. package/build/lib/commands/clipboard.js +36 -0
  69. package/build/lib/commands/clipboard.js.map +1 -0
  70. package/build/lib/commands/condition.d.ts +102 -0
  71. package/build/lib/commands/condition.d.ts.map +1 -0
  72. package/build/lib/commands/condition.js +146 -0
  73. package/build/lib/commands/condition.js.map +1 -0
  74. package/build/lib/commands/content-size.d.ts +30 -0
  75. package/build/lib/commands/content-size.d.ts.map +1 -0
  76. package/build/lib/commands/content-size.js +67 -0
  77. package/build/lib/commands/content-size.js.map +1 -0
  78. package/build/lib/commands/context.d.ts +191 -0
  79. package/build/lib/commands/context.d.ts.map +1 -0
  80. package/build/lib/commands/context.js +625 -0
  81. package/build/lib/commands/context.js.map +1 -0
  82. package/build/lib/commands/deviceInfo.d.ts +12 -0
  83. package/build/lib/commands/deviceInfo.d.ts.map +1 -0
  84. package/build/lib/commands/deviceInfo.js +25 -0
  85. package/build/lib/commands/deviceInfo.js.map +1 -0
  86. package/build/lib/commands/element.d.ts +108 -0
  87. package/build/lib/commands/element.d.ts.map +1 -0
  88. package/build/lib/commands/element.js +395 -0
  89. package/build/lib/commands/element.js.map +1 -0
  90. package/build/lib/commands/enum.d.ts +105 -0
  91. package/build/lib/commands/enum.d.ts.map +1 -0
  92. package/build/lib/commands/enum.js +113 -0
  93. package/build/lib/commands/enum.js.map +1 -0
  94. package/build/lib/commands/execute.d.ts +33 -0
  95. package/build/lib/commands/execute.d.ts.map +1 -0
  96. package/build/lib/commands/execute.js +142 -0
  97. package/build/lib/commands/execute.js.map +1 -0
  98. package/build/lib/commands/file-movement.d.ts +90 -0
  99. package/build/lib/commands/file-movement.d.ts.map +1 -0
  100. package/build/lib/commands/file-movement.js +477 -0
  101. package/build/lib/commands/file-movement.js.map +1 -0
  102. package/build/lib/commands/find.d.ts +21 -0
  103. package/build/lib/commands/find.d.ts.map +1 -0
  104. package/build/lib/commands/find.js +199 -0
  105. package/build/lib/commands/find.js.map +1 -0
  106. package/build/lib/commands/general.d.ts +137 -0
  107. package/build/lib/commands/general.d.ts.map +1 -0
  108. package/build/lib/commands/general.js +270 -0
  109. package/build/lib/commands/general.js.map +1 -0
  110. package/build/lib/commands/geolocation.d.ts +57 -0
  111. package/build/lib/commands/geolocation.d.ts.map +1 -0
  112. package/build/lib/commands/geolocation.js +58 -0
  113. package/build/lib/commands/geolocation.js.map +1 -0
  114. package/build/lib/commands/gesture.d.ts +283 -0
  115. package/build/lib/commands/gesture.d.ts.map +1 -0
  116. package/build/lib/commands/gesture.js +565 -0
  117. package/build/lib/commands/gesture.js.map +1 -0
  118. package/build/lib/commands/hid-event.d.ts +2773 -0
  119. package/build/lib/commands/hid-event.d.ts.map +1 -0
  120. package/build/lib/commands/hid-event.js +1633 -0
  121. package/build/lib/commands/hid-event.js.map +1 -0
  122. package/build/lib/commands/increase-contrast.d.ts +24 -0
  123. package/build/lib/commands/increase-contrast.d.ts.map +1 -0
  124. package/build/lib/commands/increase-contrast.js +49 -0
  125. package/build/lib/commands/increase-contrast.js.map +1 -0
  126. package/build/lib/commands/iohid.d.ts +1372 -0
  127. package/build/lib/commands/iohid.d.ts.map +1 -0
  128. package/build/lib/commands/iohid.js +63 -0
  129. package/build/lib/commands/iohid.js.map +1 -0
  130. package/build/lib/commands/keyboard.d.ts +32 -0
  131. package/build/lib/commands/keyboard.d.ts.map +1 -0
  132. package/build/lib/commands/keyboard.js +67 -0
  133. package/build/lib/commands/keyboard.js.map +1 -0
  134. package/build/lib/commands/keychains.d.ts +10 -0
  135. package/build/lib/commands/keychains.d.ts.map +1 -0
  136. package/build/lib/commands/keychains.js +22 -0
  137. package/build/lib/commands/keychains.js.map +1 -0
  138. package/build/lib/commands/localization.d.ts +17 -0
  139. package/build/lib/commands/localization.d.ts.map +1 -0
  140. package/build/lib/commands/localization.js +34 -0
  141. package/build/lib/commands/localization.js.map +1 -0
  142. package/build/lib/commands/location.d.ts +40 -0
  143. package/build/lib/commands/location.d.ts.map +1 -0
  144. package/build/lib/commands/location.js +121 -0
  145. package/build/lib/commands/location.js.map +1 -0
  146. package/build/lib/commands/lock.d.ts +23 -0
  147. package/build/lib/commands/lock.d.ts.map +1 -0
  148. package/build/lib/commands/lock.js +49 -0
  149. package/build/lib/commands/lock.js.map +1 -0
  150. package/build/lib/commands/log.d.ts +68 -0
  151. package/build/lib/commands/log.d.ts.map +1 -0
  152. package/build/lib/commands/log.js +287 -0
  153. package/build/lib/commands/log.js.map +1 -0
  154. package/build/lib/commands/memory.d.ts +11 -0
  155. package/build/lib/commands/memory.d.ts.map +1 -0
  156. package/build/lib/commands/memory.js +49 -0
  157. package/build/lib/commands/memory.js.map +1 -0
  158. package/build/lib/commands/navigation.d.ts +44 -0
  159. package/build/lib/commands/navigation.d.ts.map +1 -0
  160. package/build/lib/commands/navigation.js +121 -0
  161. package/build/lib/commands/navigation.js.map +1 -0
  162. package/build/lib/commands/notifications.d.ts +28 -0
  163. package/build/lib/commands/notifications.d.ts.map +1 -0
  164. package/build/lib/commands/notifications.js +64 -0
  165. package/build/lib/commands/notifications.js.map +1 -0
  166. package/build/lib/commands/pasteboard.d.ts +23 -0
  167. package/build/lib/commands/pasteboard.d.ts.map +1 -0
  168. package/build/lib/commands/pasteboard.js +43 -0
  169. package/build/lib/commands/pasteboard.js.map +1 -0
  170. package/build/lib/commands/pcap.d.ts +54 -0
  171. package/build/lib/commands/pcap.d.ts.map +1 -0
  172. package/build/lib/commands/pcap.js +149 -0
  173. package/build/lib/commands/pcap.js.map +1 -0
  174. package/build/lib/commands/performance.d.ts +85 -0
  175. package/build/lib/commands/performance.d.ts.map +1 -0
  176. package/build/lib/commands/performance.js +331 -0
  177. package/build/lib/commands/performance.js.map +1 -0
  178. package/build/lib/commands/permissions.d.ts +36 -0
  179. package/build/lib/commands/permissions.d.ts.map +1 -0
  180. package/build/lib/commands/permissions.js +80 -0
  181. package/build/lib/commands/permissions.js.map +1 -0
  182. package/build/lib/commands/proxy-helper.d.ts +15 -0
  183. package/build/lib/commands/proxy-helper.d.ts.map +1 -0
  184. package/build/lib/commands/proxy-helper.js +117 -0
  185. package/build/lib/commands/proxy-helper.js.map +1 -0
  186. package/build/lib/commands/record-audio.d.ts +69 -0
  187. package/build/lib/commands/record-audio.d.ts.map +1 -0
  188. package/build/lib/commands/record-audio.js +228 -0
  189. package/build/lib/commands/record-audio.js.map +1 -0
  190. package/build/lib/commands/recordscreen.d.ts +89 -0
  191. package/build/lib/commands/recordscreen.d.ts.map +1 -0
  192. package/build/lib/commands/recordscreen.js +326 -0
  193. package/build/lib/commands/recordscreen.js.map +1 -0
  194. package/build/lib/commands/screenshots.d.ts +16 -0
  195. package/build/lib/commands/screenshots.d.ts.map +1 -0
  196. package/build/lib/commands/screenshots.js +129 -0
  197. package/build/lib/commands/screenshots.js.map +1 -0
  198. package/build/lib/commands/simctl.d.ts +27 -0
  199. package/build/lib/commands/simctl.d.ts.map +1 -0
  200. package/build/lib/commands/simctl.js +65 -0
  201. package/build/lib/commands/simctl.js.map +1 -0
  202. package/build/lib/commands/source.d.ts +16 -0
  203. package/build/lib/commands/source.d.ts.map +1 -0
  204. package/build/lib/commands/source.js +128 -0
  205. package/build/lib/commands/source.js.map +1 -0
  206. package/build/lib/commands/timeouts.d.ts +53 -0
  207. package/build/lib/commands/timeouts.d.ts.map +1 -0
  208. package/build/lib/commands/timeouts.js +71 -0
  209. package/build/lib/commands/timeouts.js.map +1 -0
  210. package/build/lib/commands/types.d.ts +539 -0
  211. package/build/lib/commands/types.d.ts.map +1 -0
  212. package/build/lib/commands/types.js +3 -0
  213. package/build/lib/commands/types.js.map +1 -0
  214. package/build/lib/commands/web.d.ts +297 -0
  215. package/build/lib/commands/web.d.ts.map +1 -0
  216. package/build/lib/commands/web.js +1029 -0
  217. package/build/lib/commands/web.js.map +1 -0
  218. package/build/lib/commands/xctest-record-screen.d.ts +92 -0
  219. package/build/lib/commands/xctest-record-screen.d.ts.map +1 -0
  220. package/build/lib/commands/xctest-record-screen.js +193 -0
  221. package/build/lib/commands/xctest-record-screen.js.map +1 -0
  222. package/build/lib/commands/xctest.d.ts +71 -0
  223. package/build/lib/commands/xctest.d.ts.map +1 -0
  224. package/build/lib/commands/xctest.js +257 -0
  225. package/build/lib/commands/xctest.js.map +1 -0
  226. package/build/lib/css-converter.d.ts +10 -0
  227. package/build/lib/css-converter.d.ts.map +1 -0
  228. package/build/lib/css-converter.js +258 -0
  229. package/build/lib/css-converter.js.map +1 -0
  230. package/build/lib/desired-caps.d.ts +506 -0
  231. package/build/lib/desired-caps.d.ts.map +1 -0
  232. package/build/lib/desired-caps.js +400 -0
  233. package/build/lib/desired-caps.js.map +1 -0
  234. package/build/lib/device-connections-factory.d.ts +13 -0
  235. package/build/lib/device-connections-factory.d.ts.map +1 -0
  236. package/build/lib/device-connections-factory.js +244 -0
  237. package/build/lib/device-connections-factory.js.map +1 -0
  238. package/build/lib/device-log/helpers.d.ts +10 -0
  239. package/build/lib/device-log/helpers.d.ts.map +1 -0
  240. package/build/lib/device-log/helpers.js +37 -0
  241. package/build/lib/device-log/helpers.js.map +1 -0
  242. package/build/lib/device-log/ios-crash-log.d.ts +34 -0
  243. package/build/lib/device-log/ios-crash-log.d.ts.map +1 -0
  244. package/build/lib/device-log/ios-crash-log.js +141 -0
  245. package/build/lib/device-log/ios-crash-log.js.map +1 -0
  246. package/build/lib/device-log/ios-device-log.d.ts +19 -0
  247. package/build/lib/device-log/ios-device-log.d.ts.map +1 -0
  248. package/build/lib/device-log/ios-device-log.js +42 -0
  249. package/build/lib/device-log/ios-device-log.js.map +1 -0
  250. package/build/lib/device-log/ios-log.d.ts +24 -0
  251. package/build/lib/device-log/ios-log.d.ts.map +1 -0
  252. package/build/lib/device-log/ios-log.js +50 -0
  253. package/build/lib/device-log/ios-log.js.map +1 -0
  254. package/build/lib/device-log/ios-performance-log.d.ts +18 -0
  255. package/build/lib/device-log/ios-performance-log.d.ts.map +1 -0
  256. package/build/lib/device-log/ios-performance-log.js +43 -0
  257. package/build/lib/device-log/ios-performance-log.js.map +1 -0
  258. package/build/lib/device-log/ios-simulator-log.d.ts +38 -0
  259. package/build/lib/device-log/ios-simulator-log.d.ts.map +1 -0
  260. package/build/lib/device-log/ios-simulator-log.js +184 -0
  261. package/build/lib/device-log/ios-simulator-log.js.map +1 -0
  262. package/build/lib/device-log/line-consuming-log.d.ts +9 -0
  263. package/build/lib/device-log/line-consuming-log.d.ts.map +1 -0
  264. package/build/lib/device-log/line-consuming-log.js +16 -0
  265. package/build/lib/device-log/line-consuming-log.js.map +1 -0
  266. package/build/lib/device-log/safari-console-log.d.ts +67 -0
  267. package/build/lib/device-log/safari-console-log.d.ts.map +1 -0
  268. package/build/lib/device-log/safari-console-log.js +81 -0
  269. package/build/lib/device-log/safari-console-log.js.map +1 -0
  270. package/build/lib/device-log/safari-network-log.d.ts +75 -0
  271. package/build/lib/device-log/safari-network-log.d.ts.map +1 -0
  272. package/build/lib/device-log/safari-network-log.js +47 -0
  273. package/build/lib/device-log/safari-network-log.js.map +1 -0
  274. package/build/lib/doctor/checks.d.ts +3 -0
  275. package/build/lib/doctor/checks.d.ts.map +1 -0
  276. package/build/lib/doctor/checks.js +39 -0
  277. package/build/lib/doctor/checks.js.map +1 -0
  278. package/build/lib/doctor/optional-checks.d.ts +46 -0
  279. package/build/lib/doctor/optional-checks.d.ts.map +1 -0
  280. package/build/lib/doctor/optional-checks.js +129 -0
  281. package/build/lib/doctor/optional-checks.js.map +1 -0
  282. package/build/lib/doctor/required-checks.d.ts +42 -0
  283. package/build/lib/doctor/required-checks.d.ts.map +1 -0
  284. package/build/lib/doctor/required-checks.js +94 -0
  285. package/build/lib/doctor/required-checks.js.map +1 -0
  286. package/build/lib/doctor/utils.d.ts +8 -0
  287. package/build/lib/doctor/utils.d.ts.map +1 -0
  288. package/build/lib/doctor/utils.js +21 -0
  289. package/build/lib/doctor/utils.js.map +1 -0
  290. package/build/lib/driver.d.ts +2429 -0
  291. package/build/lib/driver.d.ts.map +1 -0
  292. package/build/lib/driver.js +1967 -0
  293. package/build/lib/driver.js.map +1 -0
  294. package/build/lib/execute-method-map.d.ts +552 -0
  295. package/build/lib/execute-method-map.d.ts.map +1 -0
  296. package/build/lib/execute-method-map.js +586 -0
  297. package/build/lib/execute-method-map.js.map +1 -0
  298. package/build/lib/ios-fs-helpers.d.ts +75 -0
  299. package/build/lib/ios-fs-helpers.d.ts.map +1 -0
  300. package/build/lib/ios-fs-helpers.js +370 -0
  301. package/build/lib/ios-fs-helpers.js.map +1 -0
  302. package/build/lib/ios-generic-simulators.d.ts +6 -0
  303. package/build/lib/ios-generic-simulators.d.ts.map +1 -0
  304. package/build/lib/ios-generic-simulators.js +14 -0
  305. package/build/lib/ios-generic-simulators.js.map +1 -0
  306. package/build/lib/logger.d.ts +3 -0
  307. package/build/lib/logger.d.ts.map +1 -0
  308. package/build/lib/logger.js +6 -0
  309. package/build/lib/logger.js.map +1 -0
  310. package/build/lib/method-map.d.ts +229 -0
  311. package/build/lib/method-map.d.ts.map +1 -0
  312. package/build/lib/method-map.js +200 -0
  313. package/build/lib/method-map.js.map +1 -0
  314. package/build/lib/real-device-clients/base-device-client.d.ts +22 -0
  315. package/build/lib/real-device-clients/base-device-client.d.ts.map +1 -0
  316. package/build/lib/real-device-clients/base-device-client.js +14 -0
  317. package/build/lib/real-device-clients/base-device-client.js.map +1 -0
  318. package/build/lib/real-device-clients/py-ios-device-client.d.ts +21 -0
  319. package/build/lib/real-device-clients/py-ios-device-client.d.ts.map +1 -0
  320. package/build/lib/real-device-clients/py-ios-device-client.js +125 -0
  321. package/build/lib/real-device-clients/py-ios-device-client.js.map +1 -0
  322. package/build/lib/real-device-management.d.ts +53 -0
  323. package/build/lib/real-device-management.d.ts.map +1 -0
  324. package/build/lib/real-device-management.js +128 -0
  325. package/build/lib/real-device-management.js.map +1 -0
  326. package/build/lib/real-device.d.ts +112 -0
  327. package/build/lib/real-device.d.ts.map +1 -0
  328. package/build/lib/real-device.js +352 -0
  329. package/build/lib/real-device.js.map +1 -0
  330. package/build/lib/simulator-management.d.ts +96 -0
  331. package/build/lib/simulator-management.d.ts.map +1 -0
  332. package/build/lib/simulator-management.js +278 -0
  333. package/build/lib/simulator-management.js.map +1 -0
  334. package/build/lib/stubs.d.ts +3 -0
  335. package/build/lib/stubs.d.ts.map +1 -0
  336. package/build/lib/stubs.js +3 -0
  337. package/build/lib/stubs.js.map +1 -0
  338. package/build/lib/types.d.ts +31 -0
  339. package/build/lib/types.d.ts.map +1 -0
  340. package/build/lib/types.js +3 -0
  341. package/build/lib/types.js.map +1 -0
  342. package/build/lib/utils.d.ts +191 -0
  343. package/build/lib/utils.d.ts.map +1 -0
  344. package/build/lib/utils.js +549 -0
  345. package/build/lib/utils.js.map +1 -0
  346. package/build/lib/xcrun.d.ts +3 -0
  347. package/build/lib/xcrun.d.ts.map +1 -0
  348. package/build/lib/xcrun.js +17 -0
  349. package/build/lib/xcrun.js.map +1 -0
  350. package/index.js +7 -0
  351. package/lib/app-infos-cache.js +187 -0
  352. package/lib/app-utils.js +710 -0
  353. package/lib/commands/active-app-info.js +12 -0
  354. package/lib/commands/advanced-battery-types.ts +454 -0
  355. package/lib/commands/alert.js +88 -0
  356. package/lib/commands/app-management.js +346 -0
  357. package/lib/commands/app-strings.js +30 -0
  358. package/lib/commands/appearance.js +71 -0
  359. package/lib/commands/audit.js +31 -0
  360. package/lib/commands/battery.js +45 -0
  361. package/lib/commands/bidi/constants.ts +6 -0
  362. package/lib/commands/bidi/models.ts +55 -0
  363. package/lib/commands/bidi/types.ts +31 -0
  364. package/lib/commands/biometric.js +53 -0
  365. package/lib/commands/certificate.js +497 -0
  366. package/lib/commands/clipboard.js +35 -0
  367. package/lib/commands/condition.js +155 -0
  368. package/lib/commands/content-size.js +68 -0
  369. package/lib/commands/context.js +705 -0
  370. package/lib/commands/deviceInfo.js +27 -0
  371. package/lib/commands/element.js +423 -0
  372. package/lib/commands/enum.ts +108 -0
  373. package/lib/commands/execute.js +153 -0
  374. package/lib/commands/file-movement.js +510 -0
  375. package/lib/commands/find.js +205 -0
  376. package/lib/commands/general.js +278 -0
  377. package/lib/commands/geolocation.js +56 -0
  378. package/lib/commands/gesture.js +596 -0
  379. package/lib/commands/hid-event.ts +1634 -0
  380. package/lib/commands/increase-contrast.js +50 -0
  381. package/lib/commands/iohid.js +64 -0
  382. package/lib/commands/keyboard.js +62 -0
  383. package/lib/commands/keychains.js +18 -0
  384. package/lib/commands/localization.js +30 -0
  385. package/lib/commands/location.js +131 -0
  386. package/lib/commands/lock.js +46 -0
  387. package/lib/commands/log.js +327 -0
  388. package/lib/commands/memory.js +51 -0
  389. package/lib/commands/navigation.js +125 -0
  390. package/lib/commands/notifications.js +66 -0
  391. package/lib/commands/pasteboard.js +42 -0
  392. package/lib/commands/pcap.js +168 -0
  393. package/lib/commands/performance.js +392 -0
  394. package/lib/commands/permissions.js +85 -0
  395. package/lib/commands/proxy-helper.js +122 -0
  396. package/lib/commands/record-audio.js +264 -0
  397. package/lib/commands/recordscreen.js +391 -0
  398. package/lib/commands/screenshots.js +137 -0
  399. package/lib/commands/simctl.js +71 -0
  400. package/lib/commands/source.js +131 -0
  401. package/lib/commands/timeouts.js +68 -0
  402. package/lib/commands/types.ts +648 -0
  403. package/lib/commands/web.js +1113 -0
  404. package/lib/commands/xctest-record-screen.js +204 -0
  405. package/lib/commands/xctest.js +285 -0
  406. package/lib/css-converter.js +311 -0
  407. package/lib/desired-caps.js +396 -0
  408. package/lib/device-connections-factory.js +269 -0
  409. package/lib/device-log/helpers.ts +40 -0
  410. package/lib/device-log/ios-crash-log.ts +166 -0
  411. package/lib/device-log/ios-device-log.ts +51 -0
  412. package/lib/device-log/ios-log.ts +70 -0
  413. package/lib/device-log/ios-performance-log.ts +50 -0
  414. package/lib/device-log/ios-simulator-log.ts +202 -0
  415. package/lib/device-log/line-consuming-log.ts +16 -0
  416. package/lib/device-log/safari-console-log.ts +117 -0
  417. package/lib/device-log/safari-network-log.ts +120 -0
  418. package/lib/doctor/checks.ts +3 -0
  419. package/lib/doctor/optional-checks.ts +173 -0
  420. package/lib/doctor/required-checks.ts +120 -0
  421. package/lib/doctor/utils.ts +18 -0
  422. package/lib/driver.js +2316 -0
  423. package/lib/execute-method-map.ts +585 -0
  424. package/lib/ios-fs-helpers.js +355 -0
  425. package/lib/ios-generic-simulators.js +11 -0
  426. package/lib/logger.js +5 -0
  427. package/lib/method-map.js +196 -0
  428. package/lib/real-device-clients/base-device-client.ts +34 -0
  429. package/lib/real-device-clients/py-ios-device-client.ts +149 -0
  430. package/lib/real-device-management.js +133 -0
  431. package/lib/real-device.js +347 -0
  432. package/lib/simulator-management.js +324 -0
  433. package/lib/stubs.ts +3 -0
  434. package/lib/types.ts +33 -0
  435. package/lib/utils.js +551 -0
  436. package/lib/xcrun.js +16 -0
  437. package/package.json +175 -0
  438. package/scripts/build-docs.js +56 -0
  439. package/scripts/build-wda.js +42 -0
  440. package/scripts/download-wda-sim.mjs +68 -0
  441. package/scripts/image-mounter.mjs +239 -0
  442. package/scripts/open-wda.mjs +15 -0
  443. package/scripts/tunnel-creation.mjs +359 -0
  444. package/scripts/utils.js +16 -0
package/lib/utils.js ADDED
@@ -0,0 +1,551 @@
1
+ import * as xcode from '@limrun/appium-xcode';
2
+ import {errors} from 'appium/driver';
3
+ import {fs, net, util} from 'appium/support';
4
+ import B from 'bluebird';
5
+ import _ from 'lodash';
6
+ import os from 'node:os';
7
+ import path from 'node:path';
8
+ import url from 'node:url';
9
+ import * as semver from 'semver';
10
+ import {exec} from 'teen_process';
11
+ import iosGenericSimulators from './ios-generic-simulators';
12
+ import log from './logger';
13
+ import {PLATFORM_NAME_TVOS, PLATFORM_NAME_IOS} from './desired-caps';
14
+
15
+ export const UDID_AUTO = 'auto';
16
+ const MODULE_NAME = 'appium-xcuitest-driver';
17
+ const DEFAULT_TIMEOUT_KEY = 'default';
18
+ const XCTEST_LOG_FILES_PATTERNS = [
19
+ /^Session-WebDriverAgentRunner.*\.log$/i,
20
+ /^StandardOutputAndStandardError\.txt$/i,
21
+ ];
22
+ const XCTEST_LOGS_CACHE_FOLDER_PREFIX = 'com.apple.dt.XCTest';
23
+ export const NATIVE_WIN = 'NATIVE_APP';
24
+
25
+ /**
26
+ * @privateRemarks Is the minimum version really Xcode 7.3?
27
+ * @returns {Promise<XcodeVersion>}
28
+ */
29
+ async function getAndCheckXcodeVersion() {
30
+ /** @type {XcodeVersion} */
31
+ let version;
32
+ try {
33
+ version = /** @type {XcodeVersion} */ (await xcode.getVersion(true));
34
+ } catch (err) {
35
+ log.error(err);
36
+ throw new Error(`Could not determine Xcode version: ${err.message}`);
37
+ }
38
+
39
+ // we do not support Xcodes < 7.3,
40
+ if (version.versionFloat < 7.3) {
41
+ const msg = `Xcode ${version.versionString} is not supported. Please upgrade to version 7.3 or higher`;
42
+ log.error(msg);
43
+ throw new Error(msg);
44
+ }
45
+ return version;
46
+ }
47
+
48
+ /**
49
+ * @returns {Promise<string|null>}
50
+ */
51
+ async function getAndCheckIosSdkVersion() {
52
+ try {
53
+ return '26';
54
+ return await xcode.getMaxIOSSDK();
55
+ } catch (err) {
56
+ throw log.errorWithException(`Could not determine iOS SDK version: ${err.message}`);
57
+ }
58
+ }
59
+
60
+ /**
61
+ * Get the generic simulator for a given IOS version and device type (iPhone, iPad)
62
+ *
63
+ * @param {string|number} platformVersion IOS version. e.g.) 13.0
64
+ * @param {string} deviceName Type of IOS device. Can be iPhone, iPad (possibly more in the future)
65
+ *
66
+ * @returns {string?} Generic iPhone or iPad simulator (if applicable)
67
+ */
68
+ function getGenericSimulatorForIosVersion(platformVersion, deviceName) {
69
+ const genericSimulators = iosGenericSimulators[deviceName];
70
+ if (!genericSimulators) {
71
+ return null;
72
+ }
73
+
74
+ // Find the highest iOS version in the list that is below the provided version
75
+ let result = null;
76
+ const compareVersions = ([simOne], [simTwo]) =>
77
+ util.compareVersions(simOne, '<', simTwo) ? -1 : 1;
78
+ for (const [platformVersionFromList, iosSimulator] of genericSimulators.sort(compareVersions)) {
79
+ if (util.compareVersions(platformVersionFromList, '>', String(platformVersion))) {
80
+ break;
81
+ }
82
+ result = iosSimulator;
83
+ }
84
+ return result;
85
+ }
86
+
87
+ /**
88
+ *
89
+ * @param {string} platformVersion
90
+ * @param {string} deviceName
91
+ * @returns {string}
92
+ */
93
+ function translateDeviceName(platformVersion, deviceName) {
94
+ if (!deviceName) {
95
+ return deviceName;
96
+ }
97
+ const deviceNameTranslated = getGenericSimulatorForIosVersion(
98
+ platformVersion,
99
+ `${deviceName}`.toLowerCase().trim(),
100
+ );
101
+ if (!deviceNameTranslated) {
102
+ return deviceName;
103
+ }
104
+
105
+ log.debug(`Changing deviceName from '${deviceName}' to '${deviceNameTranslated}'`);
106
+ return deviceNameTranslated;
107
+ }
108
+
109
+ /**
110
+ * @param {string[]} locations
111
+ * @returns {Promise<void>}
112
+ */
113
+ async function clearLogs(locations) {
114
+ log.debug('Clearing log files');
115
+ const cleanupPromises = [];
116
+ for (const location of locations) {
117
+ if (!(await fs.exists(location))) {
118
+ continue;
119
+ }
120
+
121
+ cleanupPromises.push(
122
+ (async () => {
123
+ let size;
124
+ try {
125
+ const {stdout} = await exec('du', ['-sh', location]);
126
+ size = stdout.trim().split(/\s+/)[0];
127
+ } catch {}
128
+ try {
129
+ log.debug(`Deleting '${location}'. ${size ? `Freeing ${size}.` : ''}`);
130
+ await fs.rimraf(location);
131
+ } catch (err) {
132
+ log.warn(`Unable to delete '${location}': ${err.message}`);
133
+ }
134
+ })(),
135
+ );
136
+ }
137
+ if (!_.isEmpty(cleanupPromises)) {
138
+ await B.all(cleanupPromises);
139
+ }
140
+ log.debug('Finished clearing log files');
141
+ }
142
+
143
+ // This map contains derived data logs folders as keys
144
+ // and values are the count of times the particular
145
+ // folder has been scheduled for removal
146
+ const derivedDataCleanupMarkers = new Map();
147
+
148
+ async function markSystemFilesForCleanup(wda) {
149
+ if (!wda || !(await wda.retrieveDerivedDataPath())) {
150
+ log.warn(
151
+ 'No WebDriverAgent derived data available, so unable to mark system files for cleanup',
152
+ );
153
+ return;
154
+ }
155
+
156
+ const logsRoot = path.resolve(await wda.retrieveDerivedDataPath(), 'Logs');
157
+ let markersCount = 0;
158
+ if (derivedDataCleanupMarkers.has(logsRoot)) {
159
+ markersCount = derivedDataCleanupMarkers.get(logsRoot);
160
+ }
161
+ derivedDataCleanupMarkers.set(logsRoot, ++markersCount);
162
+ }
163
+
164
+ async function clearSystemFiles(wda) {
165
+ // only want to clear the system files for the particular WDA xcode run
166
+ if (!wda || !(await wda.retrieveDerivedDataPath())) {
167
+ log.warn('No WebDriverAgent derived data available, so unable to clear system files');
168
+ return;
169
+ }
170
+
171
+ const logsRoot = path.resolve(await wda.retrieveDerivedDataPath(), 'Logs');
172
+ if (derivedDataCleanupMarkers.has(logsRoot)) {
173
+ let markersCount = derivedDataCleanupMarkers.get(logsRoot);
174
+ derivedDataCleanupMarkers.set(logsRoot, --markersCount);
175
+ if (markersCount > 0) {
176
+ log.info(
177
+ `Not cleaning '${logsRoot}' folder, because the other session does not expect it to be cleaned`,
178
+ );
179
+ return;
180
+ }
181
+ }
182
+ derivedDataCleanupMarkers.set(logsRoot, 0);
183
+
184
+ // Cleaning up big temporary files created by XCTest: https://github.com/appium/appium/issues/9410
185
+ const globPattern = `${os.tmpdir()}/${XCTEST_LOGS_CACHE_FOLDER_PREFIX}*/`;
186
+ const dstFolders = await fs.glob(globPattern);
187
+ if (_.isEmpty(dstFolders)) {
188
+ log.debug(`Did not find the temporary XCTest logs root at '${globPattern}'`);
189
+ } else {
190
+ // perform the cleanup asynchronously
191
+ /** @type {Promise[]} */
192
+ const promises = [];
193
+ for (const dstFolder of dstFolders) {
194
+ const promise = (async () => {
195
+ try {
196
+ await fs.walkDir(dstFolder, true, (itemPath, isDir) => {
197
+ if (isDir) {
198
+ return;
199
+ }
200
+ const fileName = path.basename(itemPath);
201
+ if (XCTEST_LOG_FILES_PATTERNS.some((p) => p.test(fileName))) {
202
+ fs.rimraf(itemPath);
203
+ }
204
+ });
205
+ } catch (e) {
206
+ log.debug(e.stack);
207
+ log.info(e.message);
208
+ }
209
+ })();
210
+ promises.push(promise);
211
+ }
212
+ log.debug(`Started XCTest logs cleanup in '${dstFolders}'`);
213
+ if (promises.length) {
214
+ await B.all(promises);
215
+ }
216
+ }
217
+
218
+ if (await fs.exists(logsRoot)) {
219
+ log.info(`Cleaning test logs in '${logsRoot}' folder`);
220
+ await clearLogs([logsRoot]);
221
+ return;
222
+ }
223
+ log.info(`There is no ${logsRoot} folder, so not cleaning files`);
224
+ }
225
+
226
+ async function checkAppPresent(app) {
227
+ log.debug(`Checking whether app '${app}' is actually present on file system`);
228
+ if (!(await fs.exists(app))) {
229
+ throw log.errorWithException(`Could not find app at '${app}'`);
230
+ }
231
+ log.debug('App is present');
232
+ }
233
+
234
+ /**
235
+ * Reads the content to the current module's package.json
236
+ *
237
+ * @returns {Promise<Record<string, any>>} The full path to module root
238
+ * @throws {Error} If the current module's package.json cannot be determined
239
+ */
240
+ const getModuleManifest = _.memoize(async function getModuleManifest() {
241
+ let currentDir = path.dirname(path.resolve(__filename));
242
+ let isAtFsRoot = false;
243
+ while (!isAtFsRoot) {
244
+ const manifestPath = path.join(currentDir, 'package.json');
245
+ try {
246
+ if (await fs.exists(manifestPath)) {
247
+ const manifest = JSON.parse(await fs.readFile(manifestPath, 'utf8'));
248
+ if (manifest.name === MODULE_NAME) {
249
+ return manifest;
250
+ }
251
+ }
252
+ } catch {}
253
+ currentDir = path.dirname(currentDir);
254
+ isAtFsRoot = currentDir.length <= path.dirname(currentDir).length;
255
+ }
256
+ throw new Error(`Cannot find the package manifest of the ${MODULE_NAME} Node.js module`);
257
+ });
258
+
259
+ /**
260
+ * @typedef {Object} DriverInfo
261
+ * @property {string} version Driver version string
262
+ * @property {string} built Driver build timestamp
263
+ */
264
+
265
+ /**
266
+ * @returns {DriverInfo}
267
+ */
268
+ const getDriverInfo = _.memoize(async function getDriverInfo() {
269
+ const [stat, manifest] = await B.all([
270
+ fs.stat(path.resolve(__dirname, '..')),
271
+ getModuleManifest(),
272
+ ]);
273
+ return {
274
+ built: stat.mtime.toString(),
275
+ version: manifest.version,
276
+ };
277
+ });
278
+
279
+ function normalizeCommandTimeouts(value) {
280
+ // The value is normalized already
281
+ if (typeof value !== 'string') {
282
+ return value;
283
+ }
284
+
285
+ let result = {};
286
+ // Use as default timeout for all commands if a single integer value is provided
287
+ if (!isNaN(Number(value))) {
288
+ result[DEFAULT_TIMEOUT_KEY] = _.toInteger(value);
289
+ return result;
290
+ }
291
+
292
+ // JSON object has been provided. Let's parse it
293
+ try {
294
+ result = JSON.parse(value);
295
+ if (!_.isPlainObject(result)) {
296
+ throw new Error();
297
+ }
298
+ } catch {
299
+ throw log.errorWithException(
300
+ `"commandTimeouts" capability should be a valid JSON object. "${value}" was given instead`,
301
+ );
302
+ }
303
+ for (let [cmd, timeout] of _.toPairs(result)) {
304
+ if (!_.isInteger(timeout) || timeout <= 0) {
305
+ throw log.errorWithException(
306
+ `The timeout for "${cmd}" should be a valid natural number of milliseconds. "${timeout}" was given instead`,
307
+ );
308
+ }
309
+ }
310
+ return result;
311
+ }
312
+
313
+ async function printUser() {
314
+ try {
315
+ let {stdout} = await exec('whoami');
316
+ log.debug(`Current user: '${stdout.trim()}'`);
317
+ } catch (err) {
318
+ log.debug(`Unable to get username running server: ${err.message}`);
319
+ }
320
+ }
321
+
322
+ /**
323
+ * Get the IDs of processes listening on the particular system port.
324
+ * It is also possible to apply additional filtering based on the
325
+ * process command line.
326
+ *
327
+ * @param {string|number} port - The port number.
328
+ * @param {?Function} filteringFunc - Optional lambda function, which
329
+ * receives command line string of the particular process
330
+ * listening on given port, and is expected to return
331
+ * either true or false to include/exclude the corresponding PID
332
+ * from the resulting array.
333
+ * @returns {Promise<string[]>} - the list of matched process ids.
334
+ */
335
+ async function getPIDsListeningOnPort(port, filteringFunc = null) {
336
+ const result = [];
337
+ try {
338
+ // This only works since Mac OS X El Capitan
339
+ const {stdout} = await exec('lsof', ['-ti', `tcp:${port}`]);
340
+ result.push(...stdout.trim().split(/\n+/));
341
+ } catch {
342
+ return result;
343
+ }
344
+
345
+ if (!_.isFunction(filteringFunc)) {
346
+ return result;
347
+ }
348
+ return await B.filter(result, async (x) => {
349
+ const {stdout} = await exec('ps', ['-p', x, '-o', 'command']);
350
+ return await filteringFunc(stdout);
351
+ });
352
+ }
353
+
354
+ /**
355
+ * @typedef {Object} UploadOptions
356
+ *
357
+ * @property {string} [user] - The name of the user for the remote authentication. Only works if `remotePath` is provided.
358
+ * @property {string} [pass] - The password for the remote authentication. Only works if `remotePath` is provided.
359
+ * @property {import('axios').Method} [method] - The http multipart upload method name. The 'PUT' one is used by default.
360
+ * Only works if `remotePath` is provided.
361
+ * @property {import('@appium/types').HTTPHeaders} [headers] - Additional headers mapping for multipart http(s) uploads
362
+ * @property {string} [fileFieldName] [file] - The name of the form field, where the file content BLOB should be stored for
363
+ * http(s) uploads
364
+ * @property {Record<string, any> | [string, any][]} [formFields] - Additional form fields for multipart http(s) uploads
365
+ */
366
+
367
+ /**
368
+ * Encodes the given local file to base64 and returns the resulting string
369
+ * or uploads it to a remote server using http/https or ftp protocols
370
+ * if `remotePath` is set
371
+ *
372
+ * @param {string} localPath - The path to an existing local file
373
+ * @param {string|null} [remotePath] - The path to the remote location, where
374
+ * this file should be uploaded
375
+ * @param {UploadOptions} uploadOptions - Set of upload options
376
+ * @returns {Promise<string>} Either an empty string if the upload was successful or
377
+ * base64-encoded file representation if `remotePath` is falsy
378
+ */
379
+ async function encodeBase64OrUpload(localPath, remotePath = null, uploadOptions = {}) {
380
+ if (!(await fs.exists(localPath))) {
381
+ throw log.errorWithException(`The file at '${localPath}' does not exist or is not accessible`);
382
+ }
383
+
384
+ if (_.isEmpty(remotePath)) {
385
+ const {size} = await fs.stat(localPath);
386
+ log.debug(`The size of the file is ${util.toReadableSizeString(size)}`);
387
+ return (await util.toInMemoryBase64(localPath)).toString();
388
+ }
389
+
390
+ const {user, pass, method, headers, fileFieldName, formFields} = uploadOptions;
391
+ const options = {
392
+ method: method || 'PUT',
393
+ headers,
394
+ fileFieldName,
395
+ formFields,
396
+ };
397
+ if (user && pass) {
398
+ options.auth = {user, pass};
399
+ }
400
+ await net.uploadFile(localPath, /** @type {string} */ (remotePath), options);
401
+ return '';
402
+ }
403
+
404
+ /**
405
+ * Stops and removes all web socket handlers that are listening
406
+ * in scope of the current session.
407
+ *
408
+ * @this {XCUITestDriver}
409
+ * @returns {Promise<void>}
410
+ */
411
+ export async function removeAllSessionWebSocketHandlers() {
412
+ if (!this.sessionId || !_.isFunction(this.server?.getWebSocketHandlers)) {
413
+ return;
414
+ }
415
+
416
+ const activeHandlers = await this.server.getWebSocketHandlers(this.sessionId);
417
+ for (const pathname of _.keys(activeHandlers)) {
418
+ await this.server.removeWebSocketHandler(pathname);
419
+ }
420
+ }
421
+
422
+ /**
423
+ * Returns true if the urlString is localhost
424
+ * @param {string} urlString
425
+ * @returns {boolean} Return true if the urlString is localhost
426
+ */
427
+ function isLocalHost(urlString) {
428
+ try {
429
+ const hostname = /** @type {string} */ (url.parse(urlString).hostname);
430
+ return ['localhost', '127.0.0.1', '::1', '::ffff:127.0.0.1'].includes(hostname);
431
+ } catch {
432
+ log.warn(`'${urlString}' cannot be parsed as a valid URL`);
433
+ }
434
+ return false;
435
+ }
436
+
437
+ /**
438
+ * Normalizes platformVersion to a valid iOS version string
439
+ *
440
+ * @param {string} originalVersion - Loose version number, that can be parsed by semver
441
+ * @return {string} iOS version number in <major>.<minor> format
442
+ * @throws {Error} if the version number cannot be parsed
443
+ */
444
+ function normalizePlatformVersion(originalVersion) {
445
+ const normalizedVersion = semver.coerce(originalVersion);
446
+ if (!normalizedVersion) {
447
+ throw new Error(`The platform version '${originalVersion}' should be a valid version number`);
448
+ }
449
+ return `${normalizedVersion.major}.${normalizedVersion.minor}`;
450
+ }
451
+
452
+ /**
453
+ * Assert the presence of particular keys in the given object
454
+ *
455
+ * @param {string|Array<string>} argNames one or more key names
456
+ * @param {Object} opts the object to check
457
+ * @returns {Object} the same given object
458
+ */
459
+ function requireArgs(argNames, opts = {}) {
460
+ for (const argName of _.isArray(argNames) ? argNames : [argNames]) {
461
+ if (!_.has(opts, argName)) {
462
+ throw new errors.InvalidArgumentError(`'${argName}' argument must be provided`);
463
+ }
464
+ }
465
+ return opts;
466
+ }
467
+
468
+ /**
469
+ * Asserts that the given driver is running on a Simulator and return
470
+ * the simlator instance.
471
+ *
472
+ * @param {string} action - Description of action
473
+ * @param {import('./driver').XCUITestDriver} driver
474
+ * @returns {Simulator}
475
+ */
476
+ export function assertSimulator(action, driver) {
477
+ if (!driver.isSimulator()) {
478
+ throw new Error(`${_.upperFirst(action)} can only be performed on Simulator`);
479
+ }
480
+ return /** @type{Simulator} */ (driver.device);
481
+ }
482
+
483
+ /**
484
+ * Check if platform name is the TV OS one.
485
+ *
486
+ * @param {string|null|undefined} platformName
487
+ * @returns {boolean}
488
+ */
489
+ export function isTvOs(platformName) {
490
+ return _.toLower(platformName ?? '') === _.toLower(PLATFORM_NAME_TVOS);
491
+ }
492
+
493
+ /**
494
+ * Return normalized platform name.
495
+ *
496
+ * @param {string|null|undefined} platformName
497
+ * @returns {string}
498
+ */
499
+ export function normalizePlatformName(platformName) {
500
+ return isTvOs(platformName) ? PLATFORM_NAME_TVOS : PLATFORM_NAME_IOS;
501
+ }
502
+
503
+ /**
504
+ * @param {import('./driver').XCUITestDriverOpts} opts
505
+ * @returns {boolean}
506
+ */
507
+ export function shouldSetInitialSafariUrl(opts) {
508
+ return !(opts.safariInitialUrl === '' || (opts.noReset && _.isNil(opts.safariInitialUrl)))
509
+ && !opts.initialDeeplinkUrl;
510
+ }
511
+
512
+ /**
513
+ * @param {import('./driver').XCUITestDriverOpts} opts
514
+ * @returns {boolean}
515
+ */
516
+ export function isIos17OrNewer(opts) {
517
+ return !!opts.platformVersion && util.compareVersions(opts.platformVersion, '>=', '17.0');
518
+ }
519
+
520
+ /**
521
+ * @param {import('./driver').XCUITestDriverOpts} opts
522
+ * @returns {boolean}
523
+ */
524
+ export function isIos18OrNewer(opts) {
525
+ return !!opts.platformVersion && util.compareVersions(opts.platformVersion, '>=', '18.0');
526
+ }
527
+
528
+ export {
529
+ getAndCheckXcodeVersion,
530
+ getAndCheckIosSdkVersion,
531
+ checkAppPresent,
532
+ getDriverInfo,
533
+ clearSystemFiles,
534
+ translateDeviceName,
535
+ normalizeCommandTimeouts,
536
+ DEFAULT_TIMEOUT_KEY,
537
+ markSystemFilesForCleanup,
538
+ printUser,
539
+ getPIDsListeningOnPort,
540
+ encodeBase64OrUpload,
541
+ isLocalHost,
542
+ normalizePlatformVersion,
543
+ clearLogs,
544
+ requireArgs,
545
+ };
546
+
547
+ /**
548
+ * @typedef {import('@limrun/appium-xcode').XcodeVersion} XcodeVersion
549
+ * @typedef {import('@limrun/appium-ios-simulator').Simulator} Simulator
550
+ * @typedef {import('./driver').XCUITestDriver} XCUITestDriver
551
+ */
package/lib/xcrun.js ADDED
@@ -0,0 +1,16 @@
1
+ import {fs} from 'appium/support';
2
+
3
+ const XCRUN = 'xcrun';
4
+
5
+ async function requireXcrun() {
6
+ try {
7
+ return await fs.which(XCRUN);
8
+ } catch {
9
+ throw new Error(
10
+ `${XCRUN} has not been found in PATH. ` +
11
+ `Please make sure XCode development tools are installed`,
12
+ );
13
+ }
14
+ }
15
+
16
+ export {requireXcrun, XCRUN};