node-simctl 8.0.9 → 8.1.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 (156) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/index.d.ts +2 -1
  3. package/build/index.d.ts.map +1 -1
  4. package/build/index.js.map +1 -1
  5. package/build/lib/helpers.d.ts +17 -9
  6. package/build/lib/helpers.d.ts.map +1 -1
  7. package/build/lib/helpers.js +50 -4
  8. package/build/lib/helpers.js.map +1 -1
  9. package/build/lib/logger.d.ts +2 -3
  10. package/build/lib/logger.d.ts.map +1 -1
  11. package/build/lib/logger.js +3 -5
  12. package/build/lib/logger.js.map +1 -1
  13. package/build/lib/simctl.d.ts +82 -188
  14. package/build/lib/simctl.d.ts.map +1 -1
  15. package/build/lib/simctl.js +98 -150
  16. package/build/lib/simctl.js.map +1 -1
  17. package/build/lib/subcommands/addmedia.d.ts +14 -16
  18. package/build/lib/subcommands/addmedia.d.ts.map +1 -1
  19. package/build/lib/subcommands/addmedia.js +5 -7
  20. package/build/lib/subcommands/addmedia.js.map +1 -1
  21. package/build/lib/subcommands/appinfo.d.ts +13 -45
  22. package/build/lib/subcommands/appinfo.d.ts.map +1 -1
  23. package/build/lib/subcommands/appinfo.js +31 -42
  24. package/build/lib/subcommands/appinfo.js.map +1 -1
  25. package/build/lib/subcommands/boot.d.ts +9 -12
  26. package/build/lib/subcommands/boot.d.ts.map +1 -1
  27. package/build/lib/subcommands/boot.js +5 -40
  28. package/build/lib/subcommands/boot.js.map +1 -1
  29. package/build/lib/subcommands/bootstatus.d.ts +16 -56
  30. package/build/lib/subcommands/bootstatus.d.ts.map +1 -1
  31. package/build/lib/subcommands/bootstatus.js +8 -22
  32. package/build/lib/subcommands/bootstatus.js.map +1 -1
  33. package/build/lib/subcommands/create.d.ts +15 -34
  34. package/build/lib/subcommands/create.d.ts.map +1 -1
  35. package/build/lib/subcommands/create.js +23 -66
  36. package/build/lib/subcommands/create.js.map +1 -1
  37. package/build/lib/subcommands/delete.d.ts +9 -12
  38. package/build/lib/subcommands/delete.d.ts.map +1 -1
  39. package/build/lib/subcommands/delete.js +3 -5
  40. package/build/lib/subcommands/delete.js.map +1 -1
  41. package/build/lib/subcommands/erase.d.ts +12 -15
  42. package/build/lib/subcommands/erase.d.ts.map +1 -1
  43. package/build/lib/subcommands/erase.js +4 -6
  44. package/build/lib/subcommands/erase.js.map +1 -1
  45. package/build/lib/subcommands/get_app_container.d.ts +19 -22
  46. package/build/lib/subcommands/get_app_container.d.ts.map +1 -1
  47. package/build/lib/subcommands/get_app_container.js +6 -8
  48. package/build/lib/subcommands/get_app_container.js.map +1 -1
  49. package/build/lib/subcommands/getenv.d.ts +11 -14
  50. package/build/lib/subcommands/getenv.d.ts.map +1 -1
  51. package/build/lib/subcommands/getenv.js +5 -7
  52. package/build/lib/subcommands/getenv.js.map +1 -1
  53. package/build/lib/subcommands/install.d.ts +12 -15
  54. package/build/lib/subcommands/install.d.ts.map +1 -1
  55. package/build/lib/subcommands/install.js +4 -6
  56. package/build/lib/subcommands/install.js.map +1 -1
  57. package/build/lib/subcommands/io.d.ts +12 -15
  58. package/build/lib/subcommands/io.d.ts.map +1 -1
  59. package/build/lib/subcommands/io.js +4 -6
  60. package/build/lib/subcommands/io.js.map +1 -1
  61. package/build/lib/subcommands/keychain.d.ts +37 -55
  62. package/build/lib/subcommands/keychain.d.ts.map +1 -1
  63. package/build/lib/subcommands/keychain.js +16 -25
  64. package/build/lib/subcommands/keychain.js.map +1 -1
  65. package/build/lib/subcommands/launch.d.ts +16 -19
  66. package/build/lib/subcommands/launch.d.ts.map +1 -1
  67. package/build/lib/subcommands/launch.js +9 -11
  68. package/build/lib/subcommands/launch.js.map +1 -1
  69. package/build/lib/subcommands/list.d.ts +94 -125
  70. package/build/lib/subcommands/list.d.ts.map +1 -1
  71. package/build/lib/subcommands/list.js +34 -92
  72. package/build/lib/subcommands/list.js.map +1 -1
  73. package/build/lib/subcommands/location.d.ts +18 -22
  74. package/build/lib/subcommands/location.d.ts.map +1 -1
  75. package/build/lib/subcommands/location.js +11 -13
  76. package/build/lib/subcommands/location.js.map +1 -1
  77. package/build/lib/subcommands/openurl.d.ts +15 -17
  78. package/build/lib/subcommands/openurl.d.ts.map +1 -1
  79. package/build/lib/subcommands/openurl.js +5 -7
  80. package/build/lib/subcommands/openurl.js.map +1 -1
  81. package/build/lib/subcommands/pbcopy.d.ts +14 -17
  82. package/build/lib/subcommands/pbcopy.d.ts.map +1 -1
  83. package/build/lib/subcommands/pbcopy.js +5 -7
  84. package/build/lib/subcommands/pbcopy.js.map +1 -1
  85. package/build/lib/subcommands/pbpaste.d.ts +14 -17
  86. package/build/lib/subcommands/pbpaste.d.ts.map +1 -1
  87. package/build/lib/subcommands/pbpaste.js +5 -7
  88. package/build/lib/subcommands/pbpaste.js.map +1 -1
  89. package/build/lib/subcommands/privacy.d.ts +52 -57
  90. package/build/lib/subcommands/privacy.d.ts.map +1 -1
  91. package/build/lib/subcommands/privacy.js +15 -17
  92. package/build/lib/subcommands/privacy.js.map +1 -1
  93. package/build/lib/subcommands/push.d.ts +22 -25
  94. package/build/lib/subcommands/push.d.ts.map +1 -1
  95. package/build/lib/subcommands/push.js +5 -7
  96. package/build/lib/subcommands/push.js.map +1 -1
  97. package/build/lib/subcommands/shutdown.d.ts +9 -12
  98. package/build/lib/subcommands/shutdown.d.ts.map +1 -1
  99. package/build/lib/subcommands/shutdown.js +5 -40
  100. package/build/lib/subcommands/shutdown.js.map +1 -1
  101. package/build/lib/subcommands/spawn.d.ts +24 -27
  102. package/build/lib/subcommands/spawn.d.ts.map +1 -1
  103. package/build/lib/subcommands/spawn.js +12 -14
  104. package/build/lib/subcommands/spawn.js.map +1 -1
  105. package/build/lib/subcommands/terminate.d.ts +12 -15
  106. package/build/lib/subcommands/terminate.d.ts.map +1 -1
  107. package/build/lib/subcommands/terminate.js +4 -6
  108. package/build/lib/subcommands/terminate.js.map +1 -1
  109. package/build/lib/subcommands/ui.d.ts +97 -105
  110. package/build/lib/subcommands/ui.d.ts.map +1 -1
  111. package/build/lib/subcommands/ui.js +24 -26
  112. package/build/lib/subcommands/ui.js.map +1 -1
  113. package/build/lib/subcommands/uninstall.d.ts +13 -16
  114. package/build/lib/subcommands/uninstall.d.ts.map +1 -1
  115. package/build/lib/subcommands/uninstall.js +4 -6
  116. package/build/lib/subcommands/uninstall.js.map +1 -1
  117. package/build/lib/types.d.ts +231 -0
  118. package/build/lib/types.d.ts.map +1 -0
  119. package/build/lib/types.js +3 -0
  120. package/build/lib/types.js.map +1 -0
  121. package/index.ts +13 -0
  122. package/lib/helpers.ts +81 -0
  123. package/lib/{logger.js → logger.ts} +2 -5
  124. package/lib/simctl.ts +221 -0
  125. package/lib/subcommands/{addmedia.js → addmedia.ts} +6 -8
  126. package/lib/subcommands/appinfo.ts +39 -0
  127. package/lib/subcommands/{boot.js → boot.ts} +5 -10
  128. package/lib/subcommands/bootstatus.ts +108 -0
  129. package/lib/subcommands/{create.js → create.ts} +29 -35
  130. package/lib/subcommands/{delete.js → delete.ts} +3 -5
  131. package/lib/subcommands/{erase.js → erase.ts} +4 -7
  132. package/lib/subcommands/{get_app_container.js → get_app_container.ts} +10 -8
  133. package/lib/subcommands/{getenv.js → getenv.ts} +5 -7
  134. package/lib/subcommands/{install.js → install.ts} +4 -6
  135. package/lib/subcommands/{io.js → io.ts} +4 -7
  136. package/lib/subcommands/{keychain.js → keychain.ts} +30 -32
  137. package/lib/subcommands/{launch.js → launch.ts} +9 -12
  138. package/lib/subcommands/{list.js → list.ts} +67 -60
  139. package/lib/subcommands/{location.js → location.ts} +15 -14
  140. package/lib/subcommands/{openurl.js → openurl.ts} +6 -7
  141. package/lib/subcommands/{pbcopy.js → pbcopy.ts} +11 -8
  142. package/lib/subcommands/{pbpaste.js → pbpaste.ts} +5 -7
  143. package/lib/subcommands/{privacy.js → privacy.ts} +13 -17
  144. package/lib/subcommands/{push.js → push.ts} +5 -8
  145. package/lib/subcommands/{shutdown.js → shutdown.ts} +5 -8
  146. package/lib/subcommands/{spawn.js → spawn.ts} +21 -17
  147. package/lib/subcommands/{terminate.js → terminate.ts} +4 -6
  148. package/lib/subcommands/{ui.js → ui.ts} +19 -28
  149. package/lib/subcommands/{uninstall.js → uninstall.ts} +4 -6
  150. package/lib/types.ts +243 -0
  151. package/package.json +2 -3
  152. package/index.js +0 -4
  153. package/lib/helpers.js +0 -37
  154. package/lib/simctl.js +0 -299
  155. package/lib/subcommands/appinfo.js +0 -51
  156. package/lib/subcommands/bootstatus.js +0 -119
