node-simctl 8.2.9 → 9.1.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 (149) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/build/lib/helpers.d.ts.map +1 -1
  3. package/build/lib/helpers.js +13 -50
  4. package/build/lib/helpers.js.map +1 -1
  5. package/build/lib/index.d.ts +2 -2
  6. package/build/lib/index.d.ts.map +1 -1
  7. package/build/lib/index.js +3 -6
  8. package/build/lib/index.js.map +1 -1
  9. package/build/lib/logger.d.ts +1 -1
  10. package/build/lib/logger.d.ts.map +1 -1
  11. package/build/lib/logger.js +3 -9
  12. package/build/lib/logger.js.map +1 -1
  13. package/build/lib/simctl.d.ts +26 -26
  14. package/build/lib/simctl.d.ts.map +1 -1
  15. package/build/lib/simctl.js +44 -88
  16. package/build/lib/simctl.js.map +1 -1
  17. package/build/lib/subcommands/addmedia.d.ts +1 -1
  18. package/build/lib/subcommands/addmedia.d.ts.map +1 -1
  19. package/build/lib/subcommands/addmedia.js +1 -4
  20. package/build/lib/subcommands/addmedia.js.map +1 -1
  21. package/build/lib/subcommands/appinfo.d.ts +2 -2
  22. package/build/lib/subcommands/appinfo.d.ts.map +1 -1
  23. package/build/lib/subcommands/appinfo.js +7 -11
  24. package/build/lib/subcommands/appinfo.js.map +1 -1
  25. package/build/lib/subcommands/boot.d.ts +1 -1
  26. package/build/lib/subcommands/boot.d.ts.map +1 -1
  27. package/build/lib/subcommands/boot.js +3 -6
  28. package/build/lib/subcommands/boot.js.map +1 -1
  29. package/build/lib/subcommands/bootstatus.d.ts +2 -2
  30. package/build/lib/subcommands/bootstatus.d.ts.map +1 -1
  31. package/build/lib/subcommands/bootstatus.js +6 -9
  32. package/build/lib/subcommands/bootstatus.js.map +1 -1
  33. package/build/lib/subcommands/create.d.ts +2 -2
  34. package/build/lib/subcommands/create.d.ts.map +1 -1
  35. package/build/lib/subcommands/create.js +9 -12
  36. package/build/lib/subcommands/create.js.map +1 -1
  37. package/build/lib/subcommands/delete.d.ts +1 -1
  38. package/build/lib/subcommands/delete.d.ts.map +1 -1
  39. package/build/lib/subcommands/delete.js +1 -4
  40. package/build/lib/subcommands/delete.js.map +1 -1
  41. package/build/lib/subcommands/erase.d.ts +1 -1
  42. package/build/lib/subcommands/erase.d.ts.map +1 -1
  43. package/build/lib/subcommands/erase.js +3 -6
  44. package/build/lib/subcommands/erase.js.map +1 -1
  45. package/build/lib/subcommands/get_app_container.d.ts +1 -1
  46. package/build/lib/subcommands/get_app_container.d.ts.map +1 -1
  47. package/build/lib/subcommands/get_app_container.js +1 -4
  48. package/build/lib/subcommands/get_app_container.js.map +1 -1
  49. package/build/lib/subcommands/getenv.d.ts +1 -1
  50. package/build/lib/subcommands/getenv.d.ts.map +1 -1
  51. package/build/lib/subcommands/getenv.js +1 -4
  52. package/build/lib/subcommands/getenv.js.map +1 -1
  53. package/build/lib/subcommands/install.d.ts +1 -1
  54. package/build/lib/subcommands/install.d.ts.map +1 -1
  55. package/build/lib/subcommands/install.js +1 -4
  56. package/build/lib/subcommands/install.js.map +1 -1
  57. package/build/lib/subcommands/io.d.ts +1 -1
  58. package/build/lib/subcommands/io.d.ts.map +1 -1
  59. package/build/lib/subcommands/io.js +9 -15
  60. package/build/lib/subcommands/io.js.map +1 -1
  61. package/build/lib/subcommands/keychain.d.ts +2 -2
  62. package/build/lib/subcommands/keychain.d.ts.map +1 -1
  63. package/build/lib/subcommands/keychain.js +12 -20
  64. package/build/lib/subcommands/keychain.js.map +1 -1
  65. package/build/lib/subcommands/launch.d.ts +1 -1
  66. package/build/lib/subcommands/launch.d.ts.map +1 -1
  67. package/build/lib/subcommands/launch.js +3 -6
  68. package/build/lib/subcommands/launch.js.map +1 -1
  69. package/build/lib/subcommands/list.d.ts +2 -2
  70. package/build/lib/subcommands/list.d.ts.map +1 -1
  71. package/build/lib/subcommands/list.js +12 -20
  72. package/build/lib/subcommands/list.js.map +1 -1
  73. package/build/lib/subcommands/location.d.ts +1 -1
  74. package/build/lib/subcommands/location.d.ts.map +1 -1
  75. package/build/lib/subcommands/location.js +2 -6
  76. package/build/lib/subcommands/location.js.map +1 -1
  77. package/build/lib/subcommands/openurl.d.ts +1 -1
  78. package/build/lib/subcommands/openurl.d.ts.map +1 -1
  79. package/build/lib/subcommands/openurl.js +1 -4
  80. package/build/lib/subcommands/openurl.js.map +1 -1
  81. package/build/lib/subcommands/pbcopy.d.ts +1 -1
  82. package/build/lib/subcommands/pbcopy.d.ts.map +1 -1
  83. package/build/lib/subcommands/pbcopy.js +1 -4
  84. package/build/lib/subcommands/pbcopy.js.map +1 -1
  85. package/build/lib/subcommands/pbpaste.d.ts +1 -1
  86. package/build/lib/subcommands/pbpaste.d.ts.map +1 -1
  87. package/build/lib/subcommands/pbpaste.js +1 -4
  88. package/build/lib/subcommands/pbpaste.js.map +1 -1
  89. package/build/lib/subcommands/privacy.d.ts +1 -1
  90. package/build/lib/subcommands/privacy.d.ts.map +1 -1
  91. package/build/lib/subcommands/privacy.js +3 -8
  92. package/build/lib/subcommands/privacy.js.map +1 -1
  93. package/build/lib/subcommands/push.d.ts +1 -1
  94. package/build/lib/subcommands/push.d.ts.map +1 -1
  95. package/build/lib/subcommands/push.js +9 -15
  96. package/build/lib/subcommands/push.js.map +1 -1
  97. package/build/lib/subcommands/shutdown.d.ts +1 -1
  98. package/build/lib/subcommands/shutdown.d.ts.map +1 -1
  99. package/build/lib/subcommands/shutdown.js +3 -6
  100. package/build/lib/subcommands/shutdown.js.map +1 -1
  101. package/build/lib/subcommands/spawn.d.ts +1 -1
  102. package/build/lib/subcommands/spawn.d.ts.map +1 -1
  103. package/build/lib/subcommands/spawn.js +2 -6
  104. package/build/lib/subcommands/spawn.js.map +1 -1
  105. package/build/lib/subcommands/terminate.d.ts +1 -1
  106. package/build/lib/subcommands/terminate.d.ts.map +1 -1
  107. package/build/lib/subcommands/terminate.js +1 -4
  108. package/build/lib/subcommands/terminate.js.map +1 -1
  109. package/build/lib/subcommands/ui.d.ts +1 -1
  110. package/build/lib/subcommands/ui.d.ts.map +1 -1
  111. package/build/lib/subcommands/ui.js +6 -14
  112. package/build/lib/subcommands/ui.js.map +1 -1
  113. package/build/lib/subcommands/uninstall.d.ts +1 -1
  114. package/build/lib/subcommands/uninstall.d.ts.map +1 -1
  115. package/build/lib/subcommands/uninstall.js +1 -4
  116. package/build/lib/subcommands/uninstall.js.map +1 -1
  117. package/build/lib/types.d.ts.map +1 -1
  118. package/build/lib/types.js +1 -2
  119. package/lib/helpers.ts +5 -5
  120. package/lib/index.ts +2 -2
  121. package/lib/logger.ts +1 -1
  122. package/lib/simctl.ts +38 -47
  123. package/lib/subcommands/addmedia.ts +3 -5
  124. package/lib/subcommands/appinfo.ts +7 -13
  125. package/lib/subcommands/boot.ts +2 -2
  126. package/lib/subcommands/bootstatus.ts +6 -15
  127. package/lib/subcommands/create.ts +6 -7
  128. package/lib/subcommands/delete.ts +1 -1
  129. package/lib/subcommands/erase.ts +2 -1
  130. package/lib/subcommands/get_app_container.ts +1 -1
  131. package/lib/subcommands/getenv.ts +1 -1
  132. package/lib/subcommands/install.ts +1 -1
  133. package/lib/subcommands/io.ts +6 -4
  134. package/lib/subcommands/keychain.ts +8 -14
  135. package/lib/subcommands/launch.ts +3 -6
  136. package/lib/subcommands/list.ts +6 -13
  137. package/lib/subcommands/location.ts +2 -6
  138. package/lib/subcommands/openurl.ts +2 -1
  139. package/lib/subcommands/pbcopy.ts +3 -6
  140. package/lib/subcommands/pbpaste.ts +2 -5
  141. package/lib/subcommands/privacy.ts +2 -6
  142. package/lib/subcommands/push.ts +6 -4
  143. package/lib/subcommands/shutdown.ts +2 -2
  144. package/lib/subcommands/spawn.ts +2 -1
  145. package/lib/subcommands/terminate.ts +1 -1
  146. package/lib/subcommands/ui.ts +1 -1
  147. package/lib/subcommands/uninstall.ts +1 -1
  148. package/lib/types.ts +1 -3
  149. package/package.json +37 -39
