node-simctl 7.3.2 → 7.3.4

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 (51) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/build/lib/helpers.d.ts +6 -3
  3. package/build/lib/helpers.d.ts.map +1 -1
  4. package/build/lib/helpers.js +8 -5
  5. package/build/lib/helpers.js.map +1 -1
  6. package/build/lib/simctl.d.ts +50 -38
  7. package/build/lib/simctl.d.ts.map +1 -1
  8. package/build/lib/simctl.js +25 -18
  9. package/build/lib/simctl.js.map +1 -1
  10. package/build/lib/subcommands/bootstatus.d.ts +16 -16
  11. package/build/lib/subcommands/bootstatus.d.ts.map +1 -1
  12. package/build/lib/subcommands/bootstatus.js +7 -7
  13. package/build/lib/subcommands/create.d.ts +9 -9
  14. package/build/lib/subcommands/create.d.ts.map +1 -1
  15. package/build/lib/subcommands/create.js +3 -3
  16. package/build/lib/subcommands/erase.d.ts +2 -2
  17. package/build/lib/subcommands/erase.d.ts.map +1 -1
  18. package/build/lib/subcommands/erase.js +1 -1
  19. package/build/lib/subcommands/get_app_container.d.ts +2 -2
  20. package/build/lib/subcommands/get_app_container.d.ts.map +1 -1
  21. package/build/lib/subcommands/get_app_container.js +1 -1
  22. package/build/lib/subcommands/keychain.d.ts +7 -7
  23. package/build/lib/subcommands/keychain.d.ts.map +1 -1
  24. package/build/lib/subcommands/keychain.js +3 -3
  25. package/build/lib/subcommands/launch.d.ts +2 -2
  26. package/build/lib/subcommands/launch.d.ts.map +1 -1
  27. package/build/lib/subcommands/launch.js +1 -1
  28. package/build/lib/subcommands/list.d.ts +9 -9
  29. package/build/lib/subcommands/list.d.ts.map +1 -1
  30. package/build/lib/subcommands/list.js +5 -5
  31. package/build/lib/subcommands/pbcopy.d.ts +2 -2
  32. package/build/lib/subcommands/pbcopy.d.ts.map +1 -1
  33. package/build/lib/subcommands/pbcopy.js +1 -1
  34. package/build/lib/subcommands/pbpaste.d.ts +2 -2
  35. package/build/lib/subcommands/pbpaste.d.ts.map +1 -1
  36. package/build/lib/subcommands/pbpaste.js +1 -1
  37. package/build/lib/subcommands/spawn.d.ts +2 -2
  38. package/build/lib/subcommands/spawn.js +2 -2
  39. package/lib/helpers.js +9 -9
  40. package/lib/simctl.js +29 -20
  41. package/lib/subcommands/bootstatus.js +7 -7
  42. package/lib/subcommands/create.js +3 -3
  43. package/lib/subcommands/erase.js +1 -1
  44. package/lib/subcommands/get_app_container.js +1 -1
  45. package/lib/subcommands/keychain.js +3 -3
  46. package/lib/subcommands/launch.js +1 -1
  47. package/lib/subcommands/list.js +5 -5
  48. package/lib/subcommands/pbcopy.js +1 -1
  49. package/lib/subcommands/pbpaste.js +1 -1
  50. package/lib/subcommands/spawn.js +2 -2
  51. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [7.3.4](https://github.com/appium/node-simctl/compare/v7.3.3...v7.3.4) (2023-09-01)
2
+
3
+
4
+ ### Miscellaneous Chores
5
+
6
+ * Improve type declarations ([#198](https://github.com/appium/node-simctl/issues/198)) ([314df12](https://github.com/appium/node-simctl/commit/314df12dfa9f2e7afa06d67f211b3dffe84755dc))
7
+
8
+ ## [7.3.3](https://github.com/appium/node-simctl/compare/v7.3.2...v7.3.3) (2023-08-31)
9
+
10
+
11
+ ### Miscellaneous Chores
12
+
13
+ * **deps:** bump which from 3.0.1 to 4.0.0 ([#197](https://github.com/appium/node-simctl/issues/197)) ([fa2d8c3](https://github.com/appium/node-simctl/commit/fa2d8c344cc8623af2504fd8bc103f1e948183f4))
14
+
1
15
  ## [7.3.2](https://github.com/appium/node-simctl/compare/v7.3.1...v7.3.2) (2023-08-28)
2
16
 
3
17
 
@@ -1,6 +1,3 @@
1
- export function getXcrunBinary(): string;
2
- export const DEFAULT_EXEC_TIMEOUT: number;
3
- export const SIM_RUNTIME_NAME: "com.apple.CoreSimulator.SimRuntime.";
4
1
  /**
5
2
  * "Normalize" the version, since iOS uses 'major.minor' but the runtimes can
6
3
  * be 'major.minor.patch'
@@ -10,4 +7,10 @@ export const SIM_RUNTIME_NAME: "com.apple.CoreSimulator.SimRuntime.";
10
7
  * @throws {Error} If the version not parseable by the `semver` package
11
8
  */
12
9
  export function normalizeVersion(version: string): string;
10
+ /**
11
+ * @returns {string}
12
+ */
13
+ export function getXcrunBinary(): string;
14
+ export const DEFAULT_EXEC_TIMEOUT: number;
15
+ export const SIM_RUNTIME_NAME: "com.apple.CoreSimulator.SimRuntime.";
13
16
  //# sourceMappingURL=helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../lib/helpers.js"],"names":[],"mappings":"AA0BO,yCAAgE;AAxBvE,0CAA4C;AAC5C,qEAA+D;AAE/D;;;;;;;GAOG;AACH,0CAJW,MAAM,GACL,MAAM,CASjB"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../lib/helpers.js"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,0CAJW,MAAM,GACL,MAAM,CASjB;AAED;;GAEG;AACH,kCAFa,MAAM,CAIlB;AAxBD,0CAAmD;AACnD,qEAAsE"}
@@ -5,10 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getXcrunBinary = exports.normalizeVersion = exports.SIM_RUNTIME_NAME = exports.DEFAULT_EXEC_TIMEOUT = void 0;
7
7
  const semver_1 = __importDefault(require("semver"));
8
- const DEFAULT_EXEC_TIMEOUT = 10 * 60 * 1000; // ms
9
- exports.DEFAULT_EXEC_TIMEOUT = DEFAULT_EXEC_TIMEOUT;
10
- const SIM_RUNTIME_NAME = 'com.apple.CoreSimulator.SimRuntime.';
11
- exports.SIM_RUNTIME_NAME = SIM_RUNTIME_NAME;
8
+ exports.DEFAULT_EXEC_TIMEOUT = 10 * 60 * 1000; // ms
9
+ exports.SIM_RUNTIME_NAME = 'com.apple.CoreSimulator.SimRuntime.';
12
10
  /**
13
11
  * "Normalize" the version, since iOS uses 'major.minor' but the runtimes can
14
12
  * be 'major.minor.patch'
@@ -25,6 +23,11 @@ function normalizeVersion(version) {
25
23
  return `${semverVersion.major}.${semverVersion.minor}`;
26
24
  }
27
25
  exports.normalizeVersion = normalizeVersion;
28
- const getXcrunBinary = () => process.env.XCRUN_BINARY || 'xcrun';
26
+ /**
27
+ * @returns {string}
28
+ */
29
+ function getXcrunBinary() {
30
+ return process.env.XCRUN_BINARY || 'xcrun';
31
+ }
29
32
  exports.getXcrunBinary = getXcrunBinary;
30
33
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../lib/helpers.js"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,MAAM,oBAAoB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,KAAK;AAoBhD,oDAAoB;AAnBtB,MAAM,gBAAgB,GAAG,qCAAqC,CAAC;AAmBvC,4CAAgB;AAjBxC;;;;;;;GAOG;AACH,SAAS,gBAAgB,CAAE,OAAO;IAChC,MAAM,aAAa,GAAG,gBAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC7C,IAAI,CAAC,aAAa,EAAE;QAClB,MAAM,IAAI,KAAK,CAAC,4BAA4B,OAAO,GAAG,CAAC,CAAC;KACzD;IACD,OAAO,GAAG,aAAa,CAAC,KAAK,IAAI,aAAa,CAAC,KAAK,EAAE,CAAC;AACzD,CAAC;AAIC,4CAAgB;AAGX,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,OAAO,CAAC;AAA3D,QAAA,cAAc,kBAA6C"}
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../lib/helpers.js"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAEf,QAAA,oBAAoB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,KAAK;AAC5C,QAAA,gBAAgB,GAAG,qCAAqC,CAAC;AAEtE;;;;;;;GAOG;AACH,SAAgB,gBAAgB,CAAE,OAAO;IACvC,MAAM,aAAa,GAAG,gBAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC7C,IAAI,CAAC,aAAa,EAAE;QAClB,MAAM,IAAI,KAAK,CAAC,4BAA4B,OAAO,GAAG,CAAC,CAAC;KACzD;IACD,OAAO,GAAG,aAAa,CAAC,KAAK,IAAI,aAAa,CAAC,KAAK,EAAE,CAAC;AACzD,CAAC;AAND,4CAMC;AAED;;GAEG;AACH,SAAgB,cAAc;IAC5B,OAAO,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,OAAO,CAAC;AAC7C,CAAC;AAFD,wCAEC"}
@@ -1,35 +1,41 @@
1
1
  export default Simctl;
2
+ export type XCRun = {
3
+ /**
4
+ * Full path to the xcrun script
5
+ */
6
+ path: string | null;
7
+ };
2
8
  export type ExecOpts = {
3
9
  /**
4
- * [[]] - The list of additional subcommand arguments.
10
+ * - The list of additional subcommand arguments.
5
11
  * It's empty by default.
6
12
  */
7
- args: string[];
13
+ args?: string[] | undefined;
8
14
  /**
9
- * [{}] - Environment variables mapping. All these variables
15
+ * - Environment variables mapping. All these variables
10
16
  * will be passed Simulator and used in the executing function.
11
17
  */
12
- env: any;
18
+ env?: Record<string, any> | undefined;
13
19
  /**
14
- * [true] - Set it to _false_ to throw execution errors
20
+ * - Set it to _false_ to throw execution errors
15
21
  * immediately without logging any additional information.
16
22
  */
17
- logErrors: boolean;
23
+ logErrors?: boolean | undefined;
18
24
  /**
19
- * [false] - Whether to execute the given command
25
+ * - Whether to execute the given command
20
26
  * 'synchronously' or 'asynchronously'. Affects the returned result of the function.
21
27
  */
22
- asynchronous: boolean;
28
+ asynchronous?: boolean | undefined;
23
29
  /**
24
30
  * - Explicitly sets streams encoding for the executed
25
31
  * command input and outputs.
26
32
  */
27
- encoding: string | null;
33
+ encoding?: string | undefined;
28
34
  /**
29
35
  * - One or more architecture names to be enforced while
30
36
  * executing xcrun. See https://github.com/appium/appium/issues/18966 for more details.
31
37
  */
32
- architectures: string | string[];
38
+ architectures?: string | string[] | undefined;
33
39
  };
34
40
  export type SimctlOpts = {
35
41
  /**
@@ -39,93 +45,99 @@ export type SimctlOpts = {
39
45
  * an exception if it cannot be detected. If the path is set upon instance creation
40
46
  * then it is going to be used by `exec` and no autodetection will happen.
41
47
  */
42
- xcrun: any | null;
48
+ xcrun?: XCRun | undefined;
43
49
  /**
44
- * [600000] - The maximum number of milliseconds
50
+ * - The maximum number of milliseconds
45
51
  * to wait for single synchronous xcrun command.
46
52
  */
47
- execTimeout: number;
53
+ execTimeout?: number | undefined;
48
54
  /**
49
- * [true] - Whether to wire xcrun error messages
55
+ * - Whether to wire xcrun error messages
50
56
  * into debug log before throwing them.
51
57
  */
52
- logErrors: boolean;
58
+ logErrors?: boolean | undefined;
53
59
  /**
54
60
  * - The unique identifier of the current device, which is
55
61
  * going to be implicitly passed to all methods, which require it. It can either be set
56
62
  * upon instance creation if it is already known in advance or later when/if needed via the
57
63
  * corresponding instance setter.
58
64
  */
59
- udid: string | null;
65
+ udid?: string | null | undefined;
60
66
  /**
61
67
  * - Full path to the set of devices that you want to manage.
62
68
  * By default this path usually equals to ~/Library/Developer/CoreSimulator/Devices
63
69
  */
64
- devicesSetPath: string | null;
70
+ devicesSetPath?: string | null | undefined;
65
71
  };
72
+ /**
73
+ * @typedef {Object} XCRun
74
+ * @property {string?} path Full path to the xcrun script
75
+ */
66
76
  /**
67
77
  * @typedef {Object} ExecOpts
68
- * @property {string[]} args [[]] - The list of additional subcommand arguments.
78
+ * @property {string[]} [args=[]] - The list of additional subcommand arguments.
69
79
  * It's empty by default.
70
- * @property {Object} env [{}] - Environment variables mapping. All these variables
80
+ * @property {Record<string, any>} [env={}] - Environment variables mapping. All these variables
71
81
  * will be passed Simulator and used in the executing function.
72
- * @property {boolean} logErrors [true] - Set it to _false_ to throw execution errors
82
+ * @property {boolean} [logErrors=true] - Set it to _false_ to throw execution errors
73
83
  * immediately without logging any additional information.
74
- * @property {boolean} asynchronous [false] - Whether to execute the given command
84
+ * @property {boolean} [asynchronous=false] - Whether to execute the given command
75
85
  * 'synchronously' or 'asynchronously'. Affects the returned result of the function.
76
- * @property {string?} encoding - Explicitly sets streams encoding for the executed
86
+ * @property {string} [encoding] - Explicitly sets streams encoding for the executed
77
87
  * command input and outputs.
78
- * @property {string|string[]} architectures - One or more architecture names to be enforced while
88
+ * @property {string|string[]} [architectures] - One or more architecture names to be enforced while
79
89
  * executing xcrun. See https://github.com/appium/appium/issues/18966 for more details.
80
90
  */
81
91
  /**
82
92
  * @typedef {Object} SimctlOpts
83
- * @property {Object?} xcrun - The xcrun properties. Currently only one property
93
+ * @property {XCRun} [xcrun] - The xcrun properties. Currently only one property
84
94
  * is supported, which is `path` and it by default contains `null`, which enforces
85
95
  * the instance to automatically detect the full path to `xcrun` tool and to throw
86
96
  * an exception if it cannot be detected. If the path is set upon instance creation
87
97
  * then it is going to be used by `exec` and no autodetection will happen.
88
- * @property {number} execTimeout [600000] - The maximum number of milliseconds
98
+ * @property {number} [execTimeout=600000] - The maximum number of milliseconds
89
99
  * to wait for single synchronous xcrun command.
90
- * @property {boolean} logErrors [true] - Whether to wire xcrun error messages
100
+ * @property {boolean} [logErrors=true] - Whether to wire xcrun error messages
91
101
  * into debug log before throwing them.
92
- * @property {string?} udid - The unique identifier of the current device, which is
102
+ * @property {string?} [udid] - The unique identifier of the current device, which is
93
103
  * going to be implicitly passed to all methods, which require it. It can either be set
94
104
  * upon instance creation if it is already known in advance or later when/if needed via the
95
105
  * corresponding instance setter.
96
- * @property {string?} devicesSetPath - Full path to the set of devices that you want to manage.
106
+ * @property {string?} [devicesSetPath] - Full path to the set of devices that you want to manage.
97
107
  * By default this path usually equals to ~/Library/Developer/CoreSimulator/Devices
98
108
  */
99
109
  export class Simctl {
100
110
  /**
101
- * @param {Partial<SimctlOpts>} opts
111
+ * @param {SimctlOpts} [opts={}]
102
112
  */
103
- constructor(opts?: Partial<SimctlOpts>);
104
- /** @type {any?} */
105
- xcrun: any | null;
113
+ constructor(opts?: SimctlOpts | undefined);
114
+ /** @type {XCRun} */
115
+ xcrun: XCRun;
106
116
  /** @type {number} */
107
117
  execTimeout: number;
108
118
  /** @type {boolean} */
109
119
  logErrors: boolean;
120
+ /** @type {string?} */
110
121
  _udid: string | null;
122
+ /** @type {string?} */
111
123
  _devicesSetPath: string | null;
112
124
  set udid(arg: string | null);
113
125
  get udid(): string | null;
114
126
  set devicesSetPath(arg: string | null);
115
127
  get devicesSetPath(): string | null;
116
128
  requireUdid(commandName?: null): string;
117
- requireXcrun(): Promise<any>;
129
+ requireXcrun(): Promise<string>;
118
130
  /**
119
131
  * Execute the particular simctl command.
120
132
  *
121
133
  * @param {string} subcommand - One of available simctl subcommands.
122
- * Execute `xcrun simctl` in Terminal to see the full list
123
- * of available subcommands.
124
- * @param {Partial<ExecOpts>} opts
125
- * @return {Promise<import('teen_process').TeenProcessExecResult|import('teen_process').SubProcess>} Either the result of teen process's `exec` or
134
+ * Execute `xcrun simctl` in Terminal to see the full list of available subcommands.
135
+ * @param {ExecOpts} [opts={}]
136
+ * @return {Promise<import('teen_process').TeenProcessExecResult|import('teen_process').SubProcess>}
137
+ * Either the result of teen process's `exec` or
126
138
  * `SubProcess` instance depending of `opts.asynchronous` value.
127
139
  * @throws {Error} If the simctl subcommand command returns non-zero return code.
128
140
  */
129
- exec(subcommand: string, opts?: Partial<ExecOpts>): Promise<import("teen_process").TeenProcessExecResult<any> | import('teen_process').SubProcess>;
141
+ exec(subcommand: string, opts?: ExecOpts | undefined): Promise<import("teen_process").TeenProcessExecResult<any> | import('teen_process').SubProcess>;
130
142
  }
131
143
  //# sourceMappingURL=simctl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"simctl.d.ts","sourceRoot":"","sources":["../../lib/simctl.js"],"names":[],"mappings":";;;;;;UAoBc,MAA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GL,QAAQ,oDAA6C,OAAO,cAAc,EAAE,UAAU,CAAC,CA4DlG;CACF"}
@@ -41,42 +41,46 @@ const DEFAULT_OPTS = {
41
41
  execTimeout: helpers_1.DEFAULT_EXEC_TIMEOUT,
42
42
  logErrors: true,
43
43
  };
44
+ /**
45
+ * @typedef {Object} XCRun
46
+ * @property {string?} path Full path to the xcrun script
47
+ */
44
48
  /**
45
49
  * @typedef {Object} ExecOpts
46
- * @property {string[]} args [[]] - The list of additional subcommand arguments.
50
+ * @property {string[]} [args=[]] - The list of additional subcommand arguments.
47
51
  * It's empty by default.
48
- * @property {Object} env [{}] - Environment variables mapping. All these variables
52
+ * @property {Record<string, any>} [env={}] - Environment variables mapping. All these variables
49
53
  * will be passed Simulator and used in the executing function.
50
- * @property {boolean} logErrors [true] - Set it to _false_ to throw execution errors
54
+ * @property {boolean} [logErrors=true] - Set it to _false_ to throw execution errors
51
55
  * immediately without logging any additional information.
52
- * @property {boolean} asynchronous [false] - Whether to execute the given command
56
+ * @property {boolean} [asynchronous=false] - Whether to execute the given command
53
57
  * 'synchronously' or 'asynchronously'. Affects the returned result of the function.
54
- * @property {string?} encoding - Explicitly sets streams encoding for the executed
58
+ * @property {string} [encoding] - Explicitly sets streams encoding for the executed
55
59
  * command input and outputs.
56
- * @property {string|string[]} architectures - One or more architecture names to be enforced while
60
+ * @property {string|string[]} [architectures] - One or more architecture names to be enforced while
57
61
  * executing xcrun. See https://github.com/appium/appium/issues/18966 for more details.
58
62
  */
59
63
  /**
60
64
  * @typedef {Object} SimctlOpts
61
- * @property {Object?} xcrun - The xcrun properties. Currently only one property
65
+ * @property {XCRun} [xcrun] - The xcrun properties. Currently only one property
62
66
  * is supported, which is `path` and it by default contains `null`, which enforces
63
67
  * the instance to automatically detect the full path to `xcrun` tool and to throw
64
68
  * an exception if it cannot be detected. If the path is set upon instance creation
65
69
  * then it is going to be used by `exec` and no autodetection will happen.
66
- * @property {number} execTimeout [600000] - The maximum number of milliseconds
70
+ * @property {number} [execTimeout=600000] - The maximum number of milliseconds
67
71
  * to wait for single synchronous xcrun command.
68
- * @property {boolean} logErrors [true] - Whether to wire xcrun error messages
72
+ * @property {boolean} [logErrors=true] - Whether to wire xcrun error messages
69
73
  * into debug log before throwing them.
70
- * @property {string?} udid - The unique identifier of the current device, which is
74
+ * @property {string?} [udid] - The unique identifier of the current device, which is
71
75
  * going to be implicitly passed to all methods, which require it. It can either be set
72
76
  * upon instance creation if it is already known in advance or later when/if needed via the
73
77
  * corresponding instance setter.
74
- * @property {string?} devicesSetPath - Full path to the set of devices that you want to manage.
78
+ * @property {string?} [devicesSetPath] - Full path to the set of devices that you want to manage.
75
79
  * By default this path usually equals to ~/Library/Developer/CoreSimulator/Devices
76
80
  */
77
81
  class Simctl {
78
82
  /**
79
- * @param {Partial<SimctlOpts>} opts
83
+ * @param {SimctlOpts} [opts={}]
80
84
  */
81
85
  constructor(opts = {}) {
82
86
  opts = lodash_1.default.cloneDeep(opts);
@@ -84,7 +88,9 @@ class Simctl {
84
88
  for (const key of lodash_1.default.keys(DEFAULT_OPTS)) {
85
89
  this[key] = opts[key];
86
90
  }
91
+ /** @type {string?} */
87
92
  this._udid = lodash_1.default.isNil(opts.udid) ? null : opts.udid;
93
+ /** @type {string?} */
88
94
  this._devicesSetPath = lodash_1.default.isNil(opts.devicesSetPath) ? null : opts.devicesSetPath;
89
95
  }
90
96
  set udid(value) {
@@ -123,17 +129,18 @@ class Simctl {
123
129
  * Execute the particular simctl command.
124
130
  *
125
131
  * @param {string} subcommand - One of available simctl subcommands.
126
- * Execute `xcrun simctl` in Terminal to see the full list
127
- * of available subcommands.
128
- * @param {Partial<ExecOpts>} opts
129
- * @return {Promise<import('teen_process').TeenProcessExecResult|import('teen_process').SubProcess>} Either the result of teen process's `exec` or
132
+ * Execute `xcrun simctl` in Terminal to see the full list of available subcommands.
133
+ * @param {ExecOpts} [opts={}]
134
+ * @return {Promise<import('teen_process').TeenProcessExecResult|import('teen_process').SubProcess>}
135
+ * Either the result of teen process's `exec` or
130
136
  * `SubProcess` instance depending of `opts.asynchronous` value.
131
137
  * @throws {Error} If the simctl subcommand command returns non-zero return code.
132
138
  */
133
139
  async exec(subcommand, opts = {}) {
134
140
  let { args = [], env = {}, asynchronous = false, encoding, logErrors = true, architectures, } = opts;
135
141
  // run a particular simctl command
136
- args = ['simctl',
142
+ args = [
143
+ 'simctl',
137
144
  ...(this.devicesSetPath ? ['--set', this.devicesSetPath] : []),
138
145
  subcommand,
139
146
  ...args
@@ -151,7 +158,7 @@ class Simctl {
151
158
  const xcrun = await this.requireXcrun();
152
159
  try {
153
160
  let execArgs = [xcrun, args, execOpts];
154
- if (!lodash_1.default.isEmpty(architectures)) {
161
+ if (architectures?.length) {
155
162
  const archArgs = lodash_1.default.flatMap((lodash_1.default.isArray(architectures) ? architectures : [architectures]).map((arch) => ['-arch', arch]));
156
163
  execArgs = ['arch', [...archArgs, xcrun, ...args], execOpts];
157
164
  }
@@ -1 +1 @@
1
- {"version":3,"file":"simctl.js","sourceRoot":"","sources":["../../lib/simctl.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAuB;AACvB,sEAAiD;AACjD,kDAA0B;AAC1B,mDAA2C;AAC3C,uCAEmB;AACnB,+CAA0D;AAE1D,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAC1C,MAAM,YAAY,GAAG;IACnB,KAAK,EAAE;QACL,IAAI,EAAE,IAAI;KACX;IACD,WAAW,EAAE,8BAAoB;IACjC,SAAS,EAAE,IAAI;CAChB,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AAGH;;;;;;;;;;;;;;;;;GAiBG;AAGH,MAAM,MAAM;IAUV;;OAEG;IACH,YAAa,IAAI,GAAG,EAAE;QACpB,IAAI,GAAG,gBAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACzB,gBAAC,CAAC,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QACnC,KAAK,MAAM,GAAG,I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AAG,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,IAAA,mBAAM,EAAC,GAAG,QAAQ,CAAC,CAAC;SAC/E;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,EAAE;gBACjC,uEAAuE;gBACvE,wBAAwB;aACzB;iBAAM,IAAI,CAAC,CAAC,MAAM,EAAE;gBACnB,MAAM,GAAG,GAAG,kBAAkB,UAAU,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;gBAChE,gBAAG,CAAC,KAAK,CAAC,mBAAU,EAAE,GAAG,CAAC,CAAC;gBAC3B,CAAC,CAAC,OAAO,GAAG,GAAG,CAAC;aACjB;iBAAM;gBACL,gBAAG,CAAC,KAAK,CAAC,mBAAU,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;aAClC;YACD,MAAM,CAAC,CAAC;SACT;IACH,CAAC;CACF;AASQ,wBAAM;AANf,kDAAkD;AAClD,KAAK,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,gBAAC,CAAC,OAAO,CAAC,kBAAW,CAAC,EAAE;IACjD,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;CAC/B;AAED,kBAAe,MAAM,CAAC"}
@@ -1,42 +1,42 @@
1
1
  export default commands;
2
2
  export type BootMonitorOptions = {
3
3
  /**
4
- * [240000] - Simulator booting timeout in ms.
4
+ * - Simulator booting timeout in ms.
5
5
  */
6
- timeout: number;
6
+ timeout?: number | undefined;
7
7
  /**
8
8
  * - This event is fired when data migration stage starts.
9
9
  */
10
- onWaitingDataMigration: Function | null;
10
+ onWaitingDataMigration?: Function | undefined;
11
11
  /**
12
12
  * - This event is fired when system app wait stage starts.
13
13
  */
14
- onWaitingSystemApp: Function | null;
14
+ onWaitingSystemApp?: Function | undefined;
15
15
  /**
16
16
  * - This event is fired when Simulator is fully booted.
17
17
  */
18
- onFinished: Function | null;
18
+ onFinished?: Function | undefined;
19
19
  /**
20
20
  * - This event is fired when there was an error while monitoring the booting process
21
21
  * or when the timeout has expired.
22
22
  */
23
- onError: Function | null;
23
+ onError?: Function | undefined;
24
24
  /**
25
- * [false] Whether to preboot the Simulator
25
+ * Whether to preboot the Simulator
26
26
  * if this command is called and it is not already in booted or booting state.
27
27
  */
28
- shouldPreboot: boolean;
28
+ shouldPreboot?: boolean | undefined;
29
29
  };
30
30
  declare namespace commands {
31
31
  /**
32
32
  * @typedef {Object} BootMonitorOptions
33
- * @property {number} timeout [240000] - Simulator booting timeout in ms.
34
- * @property {Function?} onWaitingDataMigration - This event is fired when data migration stage starts.
35
- * @property {Function?} onWaitingSystemApp - This event is fired when system app wait stage starts.
36
- * @property {Function?} onFinished - This event is fired when Simulator is fully booted.
37
- * @property {Function?} onError - This event is fired when there was an error while monitoring the booting process
33
+ * @property {number} [timeout=240000] - Simulator booting timeout in ms.
34
+ * @property {Function} [onWaitingDataMigration] - This event is fired when data migration stage starts.
35
+ * @property {Function} [onWaitingSystemApp] - This event is fired when system app wait stage starts.
36
+ * @property {Function} [onFinished] - This event is fired when Simulator is fully booted.
37
+ * @property {Function} [onError] - This event is fired when there was an error while monitoring the booting process
38
38
  * or when the timeout has expired.
39
- * @property {boolean} shouldPreboot [false] Whether to preboot the Simulator
39
+ * @property {boolean} [shouldPreboot=false] Whether to preboot the Simulator
40
40
  * if this command is called and it is not already in booted or booting state.
41
41
  */
42
42
  /**
@@ -45,12 +45,12 @@ declare namespace commands {
45
45
  * until Simulator booting is completed.
46
46
  * The method is only available since Xcode8.
47
47
  *
48
- * @param {Partial<BootMonitorOptions>} opts - Monitoring options.
48
+ * @param {BootMonitorOptions} [opts={}] - Monitoring options.
49
49
  * @returns {Promise<import('teen_process').SubProcess>} The instance of the corresponding monitoring process.
50
50
  * @throws {Error} If the Simulator fails to finish booting within the given timeout and onFinished
51
51
  * property is not set.
52
52
  * @throws {Error} If the `udid` instance property is unset
53
53
  */
54
- function startBootMonitor(opts?: Partial<BootMonitorOptions>): Promise<import("teen_process").SubProcess>;
54
+ function startBootMonitor(opts?: BootMonitorOptions | undefined): Promise<import("teen_process").SubProcess>;
55
55
  }
56
56
  //# sourceMappingURL=bootstatus.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bootstatus.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/bootstatus.js"],"names":[],"mappings":";;;;;aAQc,MAAM;;;;;;;;;;;;;;;;;;;;;;mBAMN,OAAO;;;IARrB;;;;;;;;;;OAUG;IAEH;;;;;;;;;;;OAWG;IACH,0GAgFC"}
1
+ {"version":3,"file":"bootstatus.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/bootstatus.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAMA;;;;;;;;;;OAUG;IAEH;;;;;;;;;;;OAWG;IACH,6GAgFC"}
@@ -8,13 +8,13 @@ const asyncbox_1 = require("asyncbox");
8
8
  const commands = {};
9
9
  /**
10
10
  * @typedef {Object} BootMonitorOptions
11
- * @property {number} timeout [240000] - Simulator booting timeout in ms.
12
- * @property {Function?} onWaitingDataMigration - This event is fired when data migration stage starts.
13
- * @property {Function?} onWaitingSystemApp - This event is fired when system app wait stage starts.
14
- * @property {Function?} onFinished - This event is fired when Simulator is fully booted.
15
- * @property {Function?} onError - This event is fired when there was an error while monitoring the booting process
11
+ * @property {number} [timeout=240000] - Simulator booting timeout in ms.
12
+ * @property {Function} [onWaitingDataMigration] - This event is fired when data migration stage starts.
13
+ * @property {Function} [onWaitingSystemApp] - This event is fired when system app wait stage starts.
14
+ * @property {Function} [onFinished] - This event is fired when Simulator is fully booted.
15
+ * @property {Function} [onError] - This event is fired when there was an error while monitoring the booting process
16
16
  * or when the timeout has expired.
17
- * @property {boolean} shouldPreboot [false] Whether to preboot the Simulator
17
+ * @property {boolean} [shouldPreboot=false] Whether to preboot the Simulator
18
18
  * if this command is called and it is not already in booted or booting state.
19
19
  */
20
20
  /**
@@ -23,7 +23,7 @@ const commands = {};
23
23
  * until Simulator booting is completed.
24
24
  * The method is only available since Xcode8.
25
25
  *
26
- * @param {Partial<BootMonitorOptions>} opts - Monitoring options.
26
+ * @param {BootMonitorOptions} [opts={}] - Monitoring options.
27
27
  * @returns {Promise<import('teen_process').SubProcess>} The instance of the corresponding monitoring process.
28
28
  * @throws {Error} If the Simulator fails to finish booting within the given timeout and onFinished
29
29
  * property is not set.
@@ -1,20 +1,20 @@
1
1
  export default commands;
2
2
  export type SimCreationOpts = {
3
3
  /**
4
- * [iOS] - Platform name in order to specify runtime such as 'iOS', 'tvOS', 'watchOS'
4
+ * - Platform name in order to specify runtime such as 'iOS', 'tvOS', 'watchOS'
5
5
  */
6
- platform: string;
6
+ platform?: string | undefined;
7
7
  /**
8
- * [10000] - The maximum number of milliseconds to wait
9
- * unit device creation is completed.
8
+ * - The maximum number of milliseconds to wait
9
+ * unit device creation is completed.
10
10
  */
11
- timeout: number;
11
+ timeout?: number | undefined;
12
12
  };
13
13
  declare namespace commands {
14
14
  /**
15
15
  * @typedef {Object} SimCreationOpts
16
- * @property {string} platform [iOS] - Platform name in order to specify runtime such as 'iOS', 'tvOS', 'watchOS'
17
- * @property {number} timeout [10000] - The maximum number of milliseconds to wait
16
+ * @property {string} [platform='iOS'] - Platform name in order to specify runtime such as 'iOS', 'tvOS', 'watchOS'
17
+ * @property {number} [timeout=10000] - The maximum number of milliseconds to wait
18
18
  * unit device creation is completed.
19
19
  */
20
20
  /**
@@ -24,11 +24,11 @@ declare namespace commands {
24
24
  * @param {string} name - The device name to be created.
25
25
  * @param {string} deviceTypeId - Device type, for example 'iPhone 6'.
26
26
  * @param {string} platformVersion - Platform version, for example '10.3'.
27
- * @param {Partial<SimCreationOpts>} opts - Simulator options for creating devices.
27
+ * @param {SimCreationOpts} [opts={}] - Simulator options for creating devices.
28
28
  * @return {Promise<string>} The UDID of the newly created device.
29
29
  * @throws {Error} If the corresponding simctl subcommand command
30
30
  * returns non-zero return code.
31
31
  */
32
- function createDevice(name: string, deviceTypeId: string, platformVersion: string, opts?: Partial<SimCreationOpts>): Promise<string>;
32
+ function createDevice(name: string, deviceTypeId: string, platformVersion: string, opts?: SimCreationOpts | undefined): Promise<string>;
33
33
  }
34
34
  //# sourceMappingURL=create.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/create.js"],"names":[],"mappings":";;;;;cAac,MAAM;;;;;aACN,MAAM;;;IAHpB;;;;;OAKG;IAEH;;;;;;;;;;;OAWG;IACH,qIAoFC"}
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/create.js"],"names":[],"mappings":";;;;;;;;;;;;;IAWA;;;;;OAKG;IAEH;;;;;;;;;;;OAWG;IACH,wIAoFC"}
@@ -35,8 +35,8 @@ const DEFAULT_CREATE_SIMULATOR_TIMEOUT = 10000;
35
35
  const commands = {};
36
36
  /**
37
37
  * @typedef {Object} SimCreationOpts
38
- * @property {string} platform [iOS] - Platform name in order to specify runtime such as 'iOS', 'tvOS', 'watchOS'
39
- * @property {number} timeout [10000] - The maximum number of milliseconds to wait
38
+ * @property {string} [platform='iOS'] - Platform name in order to specify runtime such as 'iOS', 'tvOS', 'watchOS'
39
+ * @property {number} [timeout=10000] - The maximum number of milliseconds to wait
40
40
  * unit device creation is completed.
41
41
  */
42
42
  /**
@@ -46,7 +46,7 @@ const commands = {};
46
46
  * @param {string} name - The device name to be created.
47
47
  * @param {string} deviceTypeId - Device type, for example 'iPhone 6'.
48
48
  * @param {string} platformVersion - Platform version, for example '10.3'.
49
- * @param {Partial<SimCreationOpts>} opts - Simulator options for creating devices.
49
+ * @param {SimCreationOpts} [opts={}] - Simulator options for creating devices.
50
50
  * @return {Promise<string>} The UDID of the newly created device.
51
51
  * @throws {Error} If the corresponding simctl subcommand command
52
52
  * returns non-zero return code.
@@ -4,12 +4,12 @@ declare namespace commands {
4
4
  * Reset the content and settings of the particular Simulator.
5
5
  * It is required that Simulator is in _shutdown_ state.
6
6
  *
7
- * @param {number} timeout [10000] - The maximum number of milliseconds to wait
7
+ * @param {number} [timeout=10000] - The maximum number of milliseconds to wait
8
8
  * unit device reset is completed.
9
9
  * @throws {Error} If the corresponding simctl subcommand command
10
10
  * returns non-zero return code.
11
11
  * @throws {Error} If the `udid` instance property is unset
12
12
  */
13
- function eraseDevice(timeout?: number): Promise<void>;
13
+ function eraseDevice(timeout?: number | undefined): Promise<void>;
14
14
  }
15
15
  //# sourceMappingURL=erase.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"erase.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/erase.js"],"names":[],"mappings":";;IAIA;;;;;;;;;OASG;IACH,sDAQC"}
1
+ {"version":3,"file":"erase.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/erase.js"],"names":[],"mappings":";;IAIA;;;;;;;;;OASG;IACH,kEAQC"}
@@ -6,7 +6,7 @@ const commands = {};
6
6
  * Reset the content and settings of the particular Simulator.
7
7
  * It is required that Simulator is in _shutdown_ state.
8
8
  *
9
- * @param {number} timeout [10000] - The maximum number of milliseconds to wait
9
+ * @param {number} [timeout=10000] - The maximum number of milliseconds to wait
10
10
  * unit device reset is completed.
11
11
  * @throws {Error} If the corresponding simctl subcommand command
12
12
  * returns non-zero return code.
@@ -8,7 +8,7 @@ declare namespace commands {
8
8
  * It is required that Simulator is in _booted_ state.
9
9
  *
10
10
  * @param {string} bundleId - Bundle identifier of an application.
11
- * @param {string?} containerType - Which container type to return. Possible values
11
+ * @param {string?} [containerType=null] - Which container type to return. Possible values
12
12
  * are 'app', 'data', 'groups', '<A specific App Group container>'.
13
13
  * The default value is 'app'.
14
14
  * @return {Promise<string>} Full path to the given application container on the local
@@ -17,6 +17,6 @@ declare namespace commands {
17
17
  * returns non-zero return code.
18
18
  * @throws {Error} If the `udid` instance property is unset
19
19
  */
20
- function getAppContainer(bundleId: string, containerType?: string | null): Promise<string>;
20
+ function getAppContainer(bundleId: string, containerType?: string | null | undefined): Promise<string>;
21
21
  }
22
22
  //# sourceMappingURL=get_app_container.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get_app_container.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/get_app_container.js"],"names":[],"mappings":";;IAEA;;;;;;;;;;;;;;;;OAgBG;IACH,2FAOC"}
1
+ {"version":3,"file":"get_app_container.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/get_app_container.js"],"names":[],"mappings":";;IAEA;;;;;;;;;;;;;;;;OAgBG;IACH,uGAOC"}
@@ -9,7 +9,7 @@ const commands = {};
9
9
  * It is required that Simulator is in _booted_ state.
10
10
  *
11
11
  * @param {string} bundleId - Bundle identifier of an application.
12
- * @param {string?} containerType - Which container type to return. Possible values
12
+ * @param {string?} [containerType=null] - Which container type to return. Possible values
13
13
  * are 'app', 'data', 'groups', '<A specific App Group container>'.
14
14
  * The default value is 'app'.
15
15
  * @return {Promise<string>} Full path to the given application container on the local