@@ -39,105 +39,47 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.Simctl = void 0;
40
40
  const lodash_1 = __importDefault(require("lodash"));
41
41
  const which_1 = __importDefault(require("which"));
42
- const logger_1 = __importStar(require("./logger"));
42
+ const logger_1 = require("./logger");
43
43
  const helpers_1 = require("./helpers");
44
44
  const teen_process_1 = require("teen_process");
45
- const addmedia_1 = __importDefault(require("./subcommands/addmedia"));
46
- const appinfo_1 = __importDefault(require("./subcommands/appinfo"));
47
- const boot_1 = __importDefault(require("./subcommands/boot"));
48
- const bootstatus_1 = __importDefault(require("./subcommands/bootstatus"));
49
- const create_1 = __importDefault(require("./subcommands/create"));
50
- const delete_1 = __importDefault(require("./subcommands/delete"));
51
- const erase_1 = __importDefault(require("./subcommands/erase"));
52
- const get_app_container_1 = __importDefault(require("./subcommands/get_app_container"));
53
- const install_1 = __importDefault(require("./subcommands/install"));
54
- const io_1 = __importDefault(require("./subcommands/io"));
55
- const keychain_1 = __importDefault(require("./subcommands/keychain"));
56
- const launch_1 = __importDefault(require("./subcommands/launch"));
57
- const list_1 = __importDefault(require("./subcommands/list"));
58
- const openurl_1 = __importDefault(require("./subcommands/openurl"));
59
- const pbcopy_1 = __importDefault(require("./subcommands/pbcopy"));
60
- const pbpaste_1 = __importDefault(require("./subcommands/pbpaste"));
61
- const privacy_1 = __importDefault(require("./subcommands/privacy"));
62
- const push_1 = __importDefault(require("./subcommands/push"));
63
- const getenv_1 = __importDefault(require("./subcommands/getenv"));
64
- const shutdown_1 = __importDefault(require("./subcommands/shutdown"));
65
- const spawn_1 = __importDefault(require("./subcommands/spawn"));
66
- const terminate_1 = __importDefault(require("./subcommands/terminate"));
67
- const ui_1 = __importDefault(require("./subcommands/ui"));
68
- const uninstall_1 = __importDefault(require("./subcommands/uninstall"));
69
- const location_1 = __importDefault(require("./subcommands/location"));
45
+ const addmediaCommands = __importStar(require("./subcommands/addmedia"));
46
+ const appinfoCommands = __importStar(require("./subcommands/appinfo"));
47
+ const bootCommands = __importStar(require("./subcommands/boot"));
48
+ const bootstatusCommands = __importStar(require("./subcommands/bootstatus"));
49
+ const createCommands = __importStar(require("./subcommands/create"));
50
+ const deleteCommands = __importStar(require("./subcommands/delete"));
51
+ const eraseCommands = __importStar(require("./subcommands/erase"));
52
+ const getappcontainerCommands = __importStar(require("./subcommands/get_app_container"));
53
+ const installCommands = __importStar(require("./subcommands/install"));
54
+ const ioCommands = __importStar(require("./subcommands/io"));
55
+ const keychainCommands = __importStar(require("./subcommands/keychain"));
56
+ const launchCommands = __importStar(require("./subcommands/launch"));
57
+ const listCommands = __importStar(require("./subcommands/list"));
58
+ const openurlCommands = __importStar(require("./subcommands/openurl"));
59
+ const pbcopyCommands = __importStar(require("./subcommands/pbcopy"));
60
+ const pbpasteCommands = __importStar(require("./subcommands/pbpaste"));
61
+ const privacyCommands = __importStar(require("./subcommands/privacy"));
62
+ const pushCommands = __importStar(require("./subcommands/push"));
63
+ const envCommands = __importStar(require("./subcommands/getenv"));
64
+ const shutdownCommands = __importStar(require("./subcommands/shutdown"));
65
+ const spawnCommands = __importStar(require("./subcommands/spawn"));
66
+ const terminateCommands = __importStar(require("./subcommands/terminate"));
67
+ const uiCommands = __importStar(require("./subcommands/ui"));
68
+ const uninstallCommands = __importStar(require("./subcommands/uninstall"));
69
+ const locationCommands = __importStar(require("./subcommands/location"));
70
70
  const SIMCTL_ENV_PREFIX = 'SIMCTL_CHILD_';