@@ -1,11 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAppearance = getAppearance;
4
- exports.setAppearance = setAppearance;
5
- exports.getIncreaseContrast = getIncreaseContrast;
6
- exports.setIncreaseContrast = setIncreaseContrast;
7
- exports.getContentSize = getContentSize;
8
- exports.setContentSize = setContentSize;
9
1
  /**
10
2
  * Retrieves the current UI appearance value from the given simulator
11
3
  *
@@ -15,7 +7,7 @@ exports.setContentSize = setContentSize;
15
7
  * or there was an error while getting the value
16
8
  * @throws {Error} If the `udid` instance property is unset
17
9
  */
18
- async function getAppearance() {
10
+ export async function getAppearance() {
19
11
  const { stdout } = await this.exec('ui', {
20
12
  args: [this.requireUdid('ui'), 'appearance'],
21
13
  });
@@ -30,7 +22,7 @@ async function getAppearance() {
30
22
  * or there was an error while getting the value
31
23
  * @throws {Error} If the `udid` instance property is unset
32
24
  */
33
- async function setAppearance(appearance) {
25
+ export async function setAppearance(appearance) {
34
26
  await this.exec('ui', {
35
27
  args: [this.requireUdid('ui'), 'appearance', appearance],
36
28
  });
@@ -51,7 +43,7 @@ async function setAppearance(appearance) {
51
43
  * or there was an error while getting the value.
52
44
  * @throws {Error} If the `udid` instance property is unset
53
45
  */
54
- async function getIncreaseContrast() {
46
+ export async function getIncreaseContrast() {
55
47
  const { stdout } = await this.exec('ui', {
56
48
  args: [this.requireUdid('ui'), 'increase_contrast'],
57
49
  });
@@ -70,7 +62,7 @@ async function getIncreaseContrast() {
70
62
  * or the given value was invalid for the command.
71
63
  * @throws {Error} If the `udid` instance property is unset
72
64
  */
73
- async function setIncreaseContrast(increaseContrast) {
65
+ export async function setIncreaseContrast(increaseContrast) {
74
66
  await this.exec('ui', {
75
67
  args: [this.requireUdid('ui'), 'increase_contrast', increaseContrast],
76
68
  });
@@ -96,7 +88,7 @@ async function setIncreaseContrast(increaseContrast) {
96
88
  * or there was an error while getting the value.
97
89
  * @throws {Error} If the `udid` instance property is unset
98
90
  */
99
- async function getContentSize() {
91
+ export async function getContentSize() {
100
92
  const { stdout } = await this.exec('ui', {
101
93
  args: [this.requireUdid('ui'), 'content_size'],
102
94
  });
@@ -124,7 +116,7 @@ async function getContentSize() {
124
116
  * or the given value was invalid for the command.
125
117
  * @throws {Error} If the `udid` instance property is unset
126
118
  */
127
- async function setContentSize(contentSizeAction) {
119
+ export async function setContentSize(contentSizeAction) {
128
120
  await this.exec('ui', {
129
121
  args: [this.requireUdid('ui'), 'content_size', contentSizeAction],
130
122
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ui.js","sourceRoot":"","sources":["../../../lib/subcommands/ui.ts"],"names":[],"mappings":";;AAWA,sCAKC;AAWD,sCAIC;AAkBD,kDAKC;AAeD,kDAIC;AAuBD,wCAKC;AAwBD,wCAIC;AA/HD;;;;;;;;GAQG;AACI,KAAK,UAAU,aAAa;IACjC,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;QACrC,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC;KAC7C,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;AACvB,CAAC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,aAAa,CAAe,UAAkB;IAClE,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;QACpB,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,UAAU,CAAC;KACzD,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACI,KAAK,UAAU,mBAAmB;IACvC,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;QACrC,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,mBAAmB,CAAC;KACpD,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;AACvB,CAAC;AAED;;;;;;;;;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@@
1
- import type { Simctl } from '../simctl';
1
+ import type { Simctl } from '../simctl.js';
2
2
  /**
3
3
  * Remove the particular application package from Simulator.
4
4
  * It is required that Simulator is in _booted_ state and
@@ -1 +1 @@
1
- {"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/uninstall.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AAEtC;;;;;;;;;;GAUG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI7E"}
1
+ {"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/uninstall.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEzC;;;;;;;;;;GAUG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI7E"}
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeApp = removeApp;
4
1
  /**
5
2
  * Remove the particular application package from Simulator.
6
3
  * It is required that Simulator is in _booted_ state and
@@ -12,7 +9,7 @@ exports.removeApp = removeApp;
12
9
  * returns non-zero return code.
13
10
  * @throws {Error} If the `udid` instance property is unset
14
11
  */
15
- async function removeApp(bundleId) {
12
+ export async function removeApp(bundleId) {
16
13
  await this.exec('uninstall', {
17
14
  args: [this.requireUdid('uninstall'), bundleId],
18
15
  });
@@ -1 +1 @@
1
- {"version":3,"file":"uninstall.js","sourceRoot":"","sources":["../../../lib/subcommands/uninstall.ts"],"names":[],"mappings":";;AAaA,8BAIC;AAfD;;;;;;;;;;GAUG;AACI,KAAK,UAAU,SAAS,CAAe,QAAgB;IAC5D,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;QAC3B,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC;KAChD,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"uninstall.js","sourceRoot":"","sources":["../../../lib/subcommands/uninstall.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAe,QAAgB;IAC5D,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;QAC3B,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC;KAChD,CAAC,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAE,qBAAqB,EAAC,MAAM,cAAc,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,IAAI,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAClC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;;;;;O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AC;IAChC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,eAAe,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACtC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB"}
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=types.js.map
package/lib/helpers.ts CHANGED
@@ -1,7 +1,8 @@
1
- import * as semver from 'semver';
2
1
  import {spawn} from 'node:child_process';
3
2
  import {Readable} from 'node:stream';
4
3
 
4
+ import * as semver from 'semver';
5
+
5
6
  export const DEFAULT_EXEC_TIMEOUT = 10 * 60 * 1000; // ms
6
7
  export const SIM_RUNTIME_NAME = 'com.apple.CoreSimulator.SimRuntime.';
7
8
 
@@ -61,10 +62,9 @@ export async function convertPlistToJson(plistInput: string): Promise<any> {
61
62
  });
62
63
  } catch (err) {
63
64
  plutilProcess.kill(9);
64
- throw new Error(
65
- `Failed to convert plist to JSON: ${err instanceof Error ? err.message : String(err)}`,
66
- {cause: err},
67
- );
65
+ throw new Error(`Failed to convert plist to JSON: ${err instanceof Error ? err.message : String(err)}`, {
66
+ cause: err,
67
+ });
68
68
  } finally {
69
69
  plutilProcess.removeAllListeners();
70
70
  inputStream.removeAllListeners();
package/lib/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import {Simctl} from './simctl';
1
+ import {Simctl} from './simctl.js';
2
2
  export type {
3
3
  SimctlOpts,
4
4
  DeviceInfo,
@@ -7,7 +7,7 @@ export type {
7
7
  CertOptions,
8
8
  XCRun,
9
9
  AppInfo,
10
- } from './types';
10
+ } from './types.js';
11
11
 
12
12
  export {Simctl};
13
13
  export default Simctl;
package/lib/logger.ts CHANGED
@@ -1,4 +1,4 @@
1
- import appiumLogger from '@appium/logger';
1
+ import {log as appiumLogger} from '@appium/logger';
2
2
 
3
3
  export const LOG_PREFIX = 'simctl';
4
4
 
package/lib/simctl.ts CHANGED
@@ -1,33 +1,34 @@
1
- import which from 'which';
2
- import {log, LOG_PREFIX} from './logger';
3
- import {DEFAULT_EXEC_TIMEOUT, getXcrunBinary} from './helpers';
4
1
  import {exec as tpExec, SubProcess} from 'teen_process';
5
- import * as addmediaCommands from './subcommands/addmedia';
6
- import * as appinfoCommands from './subcommands/appinfo';
7
- import * as bootCommands from './subcommands/boot';
8
- import * as bootstatusCommands from './subcommands/bootstatus';
9
- import * as createCommands from './subcommands/create';
10
- import * as deleteCommands from './subcommands/delete';
11
- import * as eraseCommands from './subcommands/erase';
12
- import * as getappcontainerCommands from './subcommands/get_app_container';
13
- import * as installCommands from './subcommands/install';
14
- import * as ioCommands from './subcommands/io';
15
- import * as keychainCommands from './subcommands/keychain';
16
- import * as launchCommands from './subcommands/launch';
17
- import * as listCommands from './subcommands/list';
18
- import * as openurlCommands from './subcommands/openurl';
19
- import * as pbcopyCommands from './subcommands/pbcopy';
20
- import * as pbpasteCommands from './subcommands/pbpaste';
21
- import * as privacyCommands from './subcommands/privacy';
22
- import * as pushCommands from './subcommands/push';
23
- import * as envCommands from './subcommands/getenv';
24
- import * as shutdownCommands from './subcommands/shutdown';
25
- import * as spawnCommands from './subcommands/spawn';
26
- import * as terminateCommands from './subcommands/terminate';
27
- import * as uiCommands from './subcommands/ui';
28
- import * as uninstallCommands from './subcommands/uninstall';
29
- import * as locationCommands from './subcommands/location';
30
- import type {XCRun, ExecOpts, SimctlOpts, ExecResult} from './types';
2
+ import which from 'which';
3
+
4
+ import {DEFAULT_EXEC_TIMEOUT, getXcrunBinary} from './helpers.js';
5
+ import {log, LOG_PREFIX} from './logger.js';
6
+ import * as addmediaCommands from './subcommands/addmedia.js';
7
+ import * as appinfoCommands from './subcommands/appinfo.js';
8
+ import * as bootCommands from './subcommands/boot.js';
9
+ import * as bootstatusCommands from './subcommands/bootstatus.js';
10
+ import * as createCommands from './subcommands/create.js';
11
+ import * as deleteCommands from './subcommands/delete.js';
12
+ import * as eraseCommands from './subcommands/erase.js';
13
+ import * as getappcontainerCommands from './subcommands/get_app_container.js';
14
+ import * as envCommands from './subcommands/getenv.js';
15
+ import * as installCommands from './subcommands/install.js';
16
+ import * as ioCommands from './subcommands/io.js';
17
+ import * as keychainCommands from './subcommands/keychain.js';
18
+ import * as launchCommands from './subcommands/launch.js';
19
+ import * as listCommands from './subcommands/list.js';
20
+ import * as locationCommands from './subcommands/location.js';
21
+ import * as openurlCommands from './subcommands/openurl.js';
22
+ import * as pbcopyCommands from './subcommands/pbcopy.js';
23
+ import * as pbpasteCommands from './subcommands/pbpaste.js';
24
+ import * as privacyCommands from './subcommands/privacy.js';
25
+ import * as pushCommands from './subcommands/push.js';
26
+ import * as shutdownCommands from './subcommands/shutdown.js';
27
+ import * as spawnCommands from './subcommands/spawn.js';
28
+ import * as terminateCommands from './subcommands/terminate.js';
29
+ import * as uiCommands from './subcommands/ui.js';
30
+ import * as uninstallCommands from './subcommands/uninstall.js';
31
+ import type {XCRun, ExecOpts, SimctlOpts, ExecResult} from './types.js';
31
32
 
32
33
  const SIMCTL_ENV_PREFIX = 'SIMCTL_CHILD_';
33
34
 
@@ -113,8 +114,7 @@ export class Simctl {
113
114
  requireUdid(commandName: string | null = null): string {
114
115
  if (!this.udid) {
115
116
  throw new Error(
116
- `udid is required to be set for ` +
117
- (commandName ? `the '${commandName}' command` : 'this simctl command'),
117
+ `udid is required to be set for ` + (commandName ? `the '${commandName}' command` : 'this simctl command'),
118
118
  );
119
119
  }
120
120
  return this.udid;
@@ -130,10 +130,7 @@ export class Simctl {
130
130
  try {
131
131
  this.xcrun.path = await which(xcrunBinary);
132
132
  } catch {
133
- throw new Error(
134
- `${xcrunBinary} tool has not been found in PATH. ` +
135
- `Are Xcode developers tools installed?`,
136
- );
133
+ throw new Error(`${xcrunBinary} tool has not been found in PATH. Are Xcode developers tools installed?`);
137
134
  }
138
135
  }
139
136
  if (!this.xcrun.path) {
@@ -163,12 +160,7 @@ export class Simctl {
163
160
  timeout,
164
161
  } = opts ?? ({} as T);
165
162
  // run a particular simctl command
166
- const args = [
167
- 'simctl',
168
- ...(this.devicesSetPath ? ['--set', this.devicesSetPath] : []),
169
- subcommand,
170
- ...initialArgs,
171
- ];
163
+ const args = ['simctl', ...(this.devicesSetPath ? ['--set', this.devicesSetPath] : []), subcommand, ...initialArgs];
172
164
  // Prefix all passed in environment variables with 'SIMCTL_CHILD_', simctl
173
165
  // will then pass these to the child (spawned) process.
174
166
  const envWithPrefixedKeys = Object.fromEntries(
@@ -190,17 +182,16 @@ export class Simctl {
190
182
  try {
191
183
  let execArgs: [string, string[], any];
192
184
  if (architectures?.length) {
193
- const archArgs = (Array.isArray(architectures) ? architectures : [architectures]).flatMap(
194
- (arch) => ['-arch', arch],
195
- );
185
+ const archArgs = (Array.isArray(architectures) ? architectures : [architectures]).flatMap((arch) => [
186
+ '-arch',
187
+ arch,
188
+ ]);
196
189
  execArgs = ['arch', [...archArgs, xcrun, ...args], execOpts];
197
190
  } else {
198
191
  execArgs = [xcrun, args, execOpts];
199
192
  }
200
193
  // We know what we are doing here - the type system can't handle the dynamic nature
201
- return (
202
- asynchronous ? new SubProcess(...execArgs) : await tpExec(...execArgs)
203
- ) as ExecResult<T>;
194
+ return (asynchronous ? new SubProcess(...execArgs) : await tpExec(...execArgs)) as ExecResult<T>;
204
195
  } catch (e: any) {
205
196
  if (!this.logErrors || !logErrors) {
206
197
  // if we don't want to see the errors, just throw and allow the calling
@@ -1,6 +1,7 @@
1
- import type {Simctl} from '../simctl';
2
1
  import type {TeenProcessExecResult} from 'teen_process';
3
2
 
3
+ import type {Simctl} from '../simctl.js';
4
+
4
5
  /**
5
6
  * Add the particular media file to Simulator's library.
6
7
  * It is required that Simulator is in _booted_ state.
@@ -12,10 +13,7 @@ import type {TeenProcessExecResult} from 'teen_process';
12
13
  * returns non-zero return code.
13
14
  * @throws {Error} If the `udid` instance property is unset
14
15
  */
15
- export async function addMedia(
16
- this: Simctl,
17
- filePath: string,
18
- ): Promise<TeenProcessExecResult<string>> {
16
+ export async function addMedia(this: Simctl, filePath: string): Promise<TeenProcessExecResult<string>> {
19
17
  return await this.exec('addmedia', {
20
18
  args: [this.requireUdid('addmedia'), filePath],
21
19
  });
@@ -1,6 +1,6 @@
1
- import type {Simctl} from '../simctl';
2
- import type {AppInfo} from '../types';
3
- import {convertPlistToJson} from '../helpers';
1
+ import {convertPlistToJson} from '../helpers.js';
2
+ import type {Simctl} from '../simctl.js';
3
+ import type {AppInfo} from '../types.js';
4
4
 
5
5
  /**
6
6
  * Get information about an app installed on the simulator
@@ -24,19 +24,13 @@ export async function appInfo(this: Simctl, bundleId: string): Promise<AppInfo>
24
24
  try {
25
25
  result = await convertPlistToJson(stdout);
26
26
  } catch (err) {
27
- throw new Error(
28
- `Cannot retrieve app info for ${bundleId}: ${err instanceof Error ? err.message : String(err)}`,
29
- {cause: err},
30
- );
27
+ throw new Error(`Cannot retrieve app info for ${bundleId}: ${err instanceof Error ? err.message : String(err)}`, {
28
+ cause: err,
29
+ });
31
30
  }
32
31
  }
33
32
 
34
- if (
35
- !result ||
36
- typeof result !== 'object' ||
37
- Array.isArray(result) ||
38
- !('ApplicationType' in result)
39
- ) {
33
+ if (!result || typeof result !== 'object' || Array.isArray(result) || !('ApplicationType' in result)) {
40
34
  throw new Error(`App with bundle identifier "${bundleId}" not found. Is it installed?`);
41
35
  }
42
36
 
@@ -1,5 +1,5 @@
1
- import {log, LOG_PREFIX} from '../logger';
2
- import type {Simctl} from '../simctl';
1
+ import {log, LOG_PREFIX} from '../logger.js';
2
+ import type {Simctl} from '../simctl.js';
3
3
 
4
4
  /**
5
5
  * Boot the particular Simulator if it is not running.
@@ -1,9 +1,10 @@
1
- import {log, LOG_PREFIX} from '../logger';
2
1
  import {waitForCondition} from 'asyncbox';
3
- import type {Simctl} from '../simctl';
4
- import type {BootMonitorOptions} from '../types';
5
2
  import type {SubProcess} from 'teen_process';
6
3
 
4
+ import {log, LOG_PREFIX} from '../logger.js';
5
+ import type {Simctl} from '../simctl.js';
6
+ import type {BootMonitorOptions} from '../types.js';
7
+
7
8
  /**
8
9
  * Start monitoring for boot status of the particular Simulator.
9
10
  * If onFinished property is not set then the method will block
@@ -16,18 +17,8 @@ import type {SubProcess} from 'teen_process';
16
17
  * property is not set.
17
18
  * @throws {Error} If the `udid` instance property is unset
18
19
  */
19
- export async function startBootMonitor(
20
- this: Simctl,
21
- opts: BootMonitorOptions = {},
22
- ): Promise<SubProcess> {
23
- const {
24
- timeout = 240000,
25
- onWaitingDataMigration,
26
- onWaitingSystemApp,
27
- onFinished,
28
- onError,
29
- shouldPreboot,
30
- } = opts;
20
+ export async function startBootMonitor(this: Simctl, opts: BootMonitorOptions = {}): Promise<SubProcess> {
21
+ const {timeout = 240000, onWaitingDataMigration, onWaitingSystemApp, onFinished, onError, shouldPreboot} = opts;
31
22
  const udid = this.requireUdid('bootstatus');
32
23
 
33
24
  const status: string[] = [];
@@ -1,8 +1,9 @@
1
- import {log, LOG_PREFIX} from '../logger';
2
1
  import {retryInterval} from 'asyncbox';
3
- import {SIM_RUNTIME_NAME, normalizeVersion} from '../helpers';
4
- import type {Simctl} from '../simctl';
5
- import type {SimCreationOpts} from '../types';
2
+
3
+ import {SIM_RUNTIME_NAME, normalizeVersion} from '../helpers.js';
4
+ import {log, LOG_PREFIX} from '../logger.js';
5
+ import type {Simctl} from '../simctl.js';
6
+ import type {SimCreationOpts} from '../types.js';
6
7
 
7
8
  const SIM_RUNTIME_NAME_SUFFIX_IOS = 'iOS';
8
9
  const DEFAULT_CREATE_SIMULATOR_TIMEOUT = 10000;
@@ -58,9 +59,7 @@ export async function createDevice(
58
59
  // add modified versions, since modern Xcodes use this, then the bare
59
60
  // versions, to accomodate older Xcodes
60
61
  runtimeIds.push(
61
- ...potentialRuntimeIds.map(
62
- (id) => `${SIM_RUNTIME_NAME}${platform}-${id.replace(/\./g, '-')}`,
63
- ),
62
+ ...potentialRuntimeIds.map((id) => `${SIM_RUNTIME_NAME}${platform}-${id.replace(/\./g, '-')}`),
64
63
  ...potentialRuntimeIds,
65
64
  );
66
65
  }
@@ -1,4 +1,4 @@
1
- import type {Simctl} from '../simctl';
1
+ import type {Simctl} from '../simctl.js';
2
2
 
3
3
  /**
4
4
  * Delete the particular Simulator from available devices list.
@@ -1,5 +1,6 @@
1
1
  import {retryInterval} from 'asyncbox';
2
- import type {Simctl} from '../simctl';
2
+
3
+ import type {Simctl} from '../simctl.js';
3
4
 
4
5
  /**
5
6
  * Reset the content and settings of the particular Simulator.
@@ -1,4 +1,4 @@
1
- import type {Simctl} from '../simctl';
1
+ import type {Simctl} from '../simctl.js';
2
2
 
3
3
  /**
4
4
  * Get the full path to the particular application container
@@ -1,4 +1,4 @@
1
- import type {Simctl} from '../simctl';
1
+ import type {Simctl} from '../simctl.js';
2
2
 
3
3
  /**
4
4
  * Retrieves the value of a Simulator environment variable
@@ -1,4 +1,4 @@
1
- import type {Simctl} from '../simctl';
1
+ import type {Simctl} from '../simctl.js';
2
2
 
3
3
  /**
4
4
  * Install the particular application package on Simulator.
@@ -1,9 +1,11 @@
1
- import {rimraf} from 'rimraf';
2
1
  import {randomUUID} from 'node:crypto';
3
- import path from 'node:path';
4
- import os from 'node:os';
5
2
  import fs from 'node:fs/promises';
6
- import type {Simctl} from '../simctl';
3
+ import os from 'node:os';
4
+ import path from 'node:path';
5
+
6
+ import {rimraf} from 'rimraf';
7
+
8
+ import type {Simctl} from '../simctl.js';
7
9
 
8
10
  /**
9
11
  * Gets base64 screenshot for device
@@ -1,10 +1,12 @@
1
- import os from 'node:os';
2
- import fs from 'node:fs/promises';
3
1
  import {randomUUID} from 'node:crypto';
2
+ import fs from 'node:fs/promises';
3
+ import os from 'node:os';
4
4
  import path from 'node:path';
5
+
5
6
  import {rimraf} from 'rimraf';
6
- import type {Simctl} from '../simctl';
7
- import type {CertOptions} from '../types';
7
+
8
+ import type {Simctl} from '../simctl.js';
9
+ import type {CertOptions} from '../types.js';
8
10
 
9
11
  /**
10
12
  * Adds the given certificate to the Trusted Root Store on the simulator
@@ -18,11 +20,7 @@ import type {CertOptions} from '../types';
18
20
  * or there was an error while adding the certificate
19
21
  * @throws {Error} If the `udid` instance property is unset
20
22
  */
21
- export async function addRootCertificate(
22
- this: Simctl,
23
- cert: string | Buffer,
24
- opts: CertOptions = {},
25
- ): Promise<void> {
23
+ export async function addRootCertificate(this: Simctl, cert: string | Buffer, opts: CertOptions = {}): Promise<void> {
26
24
  const {raw = false} = opts;
27
25
  const execMethod = async (certPath: string) =>
28
26
  await this.exec('keychain', {
@@ -47,11 +45,7 @@ export async function addRootCertificate(
47
45
  * or there was an error while adding the certificate
48
46
  * @throws {Error} If the `udid` instance property is unset
49
47
  */
50
- export async function addCertificate(
51
- this: Simctl,
52
- cert: string | Buffer,
53
- opts: CertOptions = {},
54
- ): Promise<void> {
48
+ export async function addCertificate(this: Simctl, cert: string | Buffer, opts: CertOptions = {}): Promise<void> {
55
49
  const {raw = false} = opts;
56
50
  const execMethod = async (certPath: string) =>
57
51
  await this.exec('keychain', {
@@ -1,5 +1,6 @@
1
1
  import {retryInterval} from 'asyncbox';
2
- import type {Simctl} from '../simctl';
2
+
3
+ import type {Simctl} from '../simctl.js';
3
4
 
4
5
  /**
5
6
  * Execute the particular application package on Simulator.
@@ -15,11 +16,7 @@ import type {Simctl} from '../simctl';
15
16
  * returns non-zero return code.
16
17
  * @throws {Error} If the `udid` instance property is unset
17
18
  */
18
- export async function launchApp(
19
- this: Simctl,
20
- bundleId: string,
21
- tries: number = 5,
22
- ): Promise<string> {
19
+ export async function launchApp(this: Simctl, bundleId: string, tries: number = 5): Promise<string> {
23
20
  const result = await retryInterval(tries, 1000, async () => {
24
21
  const {stdout} = await this.exec('launch', {
25
22
  args: [this.requireUdid('launch'), bundleId],
@@ -1,7 +1,7 @@
1
- import {SIM_RUNTIME_NAME, normalizeVersion} from '../helpers';
2
- import {log, LOG_PREFIX} from '../logger';
3
- import type {Simctl} from '../simctl';
4
- import type {DeviceInfo} from '../types';
1
+ import {SIM_RUNTIME_NAME, normalizeVersion} from '../helpers.js';
2
+ import {log, LOG_PREFIX} from '../logger.js';
3
+ import type {Simctl} from '../simctl.js';
4
+ import type {DeviceInfo} from '../types.js';
5
5
 
6
6
  /**
7
7
  * Parse the list of existing Simulator devices to represent
@@ -94,11 +94,7 @@ export async function getDevicesByParsing(
94
94
  * returns non-zero return code or if no matching
95
95
  * platform version is found in the system.
96
96
  */
97
- export async function getDevices(
98
- this: Simctl,
99
- forSdk: string,
100
- platform?: string | null,
101
- ): Promise<DeviceInfo[]>;
97
+ export async function getDevices(this: Simctl, forSdk: string, platform?: string | null): Promise<DeviceInfo[]>;
102
98
  export async function getDevices(
103
99
  this: Simctl,
104
100
  forSdk?: undefined | null,
@@ -227,10 +223,7 @@ export async function getRuntimeForPlatformVersion(
227
223
  args: ['runtimes'],
228
224
  });
229
225
  // https://regex101.com/r/UykjQZ/1
230
- const runtimeRe = new RegExp(
231
- `${escapeRegExp(platform)}\\s+(\\d+\\.\\d+)\\s+\\((\\d+\\.\\d+\\.*\\d*)`,
232
- 'i',
233
- );
226
+ const runtimeRe = new RegExp(`${escapeRegExp(platform)}\\s+(\\d+\\.\\d+)\\s+\\((\\d+\\.\\d+\\.*\\d*)`, 'i');
234
227
  for (const line of stdout.split('\n')) {
235
228
  const match = runtimeRe.exec(line);
236
229
  if (match && match[1] === platformVersion) {
@@ -1,4 +1,4 @@
1
- import type {Simctl} from '../simctl';
1
+ import type {Simctl} from '../simctl.js';
2
2
 
3
3
  /**
4
4
  * Set the Simulator location to a specific latitude and longitude.
@@ -10,11 +10,7 @@ import type {Simctl} from '../simctl';
10
10
  * returns non-zero return code.
11
11
  * @throws {TypeError} If any of the arguments is not a valid value.
12
12
  */
13
- export async function setLocation(
14
- this: Simctl,
15
- latitude: string | number,
16
- longitude: string | number,
17
- ): Promise<void> {
13
+ export async function setLocation(this: Simctl, latitude: string | number, longitude: string | number): Promise<void> {
18
14
  const lat = formatArg('latitude', latitude);
19
15
  const lon = formatArg('longitude', longitude);
20
16
  await this.exec('location', {
@@ -1,6 +1,7 @@
1
- import type {Simctl} from '../simctl';
2
1
  import type {TeenProcessExecResult} from 'teen_process';
3
2
 
3
+ import type {Simctl} from '../simctl.js';
4
+
4
5
  /**
5
6
  * Open URL scheme on Simulator. iOS will automatically try
6
7
  * to find a matching application, which supports the given scheme.
@@ -1,6 +1,7 @@
1
- import type {Simctl} from '../simctl';
2
1
  import type {SubProcess} from 'teen_process';
3
2
 
3
+ import type {Simctl} from '../simctl.js';
4
+
4
5
  /**
5
6
  * Set the content of Simulator pasteboard.
6
7
  * It is required that Simulator is in _booted_ state.
@@ -13,11 +14,7 @@ import type {SubProcess} from 'teen_process';
13
14
  * returns non-zero return code.
14
15
  * @throws {Error} If the `udid` instance property is unset
15
16
  */
16
- export async function setPasteboard(
17
- this: Simctl,
18
- content: string,
19
- encoding: BufferEncoding = 'utf8',
20
- ): Promise<void> {
17
+ export async function setPasteboard(this: Simctl, content: string, encoding: BufferEncoding = 'utf8'): Promise<void> {
21
18
  const pbCopySubprocess = (await this.exec('pbcopy', {
22
19
  args: [this.requireUdid('pbcopy')],
23
20
  asynchronous: true,