71
- const DEFAULT_OPTS = {
72
- xcrun: {
73
- path: null,
74
- },
75
- execTimeout: helpers_1.DEFAULT_EXEC_TIMEOUT,
76
- logErrors: true,
77
- };
78
- /**
79
- * @typedef {Object} XCRun
80
- * @property {string?} path Full path to the xcrun script
81
- */
82
- /**
83
- * @typedef {{asynchronous: true}} TAsyncOpts
84
- */
85
- /**
86
- * @typedef {Object} ExecOpts
87
- * @property {string[]} [args=[]] - The list of additional subcommand arguments.
88
- * It's empty by default.
89
- * @property {Record<string, any>} [env={}] - Environment variables mapping. All these variables
90
- * will be passed Simulator and used in the executing function.
91
- * @property {boolean} [logErrors=true] - Set it to _false_ to throw execution errors
92
- * immediately without logging any additional information.
93
- * @property {boolean} [asynchronous=false] - Whether to execute the given command
94
- * 'synchronously' or 'asynchronously'. Affects the returned result of the function.
95
- * @property {string} [encoding] - Explicitly sets streams encoding for the executed
96
- * command input and outputs.
97
- * @property {string|string[]} [architectures] - One or more architecture names to be enforced while
98
- * executing xcrun. See https://github.com/appium/appium/issues/18966 for more details.
99
- * @property {number} [timeout] - The maximum number of milliseconds
100
- * to wait for single synchronous xcrun command. If not provided explicitly, then
101
- * the value of execTimeout property is used by default.
102
- */
103
- /**
104
- * @typedef {Object} SimctlOpts
105
- * @property {XCRun} [xcrun] - The xcrun properties. Currently only one property
106
- * is supported, which is `path` and it by default contains `null`, which enforces
107
- * the instance to automatically detect the full path to `xcrun` tool and to throw
108
- * an exception if it cannot be detected. If the path is set upon instance creation
109
- * then it is going to be used by `exec` and no autodetection will happen.
110
- * @property {number} [execTimeout=600000] - The default maximum number of milliseconds
111
- * to wait for single synchronous xcrun command.
112
- * @property {boolean} [logErrors=true] - Whether to wire xcrun error messages
113
- * into debug log before throwing them.
114
- * @property {string?} [udid] - The unique identifier of the current device, which is
115
- * going to be implicitly passed to all methods, which require it. It can either be set
116
- * upon instance creation if it is already known in advance or later when/if needed via the
117
- * corresponding instance setter.
118
- * @property {string?} [devicesSetPath] - Full path to the set of devices that you want to manage.
119
- * By default this path usually equals to ~/Library/Developer/CoreSimulator/Devices
120
- */
121
71
  class Simctl {
122
- /** @type {XCRun} */
123
72
  xcrun;
124
- /** @type {number} */
125
73
  execTimeout;
126
- /** @type {boolean} */
127
74
  logErrors;
128
- /**
129
- * @param {SimctlOpts} [opts={}]
130
- */
75
+ _udid;
76
+ _devicesSetPath;
131
77
  constructor(opts = {}) {
132
- opts = lodash_1.default.cloneDeep(opts);
133
- lodash_1.default.defaultsDeep(opts, DEFAULT_OPTS);
134
- for (const key of lodash_1.default.keys(DEFAULT_OPTS)) {
135
- this[key] = opts[key];
136
- }
137
- /** @type {string?} */
138
- this._udid = lodash_1.default.isNil(opts.udid) ? null : opts.udid;
139
- /** @type {string?} */
140
- this._devicesSetPath = lodash_1.default.isNil(opts.devicesSetPath) ? null : opts.devicesSetPath;
78
+ this.xcrun = lodash_1.default.cloneDeep(opts.xcrun ?? { path: null });
79
+ this.execTimeout = opts.execTimeout ?? helpers_1.DEFAULT_EXEC_TIMEOUT;
80
+ this.logErrors = opts.logErrors ?? true;
81
+ this._udid = opts.udid ?? null;
82
+ this._devicesSetPath = opts.devicesSetPath ?? null;
141
83
  }
142
84
  set udid(value) {
143
85
  this._udid = value;
@@ -152,8 +94,9 @@ class Simctl {
152
94
  return this._devicesSetPath;
153
95
  }
154
96
  /**
155
- * @param {string?} [commandName=null]
156
- * @returns {string}
97
+ * @param commandName - Optional command name for error message
98
+ * @returns The UDID string
99
+ * @throws {Error} If UDID is not set
157
100
  */
158
101
  requireUdid(commandName = null) {
159
102
  if (!this.udid) {
@@ -163,7 +106,7 @@ class Simctl {
163
106
  return this.udid;
164
107
  }
165
108
  /**
166
- * @returns {Promise<string>}
109
+ * @returns Promise resolving to the xcrun binary path
167
110
  */
168
111
  async requireXcrun() {
169
112
  const xcrunBinary = (0, helpers_1.getXcrunBinary)();
@@ -176,32 +119,33 @@ class Simctl {
176
119
  `Are Xcode developers tools installed?`);
177
120
  }
178
121
  }
179
- return /** @type {string} */ (this.xcrun.path);
122
+ if (!this.xcrun.path) {
123
+ throw new Error(`${xcrunBinary} tool path is not set`);
124
+ }
125
+ return this.xcrun.path;
180
126
  }
181
127
  /**
182
128
  * Execute the particular simctl command.
183
129
  *
184
- * @template {ExecOpts} TExecOpts
185
- * @param {string} subcommand - One of available simctl subcommands.
130
+ * @param subcommand - One of available simctl subcommands.
186
131
  * Execute `xcrun simctl` in Terminal to see the full list of available subcommands.
187
- * @param {TExecOpts} [opts]
188
- * @return {Promise<TExecOpts extends TAsyncOpts ? import('teen_process').SubProcess : import('teen_process').TeenProcessExecResult>}
189
- * Either the result of teen process's `exec` or
132
+ * @param opts - Execution options
133
+ * @return Either the result of teen process's `exec` or
190
134
  * `SubProcess` instance depending of `opts.asynchronous` value.
191
135
  * @throws {Error} If the simctl subcommand command returns non-zero return code.
192
136
  */
193
137
  async exec(subcommand, opts) {
194
- let { args = [], env = {}, asynchronous = false, encoding, logErrors = true, architectures, timeout, } = opts ?? {};
138
+ const { args: initialArgs = [], env: initialEnv = {}, asynchronous = false, encoding, logErrors = true, architectures, timeout, } = opts ?? {};
195
139
  // run a particular simctl command
196
- args = [
140
+ const args = [
197
141
  'simctl',
198
142
  ...(this.devicesSetPath ? ['--set', this.devicesSetPath] : []),
199
143
  subcommand,
200
- ...args
144
+ ...initialArgs
201
145
  ];
202
146
  // Prefix all passed in environment variables with 'SIMCTL_CHILD_', simctl
203
147
  // will then pass these to the child (spawned) process.
204
- env = lodash_1.default.defaults(lodash_1.default.mapKeys(env, (value, key) => lodash_1.default.startsWith(key, SIMCTL_ENV_PREFIX) ? key : `${SIMCTL_ENV_PREFIX}${key}`), process.env);
148
+ const env = lodash_1.default.defaults(lodash_1.default.mapKeys(initialEnv, (value, key) => lodash_1.default.startsWith(key, SIMCTL_ENV_PREFIX) ? key : `${SIMCTL_ENV_PREFIX}${key}`), process.env);
205
149
  const execOpts = {
206
150
  env,
207
151
  encoding,
@@ -211,13 +155,16 @@ class Simctl {
211
155
  }
212
156
  const xcrun = await this.requireXcrun();
213
157
  try {
214
- let execArgs = [xcrun, args, execOpts];
158
+ let execArgs;
215
159
  if (architectures?.length) {
216
160
  const archArgs = lodash_1.default.flatMap((lodash_1.default.isArray(architectures) ? architectures : [architectures]).map((arch) => ['-arch', arch]));
217
161
  execArgs = ['arch', [...archArgs, xcrun, ...args], execOpts];
218
162
  }
219
- // @ts-ignore We know what we are doing here
220
- return asynchronous ? new teen_process_1.SubProcess(...execArgs) : await (0, teen_process_1.exec)(...execArgs);
163
+ else {
164
+ execArgs = [xcrun, args, execOpts];
165
+ }
166
+ // We know what we are doing here - the type system can't handle the dynamic nature
167
+ return (asynchronous ? new teen_process_1.SubProcess(...execArgs) : await (0, teen_process_1.exec)(...execArgs));
221
168
  }
222
169
  catch (e) {
223
170
  if (!this.logErrors || !logErrors) {
@@ -226,56 +173,57 @@ class Simctl {
226
173
  }
227
174
  else if (e.stderr) {
228
175
  const msg = `Error running '${subcommand}': ${e.stderr.trim()}`;
229
- logger_1.default.debug(logger_1.LOG_PREFIX, msg);
176
+ logger_1.log.debug(logger_1.LOG_PREFIX, msg);
230
177
  e.message = msg;
231
178
  }
232
179
  else {
233
- logger_1.default.debug(logger_1.LOG_PREFIX, e.message);
180
+ logger_1.log.debug(logger_1.LOG_PREFIX, e.message);
234
181
  }
235
182
  throw e;
236
183
  }
237
184
  }
238
- addMedia = addmedia_1.default.addMedia;
239
- appInfo = appinfo_1.default.appInfo;
240
- bootDevice = boot_1.default.bootDevice;
241
- startBootMonitor = bootstatus_1.default.startBootMonitor;
242
- createDevice = create_1.default.createDevice;
243
- deleteDevice = delete_1.default.deleteDevice;
244
- eraseDevice = erase_1.default.eraseDevice;
245
- getAppContainer = get_app_container_1.default.getAppContainer;
246
- getEnv = getenv_1.default.getEnv;
247
- installApp = install_1.default.installApp;
248
- getScreenshot = io_1.default.getScreenshot;
249
- addRootCertificate = keychain_1.default.addRootCertificate;
250
- addCertificate = keychain_1.default.addCertificate;
251
- resetKeychain = keychain_1.default.resetKeychain;
252
- launchApp = launch_1.default.launchApp;
253
- getDevicesByParsing = list_1.default.getDevicesByParsing;
254
- getDevices = list_1.default.getDevices;
255
- getRuntimeForPlatformVersionViaJson = list_1.default.getRuntimeForPlatformVersionViaJson;
256
- getRuntimeForPlatformVersion = list_1.default.getRuntimeForPlatformVersion;
257
- getDeviceTypes = list_1.default.getDeviceTypes;
258
- list = list_1.default.list;
259
- setLocation = location_1.default.setLocation;
260
- clearLocation = location_1.default.clearLocation;
261
- openUrl = openurl_1.default.openUrl;
262
- setPasteboard = pbcopy_1.default.setPasteboard;
263
- getPasteboard = pbpaste_1.default.getPasteboard;
264
- grantPermission = privacy_1.default.grantPermission;
265
- revokePermission = privacy_1.default.revokePermission;
266
- resetPermission = privacy_1.default.resetPermission;
267
- pushNotification = push_1.default.pushNotification;
268
- shutdownDevice = shutdown_1.default.shutdownDevice;
269
- spawnProcess = spawn_1.default.spawnProcess;
270
- spawnSubProcess = spawn_1.default.spawnSubProcess;
271
- terminateApp = terminate_1.default.terminateApp;
272
- getAppearance = ui_1.default.getAppearance;
273
- setAppearance = ui_1.default.setAppearance;
274
- getIncreaseContrast = ui_1.default.getIncreaseContrast;
275
- setIncreaseContrast = ui_1.default.setIncreaseContrast;
276
- getContentSize = ui_1.default.getContentSize;
277
- setContentSize = ui_1.default.setContentSize;
278
- removeApp = uninstall_1.default.removeApp;
185
+ // Extension methods
186
+ addMedia = addmediaCommands.addMedia;
187
+ appInfo = appinfoCommands.appInfo;
188
+ bootDevice = bootCommands.bootDevice;
189
+ startBootMonitor = bootstatusCommands.startBootMonitor;
190
+ createDevice = createCommands.createDevice;
191
+ deleteDevice = deleteCommands.deleteDevice;
192
+ eraseDevice = eraseCommands.eraseDevice;
193
+ getAppContainer = getappcontainerCommands.getAppContainer;
194
+ getEnv = envCommands.getEnv;
195
+ installApp = installCommands.installApp;
196
+ getScreenshot = ioCommands.getScreenshot;
197
+ addRootCertificate = keychainCommands.addRootCertificate;
198
+ addCertificate = keychainCommands.addCertificate;
199
+ resetKeychain = keychainCommands.resetKeychain;
200
+ launchApp = launchCommands.launchApp;
201
+ getDevicesByParsing = listCommands.getDevicesByParsing;
202
+ getDevices = listCommands.getDevices;
203
+ getRuntimeForPlatformVersionViaJson = listCommands.getRuntimeForPlatformVersionViaJson;
204
+ getRuntimeForPlatformVersion = listCommands.getRuntimeForPlatformVersion;
205
+ getDeviceTypes = listCommands.getDeviceTypes;
206
+ list = listCommands.list;
207
+ setLocation = locationCommands.setLocation;
208
+ clearLocation = locationCommands.clearLocation;
209
+ openUrl = openurlCommands.openUrl;
210
+ setPasteboard = pbcopyCommands.setPasteboard;
211
+ getPasteboard = pbpasteCommands.getPasteboard;
212
+ grantPermission = privacyCommands.grantPermission;
213
+ revokePermission = privacyCommands.revokePermission;
214
+ resetPermission = privacyCommands.resetPermission;
215
+ pushNotification = pushCommands.pushNotification;
216
+ shutdownDevice = shutdownCommands.shutdownDevice;
217
+ spawnProcess = spawnCommands.spawnProcess;
218
+ spawnSubProcess = spawnCommands.spawnSubProcess;
219
+ terminateApp = terminateCommands.terminateApp;
220
+ getAppearance = uiCommands.getAppearance;
221
+ setAppearance = uiCommands.setAppearance;
222
+ getIncreaseContrast = uiCommands.getIncreaseContrast;
223
+ setIncreaseContrast = uiCommands.setIncreaseContrast;
224
+ getContentSize = uiCommands.getContentSize;
225
+ setContentSize = uiCommands.setContentSize;
226
+ removeApp = uninstallCommands.removeApp;
279
227
  }
280
228
  exports.Simctl = Simctl;
281
229
  exports.default = Simctl;
@@ -1 +1 @@
1
- {"version":3,"file":"simctl.js","sourceRoot":"","sources":["../../lib/simctl.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAuB;AACvB,kDAA0B;AAC1B,mDAA2C;AAC3C,uCAEmB;AACnB,+CAA0D;AAC1D,sEAAsD;AACtD,oEAAoD;AACpD,8DAA8C;AAC9C,0EAA0D;AAC1D,kEA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Aa,CAAC;IAC9C,eAAe,GAAG,eAAe,CAAC,eAAe,CAAC;IAClD,gBAAgB,GAAG,eAAe,CAAC,gBAAgB,CAAC;IACpD,eAAe,GAAG,eAAe,CAAC,eAAe,CAAC;IAClD,gBAAgB,GAAG,YAAY,CAAC,gBAAgB,CAAC;IACjD,cAAc,GAAG,gBAAgB,CAAC,cAAc,CAAC;IACjD,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC;IAC1C,eAAe,GAAG,aAAa,CAAC,eAAe,CAAC;IAChD,YAAY,GAAG,iBAAiB,CAAC,YAAY,CAAC;IAC9C,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC;IACzC,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC;IACzC,mBAAmB,GAAG,UAAU,CAAC,mBAAmB,CAAC;IACrD,mBAAmB,GAAG,UAAU,CAAC,mBAAmB,CAAC;IACrD,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;IAC3C,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;IAC3C,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC;CACzC;AAnLD,wBAmLC;AAED,kBAAe,MAAM,CAAC"}
@@ -1,17 +1,15 @@
1
- export default commands;
2
- declare namespace commands {
3
- /**
4
- * Add the particular media file to Simulator's library.
5
- * It is required that Simulator is in _booted_ state.
6
- *
7
- * @this {import('../simctl').Simctl}
8
- * @param {string} filePath - Full path to a media file on the local
9
- * file system.
10
- * @return {Promise<import('teen_process').TeenProcessExecResult>} Command execution result.
11
- * @throws {Error} If the corresponding simctl subcommand command
12
- * returns non-zero return code.
13
- * @throws {Error} If the `udid` instance property is unset
14
- */
15
- function addMedia(this: import("../simctl").default, filePath: string): Promise<import("teen_process").TeenProcessExecResult<any>>;
16
- }
1
+ import type { Simctl } from '../simctl';
2
+ import type { TeenProcessExecResult } from 'teen_process';
3
+ /**
4
+ * Add the particular media file to Simulator's library.
5
+ * It is required that Simulator is in _booted_ state.
6
+ *
7
+ * @param filePath - Full path to a media file on the local
8
+ * file system.
9
+ * @return Command execution result.
10
+ * @throws {Error} If the corresponding simctl subcommand command
11
+ * returns non-zero return code.
12
+ * @throws {Error} If the `udid` instance property is unset
13
+ */
14
+ export declare function addMedia(this: Simctl, filePath: string): Promise<TeenProcessExecResult<string>>;
17
15
  //# sourceMappingURL=addmedia.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"addmedia.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/addmedia.js"],"names":[],"mappings":";;IAEA;;;;;;;;;;;OAWG;IACH,+DAPW,MAAM,GAEL,OAAO,CAAC,iDAA4C,CAAC,CAShE"}
1
+ {"version":3,"file":"addmedia.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/addmedia.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE1D;;;;;;;;;;GAUG;AACH,wBAAsB,QAAQ,CAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAItG"}
@@ -1,22 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const commands = {};
3
+ exports.addMedia = addMedia;
4
4
  /**
5
5
  * Add the particular media file to Simulator's library.
6
6
  * It is required that Simulator is in _booted_ state.
7
7
  *
8
- * @this {import('../simctl').Simctl}
9
- * @param {string} filePath - Full path to a media file on the local
8
+ * @param filePath - Full path to a media file on the local
10
9
  * file system.
11
- * @return {Promise<import('teen_process').TeenProcessExecResult>} Command execution result.
10
+ * @return Command execution result.
12
11
  * @throws {Error} If the corresponding simctl subcommand command
13
12
  * returns non-zero return code.
14
13
  * @throws {Error} If the `udid` instance property is unset
15
14
  */
16
- commands.addMedia = async function addMedia(filePath) {
15
+ async function addMedia(filePath) {
17
16
  return await this.exec('addmedia', {
18
17
  args: [this.requireUdid('addmedia'), filePath],
19
18
  });
20
- };
21
- exports.default = commands;
19
+ }
22
20
  //# sourceMappingURL=addmedia.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"addmedia.js","sourceRoot":"","sources":["../../../lib/subcommands/addmedia.js"],"names":[],"mappings":";;AAAA,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB;;;;;;;;;;;GAWG;AACH,QAAQ,CAAC,QAAQ,GAAG,KAAK,UAAU,QAAQ,CAAE,QAAQ;IACnD,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;QACjC,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC;KAC/C,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"addmedia.js","sourceRoot":"","sources":["../../../lib/subcommands/addmedia.ts"],"names":[],"mappings":";;AAcA,4BAIC;AAfD;;;;;;;;;;GAUG;AACI,KAAK,UAAU,QAAQ,CAAgB,QAAgB;IAC5D,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;QACjC,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC;KAC/C,CAAC,CAAC;AACL,CAAC"}
@@ -1,46 +1,14 @@
1
- export default commands;
2
- declare namespace commands {
3
- /**
4
- * Invoke hidden appinfo subcommand to get the information
5
- * about applications installed on Simulator, including
6
- * system applications ({@link getAppContainer} does not "see" such apps).
7
- * Simulator server should be in 'booted' state for this call to work properly.
8
- * The tool is only available since Xcode SDK 8.1
9
- *
10
- * @this {import('../simctl').Simctl}
11
- * @param {string} bundleId - The bundle identifier of the target application.
12
- * @return {Promise<string>} The information about installed application.
13
- *
14
- * Example output for non-existing application container:
15
- * <pre>
16
- * {
17
- * CFBundleIdentifier = "com.apple.MobileSafari";
18
- * GroupContainers = {
19
- * };
20
- * SBAppTags = (
21
- * );
22
- * }
23
- * </pre>
24
- *
25
- * Example output for an existing system application container:
26
- * <pre>
27
- * {
28
- * ApplicationType = Hidden;
29
- * Bundle = "file:///Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/CoreServices/SpringBoard.app";
30
- * CFBundleDisplayName = SpringBoard;
31
- * CFBundleExecutable = SpringBoard;
32
- * CFBundleIdentifier = "com.apple.springboard";
33
- * CFBundleName = SpringBoard;
34
- * CFBundleVersion = 50;
35
- * GroupContainers = {
36
- * };
37
- * Path = "/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/CoreServices/SpringBoard.app";
38
- * SBAppTags = (
39
- * );
40
- * }
41
- * </pre>
42
- * @throws {Error} If the `udid` instance property is unset
43
- */
44
- function appInfo(this: import("../simctl").default, bundleId: string): Promise<string>;
45
- }
1
+ import type { Simctl } from '../simctl';
2
+ import type { AppInfo } from '../types';
3
+ /**
4
+ * Get information about an app installed on the simulator
5
+ *
6
+ * @param bundleId - Bundle identifier of the application
7
+ * @return App info object
8
+ * @throws {Error} If the app is not found
9
+ * @throws {Error} If the corresponding simctl subcommand command
10
+ * returns non-zero return code.
11
+ * @throws {Error} If the `udid` instance property is unset
12
+ */
13
+ export declare function appInfo(this: Simctl, bundleId: string): Promise<AppInfo>;
46
14
  //# sourceMappingURL=appinfo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"appinfo.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/appinfo.js"],"names":[],"mappings":";;IAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;IACH,8DAjCW,MAAM,GACL,OAAO,CAAC,MAAM,CAAC,CAqC1B"}
1
+ {"version":3,"file":"appinfo.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/appinfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAIxC;;;;;;;;;GASG;AACH,wBAAsB,OAAO,CAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAuB/E"}
@@ -1,52 +1,41 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const commands = {};
6
+ exports.appInfo = appInfo;
7
+ const helpers_1 = require("../helpers");
8
+ const lodash_1 = __importDefault(require("lodash"));
4
9
  /**
5
- * Invoke hidden appinfo subcommand to get the information
6
- * about applications installed on Simulator, including
7
- * system applications ({@link getAppContainer} does not "see" such apps).
8
- * Simulator server should be in 'booted' state for this call to work properly.
9
- * The tool is only available since Xcode SDK 8.1
10
- *
11
- * @this {import('../simctl').Simctl}
12
- * @param {string} bundleId - The bundle identifier of the target application.
13
- * @return {Promise<string>} The information about installed application.
10
+ * Get information about an app installed on the simulator
14
11
  *
15
- * Example output for non-existing application container:
16
- * <pre>
17
- * {
18
- * CFBundleIdentifier = "com.apple.MobileSafari";
19
- * GroupContainers = {
20
- * };
21
- * SBAppTags = (
22
- * );
23
- * }
24
- * </pre>
25
- *
26
- * Example output for an existing system application container:
27
- * <pre>
28
- * {
29
- * ApplicationType = Hidden;
30
- * Bundle = "file:///Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/CoreServices/SpringBoard.app";
31
- * CFBundleDisplayName = SpringBoard;
32
- * CFBundleExecutable = SpringBoard;
33
- * CFBundleIdentifier = "com.apple.springboard";
34
- * CFBundleName = SpringBoard;
35
- * CFBundleVersion = 50;
36
- * GroupContainers = {
37
- * };
38
- * Path = "/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/CoreServices/SpringBoard.app";
39
- * SBAppTags = (
40
- * );
41
- * }
42
- * </pre>
12
+ * @param bundleId - Bundle identifier of the application
13
+ * @return App info object
14
+ * @throws {Error} If the app is not found
15
+ * @throws {Error} If the corresponding simctl subcommand command
16
+ * returns non-zero return code.
43
17
  * @throws {Error} If the `udid` instance property is unset
44
18
  */
45
- commands.appInfo = async function appInfo(bundleId) {
19
+ async function appInfo(bundleId) {
46
20
  const { stdout } = await this.exec('appinfo', {
47
21
  args: [this.requireUdid('appinfo'), bundleId],
48
22
  });
49
- return (stdout || '').trim();
50
- };
51
- exports.default = commands;
23
+ let result;
24
+ try {
25
+ result = JSON.parse(stdout);
26
+ }
27
+ catch {
28
+ // If JSON parsing fails, use plutil to convert plist-style output to JSON
29
+ try {
30
+ result = await (0, helpers_1.convertPlistToJson)(stdout);
31
+ }
32
+ catch (err) {
33
+ throw new Error(`Cannot retrieve app info for ${bundleId}: ${err instanceof Error ? err.message : String(err)}`);
34
+ }
35
+ }
36
+ if (!lodash_1.default.isPlainObject(result) || !('ApplicationType' in result)) {
37
+ throw new Error(`App with bundle identifier "${bundleId}" not found. Is it installed?`);
38
+ }
39
+ return result;
40
+ }
52
41
  //# sourceMappingURL=appinfo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"appinfo.js","sourceRoot":"","sources":["../../../lib/subcommands/appinfo.js"],"names":[],"mappings":";;AAAA,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,QAAQ,CAAC,OAAO,GAAG,KAAK,UAAU,OAAO,CAAE,QAAQ;IACjD,MAAM,EAAC,MAAM,EAAC,G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AQ,+BAA+B,CAAC,CAAC;IAC1F,CAAC;IAED,OAAO,MAAiB,CAAC;AAC3B,CAAC"}
@@ -1,13 +1,10 @@
1
- export default commands;
2
- declare namespace commands {
3
- /**
4
- * Boot the particular Simulator if it is not running.
5
- *
6
- * @this {import('../simctl').Simctl}
7
- * @throws {Error} If the corresponding simctl subcommand command
8
- * returns non-zero return code.
9
- * @throws {Error} If the `udid` instance property is unset
10
- */
11
- function bootDevice(this: import("../simctl").default): Promise<void>;
12
- }
1
+ import type { Simctl } from '../simctl';
2
+ /**
3
+ * Boot the particular Simulator if it is not running.
4
+ *
5
+ * @throws {Error} If the corresponding simctl subcommand command
6
+ * returns non-zero return code.
7
+ * @throws {Error} If the `udid` instance property is unset
8
+ */
9
+ export declare function bootDevice(this: Simctl): Promise<void>;
13
10
  //# sourceMappingURL=boot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/boot.js"],"names":[],"mappings":";;IAMA;;;;;;;OAOG;IACH,sEAWC"}
1
+ {"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/boot.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAW7D"}