node-simctl 7.2.2 → 7.3.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 (130) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/build/index.js +9 -17
  3. package/build/lib/helpers.d.ts +13 -0
  4. package/build/lib/helpers.d.ts.map +1 -0
  5. package/build/lib/helpers.js +22 -16
  6. package/build/lib/helpers.js.map +1 -1
  7. package/build/lib/logger.d.ts +4 -0
  8. package/build/lib/logger.d.ts.map +1 -0
  9. package/build/lib/logger.js +13 -19
  10. package/build/lib/logger.js.map +1 -1
  11. package/build/lib/simctl.d.ts +131 -0
  12. package/build/lib/simctl.d.ts.map +1 -0
  13. package/build/lib/simctl.js +170 -94
  14. package/build/lib/simctl.js.map +1 -1
  15. package/build/lib/subcommands/addmedia.d.ts +16 -0
  16. package/build/lib/subcommands/addmedia.d.ts.map +1 -0
  17. package/build/lib/subcommands/addmedia.js +17 -12
  18. package/build/lib/subcommands/addmedia.js.map +1 -1
  19. package/build/lib/subcommands/appinfo.d.ts +45 -0
  20. package/build/lib/subcommands/appinfo.d.ts.map +1 -0
  21. package/build/lib/subcommands/appinfo.js +47 -15
  22. package/build/lib/subcommands/appinfo.js.map +1 -1
  23. package/build/lib/subcommands/boot.d.ts +12 -0
  24. package/build/lib/subcommands/boot.d.ts.map +1 -0
  25. package/build/lib/subcommands/boot.js +47 -22
  26. package/build/lib/subcommands/boot.js.map +1 -1
  27. package/build/lib/subcommands/bootstatus.d.ts +56 -0
  28. package/build/lib/subcommands/bootstatus.d.ts.map +1 -0
  29. package/build/lib/subcommands/bootstatus.js +102 -87
  30. package/build/lib/subcommands/bootstatus.js.map +1 -1
  31. package/build/lib/subcommands/create.d.ts +34 -0
  32. package/build/lib/subcommands/create.d.ts.map +1 -0
  33. package/build/lib/subcommands/create.js +115 -65
  34. package/build/lib/subcommands/create.js.map +1 -1
  35. package/build/lib/subcommands/delete.d.ts +12 -0
  36. package/build/lib/subcommands/delete.d.ts.map +1 -0
  37. package/build/lib/subcommands/delete.js +13 -12
  38. package/build/lib/subcommands/delete.js.map +1 -1
  39. package/build/lib/subcommands/erase.d.ts +15 -0
  40. package/build/lib/subcommands/erase.d.ts.map +1 -0
  41. package/build/lib/subcommands/erase.js +19 -14
  42. package/build/lib/subcommands/erase.js.map +1 -1
  43. package/build/lib/subcommands/get_app_container.d.ts +22 -0
  44. package/build/lib/subcommands/get_app_container.d.ts.map +1 -0
  45. package/build/lib/subcommands/get_app_container.js +26 -19
  46. package/build/lib/subcommands/get_app_container.js.map +1 -1
  47. package/build/lib/subcommands/getenv.d.ts +14 -0
  48. package/build/lib/subcommands/getenv.d.ts.map +1 -0
  49. package/build/lib/subcommands/getenv.js +17 -17
  50. package/build/lib/subcommands/getenv.js.map +1 -1
  51. package/build/lib/subcommands/index.d.ts +3 -0
  52. package/build/lib/subcommands/index.d.ts.map +1 -0
  53. package/build/lib/subcommands/index.js +33 -36
  54. package/build/lib/subcommands/index.js.map +1 -1
  55. package/build/lib/subcommands/install.d.ts +15 -0
  56. package/build/lib/subcommands/install.d.ts.map +1 -0
  57. package/build/lib/subcommands/install.js +16 -12
  58. package/build/lib/subcommands/install.js.map +1 -1
  59. package/build/lib/subcommands/io.d.ts +15 -0
  60. package/build/lib/subcommands/io.d.ts.map +1 -0
  61. package/build/lib/subcommands/io.js +32 -25
  62. package/build/lib/subcommands/io.js.map +1 -1
  63. package/build/lib/subcommands/keychain.d.ts +53 -0
  64. package/build/lib/subcommands/keychain.d.ts.map +1 -0
  65. package/build/lib/subcommands/keychain.js +85 -51
  66. package/build/lib/subcommands/keychain.js.map +1 -1
  67. package/build/lib/subcommands/launch.d.ts +19 -0
  68. package/build/lib/subcommands/launch.d.ts.map +1 -0
  69. package/build/lib/subcommands/launch.js +28 -19
  70. package/build/lib/subcommands/launch.js.map +1 -1
  71. package/build/lib/subcommands/list.d.ts +120 -0
  72. package/build/lib/subcommands/list.d.ts.map +1 -0
  73. package/build/lib/subcommands/list.js +296 -138
  74. package/build/lib/subcommands/list.js.map +1 -1
  75. package/build/lib/subcommands/location.d.ts +20 -0
  76. package/build/lib/subcommands/location.d.ts.map +1 -0
  77. package/build/lib/subcommands/location.js +37 -22
  78. package/build/lib/subcommands/location.js.map +1 -1
  79. package/build/lib/subcommands/openurl.d.ts +17 -0
  80. package/build/lib/subcommands/openurl.d.ts.map +1 -0
  81. package/build/lib/subcommands/openurl.js +18 -12
  82. package/build/lib/subcommands/openurl.js.map +1 -1
  83. package/build/lib/subcommands/pbcopy.d.ts +17 -0
  84. package/build/lib/subcommands/pbcopy.d.ts.map +1 -0
  85. package/build/lib/subcommands/pbcopy.js +26 -20
  86. package/build/lib/subcommands/pbcopy.js.map +1 -1
  87. package/build/lib/subcommands/pbpaste.d.ts +17 -0
  88. package/build/lib/subcommands/pbpaste.d.ts.map +1 -0
  89. package/build/lib/subcommands/pbpaste.js +20 -16
  90. package/build/lib/subcommands/pbpaste.js.map +1 -1
  91. package/build/lib/subcommands/privacy.d.ts +55 -0
  92. package/build/lib/subcommands/privacy.d.ts.map +1 -0
  93. package/build/lib/subcommands/privacy.js +60 -18
  94. package/build/lib/subcommands/privacy.js.map +1 -1
  95. package/build/lib/subcommands/push.d.ts +25 -0
  96. package/build/lib/subcommands/push.d.ts.map +1 -0
  97. package/build/lib/subcommands/push.js +41 -24
  98. package/build/lib/subcommands/push.js.map +1 -1
  99. package/build/lib/subcommands/shutdown.d.ts +12 -0
  100. package/build/lib/subcommands/shutdown.d.ts.map +1 -0
  101. package/build/lib/subcommands/shutdown.js +47 -22
  102. package/build/lib/subcommands/shutdown.js.map +1 -1
  103. package/build/lib/subcommands/spawn.d.ts +26 -0
  104. package/build/lib/subcommands/spawn.d.ts.map +1 -0
  105. package/build/lib/subcommands/spawn.js +42 -26
  106. package/build/lib/subcommands/spawn.js.map +1 -1
  107. package/build/lib/subcommands/terminate.d.ts +15 -0
  108. package/build/lib/subcommands/terminate.d.ts.map +1 -0
  109. package/build/lib/subcommands/terminate.js +16 -12
  110. package/build/lib/subcommands/terminate.js.map +1 -1
  111. package/build/lib/subcommands/ui.d.ts +24 -0
  112. package/build/lib/subcommands/ui.d.ts.map +1 -0
  113. package/build/lib/subcommands/ui.js +32 -20
  114. package/build/lib/subcommands/ui.js.map +1 -1
  115. package/build/lib/subcommands/uninstall.d.ts +16 -0
  116. package/build/lib/subcommands/uninstall.d.ts.map +1 -0
  117. package/build/lib/subcommands/uninstall.js +17 -12
  118. package/build/lib/subcommands/uninstall.js.map +1 -1
  119. package/lib/simctl.js +13 -3
  120. package/lib/subcommands/addmedia.js +1 -1
  121. package/lib/subcommands/bootstatus.js +2 -2
  122. package/lib/subcommands/create.js +2 -2
  123. package/lib/subcommands/erase.js +1 -1
  124. package/lib/subcommands/keychain.js +2 -2
  125. package/lib/subcommands/launch.js +1 -0
  126. package/lib/subcommands/list.js +6 -6
  127. package/lib/subcommands/location.js +1 -1
  128. package/lib/subcommands/openurl.js +1 -1
  129. package/lib/subcommands/spawn.js +2 -2
  130. package/package.json +29 -18
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [7.3.1](https://github.com/appium/node-simctl/compare/v7.3.0...v7.3.1) (2023-08-25)
2
+
3
+
4
+ ### Miscellaneous Chores
5
+
6
+ * **deps-dev:** bump semantic-release from 20.1.3 to 21.1.0 ([#194](https://github.com/appium/node-simctl/issues/194)) ([2943a2f](https://github.com/appium/node-simctl/commit/2943a2f27095a9df2ec5965d3dd9dbd82d4c26ad))
7
+
8
+ ## [7.3.0](https://github.com/appium/node-simctl/compare/v7.2.2...v7.3.0) (2023-08-18)
9
+
10
+
11
+ ### Features
12
+
13
+ * Switch from babel to typescript ([#190](https://github.com/appium/node-simctl/issues/190)) ([bed549f](https://github.com/appium/node-simctl/commit/bed549f4be5c0261ebc2e479fdbed68db963fc15))
14
+
1
15
  ## [7.2.2](https://github.com/appium/node-simctl/compare/v7.2.1...v7.2.2) (2023-08-14)
2
16
 
3
17
 
package/build/index.js CHANGED
@@ -1,18 +1,10 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- Object.defineProperty(exports, "Simctl", {
8
- enumerable: true,
9
- get: function () {
10
- return _simctl.default;
11
- }
12
- });
13
- exports.default = void 0;
14
- require("source-map-support/register");
15
- var _simctl = _interopRequireDefault(require("./lib/simctl"));
16
- var _default = _simctl.default;
17
- exports.default = _default;
18
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfc2ltY3RsIiwiX2ludGVyb3BSZXF1aXJlRGVmYXVsdCIsInJlcXVpcmUiLCJfZGVmYXVsdCIsIlNpbWN0bCIsImV4cG9ydHMiLCJkZWZhdWx0Il0sInNvdXJjZXMiOlsiLi4vaW5kZXguanMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFNpbWN0bCBmcm9tICcuL2xpYi9zaW1jdGwnO1xuXG5leHBvcnQgeyBTaW1jdGwgfTtcbmV4cG9ydCBkZWZhdWx0IFNpbWN0bDtcbiJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7QUFBQSxJQUFBQSxPQUFBLEdBQUFDLHNCQUFBLENBQUFDLE9BQUE7QUFBa0MsSUFBQUMsUUFBQSxHQUduQkMsZUFBTTtBQUFBQyxPQUFBLENBQUFDLE9BQUEsR0FBQUgsUUFBQSJ9
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Simctl = void 0;
7
+ const simctl_1 = __importDefault(require("./lib/simctl"));
8
+ exports.Simctl = simctl_1.default;
9
+ exports.default = simctl_1.default;
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,13 @@
1
+ export function getXcrunBinary(): string;
2
+ export const DEFAULT_EXEC_TIMEOUT: number;
3
+ export const SIM_RUNTIME_NAME: "com.apple.CoreSimulator.SimRuntime.";
4
+ /**
5
+ * "Normalize" the version, since iOS uses 'major.minor' but the runtimes can
6
+ * be 'major.minor.patch'
7
+ *
8
+ * @param {string} version - the string version
9
+ * @return {string} The version in 'major.minor' form
10
+ * @throws {Error} If the version not parseable by the `semver` package
11
+ */
12
+ export function normalizeVersion(version: string): string;
13
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +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,24 +1,30 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.getXcrunBinary = exports.SIM_RUNTIME_NAME = exports.DEFAULT_EXEC_TIMEOUT = void 0;
8
- exports.normalizeVersion = normalizeVersion;
9
- require("source-map-support/register");
10
- var _semver = _interopRequireDefault(require("semver"));
11
- const DEFAULT_EXEC_TIMEOUT = 10 * 60 * 1000;
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getXcrunBinary = exports.normalizeVersion = exports.SIM_RUNTIME_NAME = exports.DEFAULT_EXEC_TIMEOUT = void 0;
7
+ const semver_1 = __importDefault(require("semver"));
8
+ const DEFAULT_EXEC_TIMEOUT = 10 * 60 * 1000; // ms
12
9
  exports.DEFAULT_EXEC_TIMEOUT = DEFAULT_EXEC_TIMEOUT;
13
10
  const SIM_RUNTIME_NAME = 'com.apple.CoreSimulator.SimRuntime.';
14
11
  exports.SIM_RUNTIME_NAME = SIM_RUNTIME_NAME;
12
+ /**
13
+ * "Normalize" the version, since iOS uses 'major.minor' but the runtimes can
14
+ * be 'major.minor.patch'
15
+ *
16
+ * @param {string} version - the string version
17
+ * @return {string} The version in 'major.minor' form
18
+ * @throws {Error} If the version not parseable by the `semver` package
19
+ */
15
20
  function normalizeVersion(version) {
16
- const semverVersion = _semver.default.coerce(version);
17
- if (!semverVersion) {
18
- throw new Error(`Unable to parse version '${version}'`);
19
- }
20
- return `${semverVersion.major}.${semverVersion.minor}`;
21
+ const semverVersion = semver_1.default.coerce(version);
22
+ if (!semverVersion) {
23
+ throw new Error(`Unable to parse version '${version}'`);
24
+ }
25
+ return `${semverVersion.major}.${semverVersion.minor}`;
21
26
  }
27
+ exports.normalizeVersion = normalizeVersion;
22
28
  const getXcrunBinary = () => process.env.XCRUN_BINARY || 'xcrun';
23
29
  exports.getXcrunBinary = getXcrunBinary;
24
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfc2VtdmVyIiwiX2ludGVyb3BSZXF1aXJlRGVmYXVsdCIsInJlcXVpcmUiLCJERUZBVUxUX0VYRUNfVElNRU9VVCIsImV4cG9ydHMiLCJTSU1fUlVOVElNRV9OQU1FIiwibm9ybWFsaXplVmVyc2lvbiIsInZlcnNpb24iLCJzZW12ZXJWZXJzaW9uIiwic2VtdmVyIiwiY29lcmNlIiwiRXJyb3IiLCJtYWpvciIsIm1pbm9yIiwiZ2V0WGNydW5CaW5hcnkiLCJwcm9jZXNzIiwiZW52IiwiWENSVU5fQklOQVJZIl0sInNvdXJjZXMiOlsiLi4vLi4vbGliL2hlbHBlcnMuanMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHNlbXZlciBmcm9tICdzZW12ZXInO1xuXG5jb25zdCBERUZBVUxUX0VYRUNfVElNRU9VVCA9IDEwICogNjAgKiAxMDAwOyAvLyBtc1xuY29uc3QgU0lNX1JVTlRJTUVfTkFNRSA9ICdjb20uYXBwbGUuQ29yZVNpbXVsYXRvci5TaW1SdW50aW1lLic7XG5cbi8qKlxuICogXCJOb3JtYWxpemVcIiB0aGUgdmVyc2lvbiwgc2luY2UgaU9TIHVzZXMgJ21ham9yLm1pbm9yJyBidXQgdGhlIHJ1bnRpbWVzIGNhblxuICogYmUgJ21ham9yLm1pbm9yLnBhdGNoJ1xuICpcbiAqIEBwYXJhbSB7c3RyaW5nfSB2ZXJzaW9uIC0gdGhlIHN0cmluZyB2ZXJzaW9uXG4gKiBAcmV0dXJuIHtzdHJpbmd9IFRoZSB2ZXJzaW9uIGluICdtYWpvci5taW5vcicgZm9ybVxuICogQHRocm93cyB7RXJyb3J9IElmIHRoZSB2ZXJzaW9uIG5vdCBwYXJzZWFibGUgYnkgdGhlIGBzZW12ZXJgIHBhY2thZ2VcbiAqL1xuZnVuY3Rpb24gbm9ybWFsaXplVmVyc2lvbiAodmVyc2lvbikge1xuICBjb25zdCBzZW12ZXJWZXJzaW9uID0gc2VtdmVyLmNvZXJjZSh2ZXJzaW9uKTtcbiAgaWYgKCFzZW12ZXJWZXJzaW9uKSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKGBVbmFibGUgdG8gcGFyc2UgdmVyc2lvbiAnJHt2ZXJzaW9ufSdgKTtcbiAgfVxuICByZXR1cm4gYCR7c2VtdmVyVmVyc2lvbi5tYWpvcn0uJHtzZW12ZXJWZXJzaW9uLm1pbm9yfWA7XG59XG5cbmV4cG9ydCB7XG4gIERFRkFVTFRfRVhFQ19USU1FT1VULCBTSU1fUlVOVElNRV9OQU1FLFxuICBub3JtYWxpemVWZXJzaW9uLFxufTtcblxuZXhwb3J0IGNvbnN0IGdldFhjcnVuQmluYXJ5ID0gKCkgPT4gcHJvY2Vzcy5lbnYuWENSVU5fQklOQVJZIHx8ICd4Y3J1bic7XG4iXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQUFBLElBQUFBLE9BQUEsR0FBQUMsc0JBQUEsQ0FBQUMsT0FBQTtBQUVBLE1BQU1DLG9CQUFvQixHQUFHLEVBQUUsR0FBRyxFQUFFLEdBQUcsSUFBSTtBQUFDQyxPQUFBLENBQUFELG9CQUFBLEdBQUFBLG9CQUFBO0FBQzVDLE1BQU1FLGdCQUFnQixHQUFHLHFDQUFxQztBQUFDRCxPQUFBLENBQUFDLGdCQUFBLEdBQUFBLGdCQUFBO0FBVS9ELFNBQVNDLGdCQUFnQkEsQ0FBRUMsT0FBTyxFQUFFO0VBQ2xDLE1BQU1DLGFBQWEsR0FBR0MsZUFBTSxDQUFDQyxNQUFNLENBQUNILE9BQU8sQ0FBQztFQUM1QyxJQUFJLENBQUNDLGFBQWEsRUFBRTtJQUNsQixNQUFNLElBQUlHLEtBQUssQ0FBRSw0QkFBMkJKLE9BQVEsR0FBRSxDQUFDO0VBQ3pEO0VBQ0EsT0FBUSxHQUFFQyxhQUFhLENBQUNJLEtBQU0sSUFBR0osYUFBYSxDQUFDSyxLQUFNLEVBQUM7QUFDeEQ7QUFPTyxNQUFNQyxjQUFjLEdBQUdBLENBQUEsS0FBTUMsT0FBTyxDQUFDQyxHQUFHLENBQUNDLFlBQVksSUFBSSxPQUFPO0FBQUNiLE9BQUEsQ0FBQVUsY0FBQSxHQUFBQSxjQUFBIn0=
30
+ //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","names":["_semver","_interopRequireDefault","require","DEFAULT_EXEC_TIMEOUT","exports","SIM_RUNTIME_NAME","normalizeVersion","version","semverVersion","semver","coerce","Error","major","minor","getXcrunBinary","process","env","XCRUN_BINARY"],"sources":["../../lib/helpers.js"],"sourcesContent":["import semver from 'semver';\n\nconst DEFAULT_EXEC_TIMEOUT = 10 * 60 * 1000; // ms\nconst SIM_RUNTIME_NAME = 'com.apple.CoreSimulator.SimRuntime.';\n\n/**\n * \"Normalize\" the version, since iOS uses 'major.minor' but the runtimes can\n * be 'major.minor.patch'\n *\n * @param {string} version - the string version\n * @return {string} The version in 'major.minor' form\n * @throws {Error} If the version not parseable by the `semver` package\n */\nfunction normalizeVersion (version) {\n const semverVersion = semver.coerce(version);\n if (!semverVersion) {\n throw new Error(`Unable to parse version '${version}'`);\n }\n return `${semverVersion.major}.${semverVersion.minor}`;\n}\n\nexport {\n DEFAULT_EXEC_TIMEOUT, SIM_RUNTIME_NAME,\n normalizeVersion,\n};\n\nexport const getXcrunBinary = () => process.env.XCRUN_BINARY || 'xcrun';\n"],"mappings":";;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,MAAMC,oBAAoB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;AAACC,OAAA,CAAAD,oBAAA,GAAAA,oBAAA;AAC5C,MAAME,gBAAgB,GAAG,qCAAqC;AAACD,OAAA,CAAAC,gBAAA,GAAAA,gBAAA;AAU/D,SAASC,gBAAgBA,CAAEC,OAAO,EAAE;EAClC,MAAMC,aAAa,GAAGC,eAAM,CAACC,MAAM,CAACH,OAAO,CAAC;EAC5C,IAAI,CAACC,aAAa,EAAE;IAClB,MAAM,IAAIG,KAAK,CAAE,4BAA2BJ,OAAQ,GAAE,CAAC;EACzD;EACA,OAAQ,GAAEC,aAAa,CAACI,KAAM,IAAGJ,aAAa,CAACK,KAAM,EAAC;AACxD;AAOO,MAAMC,cAAc,GAAGA,CAAA,KAAMC,OAAO,CAACC,GAAG,CAACC,YAAY,IAAI,OAAO;AAACb,OAAA,CAAAU,cAAA,GAAAA,cAAA"}
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"}
@@ -0,0 +1,4 @@
1
+ export default log;
2
+ export const LOG_PREFIX: "simctl";
3
+ declare const log: any;
4
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../lib/logger.js"],"names":[],"mappings":";AAGA,kCAA4B;AAU5B,uBAAwB"}
@@ -1,25 +1,19 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = exports.LOG_PREFIX = void 0;
8
- require("source-map-support/register");
9
- var _npmlog = _interopRequireDefault(require("npmlog"));
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.LOG_PREFIX = void 0;
7
+ const npmlog_1 = __importDefault(require("npmlog"));
10
8
  const LOG_PREFIX = 'simctl';
11
9
  exports.LOG_PREFIX = LOG_PREFIX;
12
10
  function getLogger() {
13
- const logger = global._global_npmlog || _npmlog.default;
14
- if (!logger.debug) {
15
- logger.addLevel('debug', 1000, {
16
- fg: 'blue',
17
- bg: 'black'
18
- }, 'dbug');
19
- }
20
- return logger;
11
+ const logger = global._global_npmlog || npmlog_1.default;
12
+ if (!logger.debug) {
13
+ logger.addLevel('debug', 1000, { fg: 'blue', bg: 'black' }, 'dbug');
14
+ }
15
+ return logger;
21
16
  }
22
17
  const log = getLogger();
23
- var _default = log;
24
- exports.default = _default;
25
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfbnBtbG9nIiwiX2ludGVyb3BSZXF1aXJlRGVmYXVsdCIsInJlcXVpcmUiLCJMT0dfUFJFRklYIiwiZXhwb3J0cyIsImdldExvZ2dlciIsImxvZ2dlciIsImdsb2JhbCIsIl9nbG9iYWxfbnBtbG9nIiwibnBtbG9nIiwiZGVidWciLCJhZGRMZXZlbCIsImZnIiwiYmciLCJsb2ciLCJfZGVmYXVsdCIsImRlZmF1bHQiXSwic291cmNlcyI6WyIuLi8uLi9saWIvbG9nZ2VyLmpzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBucG1sb2cgZnJvbSAnbnBtbG9nJztcblxuXG5jb25zdCBMT0dfUFJFRklYID0gJ3NpbWN0bCc7XG5cbmZ1bmN0aW9uIGdldExvZ2dlciAoKSB7XG4gIGNvbnN0IGxvZ2dlciA9IGdsb2JhbC5fZ2xvYmFsX25wbWxvZyB8fCBucG1sb2c7XG4gIGlmICghbG9nZ2VyLmRlYnVnKSB7XG4gICAgbG9nZ2VyLmFkZExldmVsKCdkZWJ1ZycsIDEwMDAsIHsgZmc6ICdibHVlJywgYmc6ICdibGFjaycgfSwgJ2RidWcnKTtcbiAgfVxuICByZXR1cm4gbG9nZ2VyO1xufVxuXG5jb25zdCBsb2cgPSBnZXRMb2dnZXIoKTtcblxuZXhwb3J0IHsgTE9HX1BSRUZJWCB9O1xuZXhwb3J0IGRlZmF1bHQgbG9nO1xuIl0sIm1hcHBpbmdzIjoiOzs7Ozs7OztBQUFBLElBQUFBLE9BQUEsR0FBQUMsc0JBQUEsQ0FBQUMsT0FBQTtBQUdBLE1BQU1DLFVBQVUsR0FBRyxRQUFRO0FBQUNDLE9BQUEsQ0FBQUQsVUFBQSxHQUFBQSxVQUFBO0FBRTVCLFNBQVNFLFNBQVNBLENBQUEsRUFBSTtFQUNwQixNQUFNQyxNQUFNLEdBQUdDLE1BQU0sQ0FBQ0MsY0FBYyxJQUFJQyxlQUFNO0VBQzlDLElBQUksQ0FBQ0gsTUFBTSxDQUFDSSxLQUFLLEVBQUU7SUFDakJKLE1BQU0sQ0FBQ0ssUUFBUSxDQUFDLE9BQU8sRUFBRSxJQUFJLEVBQUU7TUFBRUMsRUFBRSxFQUFFLE1BQU07TUFBRUMsRUFBRSxFQUFFO0lBQVEsQ0FBQyxFQUFFLE1BQU0sQ0FBQztFQUNyRTtFQUNBLE9BQU9QLE1BQU07QUFDZjtBQUVBLE1BQU1RLEdBQUcsR0FBR1QsU0FBUyxDQUFDLENBQUM7QUFBQyxJQUFBVSxRQUFBLEdBR1RELEdBQUc7QUFBQVYsT0FBQSxDQUFBWSxPQUFBLEdBQUFELFFBQUEifQ==
18
+ exports.default = log;
19
+ //# sourceMappingURL=logger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","names":["_npmlog","_interopRequireDefault","require","LOG_PREFIX","exports","getLogger","logger","global","_global_npmlog","npmlog","debug","addLevel","fg","bg","log","_default","default"],"sources":["../../lib/logger.js"],"sourcesContent":["import npmlog from 'npmlog';\n\n\nconst LOG_PREFIX = 'simctl';\n\nfunction getLogger () {\n const logger = global._global_npmlog || npmlog;\n if (!logger.debug) {\n logger.addLevel('debug', 1000, { fg: 'blue', bg: 'black' }, 'dbug');\n }\n return logger;\n}\n\nconst log = getLogger();\n\nexport { LOG_PREFIX };\nexport default log;\n"],"mappings":";;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,MAAMC,UAAU,GAAG,QAAQ;AAACC,OAAA,CAAAD,UAAA,GAAAA,UAAA;AAE5B,SAASE,SAASA,CAAA,EAAI;EACpB,MAAMC,MAAM,GAAGC,MAAM,CAACC,cAAc,IAAIC,eAAM;EAC9C,IAAI,CAACH,MAAM,CAACI,KAAK,EAAE;IACjBJ,MAAM,CAACK,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE;MAAEC,EAAE,EAAE,MAAM;MAAEC,EAAE,EAAE;IAAQ,CAAC,EAAE,MAAM,CAAC;EACrE;EACA,OAAOP,MAAM;AACf;AAEA,MAAMQ,GAAG,GAAGT,SAAS,CAAC,CAAC;AAAC,IAAAU,QAAA,GAGTD,GAAG;AAAAV,OAAA,CAAAY,OAAA,GAAAD,QAAA"}
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../lib/logger.js"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAG5B,MAAM,UAAU,GAAG,QAAQ,CAAC;AAYnB,gCAAU;AAVnB,SAAS,SAAS;IAChB,MAAM,MAAM,GAAG,MAAM,CAAC,cAAc,IAAI,gBAAM,CAAC;IAC/C,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE;QACjB,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,MAAM,CAAC,CAAC;KACrE;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,GAAG,GAAG,SAAS,EAAE,CAAC;AAGxB,kBAAe,GAAG,CAAC"}
@@ -0,0 +1,131 @@
1
+ export default Simctl;
2
+ export type ExecOpts = {
3
+ /**
4
+ * [[]] - The list of additional subcommand arguments.
5
+ * It's empty by default.
6
+ */
7
+ args: string[];
8
+ /**
9
+ * [{}] - Environment variables mapping. All these variables
10
+ * will be passed Simulator and used in the executing function.
11
+ */
12
+ env: any;
13
+ /**
14
+ * [true] - Set it to _false_ to throw execution errors
15
+ * immediately without logging any additional information.
16
+ */
17
+ logErrors: boolean;
18
+ /**
19
+ * [false] - Whether to execute the given command
20
+ * 'synchronously' or 'asynchronously'. Affects the returned result of the function.
21
+ */
22
+ asynchronous: boolean;
23
+ /**
24
+ * - Explicitly sets streams encoding for the executed
25
+ * command input and outputs.
26
+ */
27
+ encoding: string | null;
28
+ /**
29
+ * - One or more architecture names to be enforced while
30
+ * executing xcrun. See https://github.com/appium/appium/issues/18966 for more details.
31
+ */
32
+ architectures: string | string[];
33
+ };
34
+ export type SimctlOpts = {
35
+ /**
36
+ * - The xcrun properties. Currently only one property
37
+ * is supported, which is `path` and it by default contains `null`, which enforces
38
+ * the instance to automatically detect the full path to `xcrun` tool and to throw
39
+ * an exception if it cannot be detected. If the path is set upon instance creation
40
+ * then it is going to be used by `exec` and no autodetection will happen.
41
+ */
42
+ xcrun: any | null;
43
+ /**
44
+ * [600000] - The maximum number of milliseconds
45
+ * to wait for single synchronous xcrun command.
46
+ */
47
+ execTimeout: number;
48
+ /**
49
+ * [true] - Whether to wire xcrun error messages
50
+ * into debug log before throwing them.
51
+ */
52
+ logErrors: boolean;
53
+ /**
54
+ * - The unique identifier of the current device, which is
55
+ * going to be implicitly passed to all methods, which require it. It can either be set
56
+ * upon instance creation if it is already known in advance or later when/if needed via the
57
+ * corresponding instance setter.
58
+ */
59
+ udid: string | null;
60
+ /**
61
+ * - Full path to the set of devices that you want to manage.
62
+ * By default this path usually equals to ~/Library/Developer/CoreSimulator/Devices
63
+ */
64
+ devicesSetPath: string | null;
65
+ };
66
+ /**
67
+ * @typedef {Object} ExecOpts
68
+ * @property {string[]} args [[]] - The list of additional subcommand arguments.
69
+ * It's empty by default.
70
+ * @property {Object} env [{}] - Environment variables mapping. All these variables
71
+ * will be passed Simulator and used in the executing function.
72
+ * @property {boolean} logErrors [true] - Set it to _false_ to throw execution errors
73
+ * immediately without logging any additional information.
74
+ * @property {boolean} asynchronous [false] - Whether to execute the given command
75
+ * 'synchronously' or 'asynchronously'. Affects the returned result of the function.
76
+ * @property {string?} encoding - Explicitly sets streams encoding for the executed
77
+ * command input and outputs.
78
+ * @property {string|string[]} architectures - One or more architecture names to be enforced while
79
+ * executing xcrun. See https://github.com/appium/appium/issues/18966 for more details.
80
+ */
81
+ /**
82
+ * @typedef {Object} SimctlOpts
83
+ * @property {Object?} xcrun - The xcrun properties. Currently only one property
84
+ * is supported, which is `path` and it by default contains `null`, which enforces
85
+ * the instance to automatically detect the full path to `xcrun` tool and to throw
86
+ * an exception if it cannot be detected. If the path is set upon instance creation
87
+ * then it is going to be used by `exec` and no autodetection will happen.
88
+ * @property {number} execTimeout [600000] - The maximum number of milliseconds
89
+ * to wait for single synchronous xcrun command.
90
+ * @property {boolean} logErrors [true] - Whether to wire xcrun error messages
91
+ * into debug log before throwing them.
92
+ * @property {string?} udid - The unique identifier of the current device, which is
93
+ * going to be implicitly passed to all methods, which require it. It can either be set
94
+ * upon instance creation if it is already known in advance or later when/if needed via the
95
+ * corresponding instance setter.
96
+ * @property {string?} devicesSetPath - Full path to the set of devices that you want to manage.
97
+ * By default this path usually equals to ~/Library/Developer/CoreSimulator/Devices
98
+ */
99
+ export class Simctl {
100
+ /**
101
+ * @param {Partial<SimctlOpts>} opts
102
+ */
103
+ constructor(opts?: Partial<SimctlOpts>);
104
+ /** @type {any?} */
105
+ xcrun: any | null;
106
+ /** @type {number} */
107
+ execTimeout: number;
108
+ /** @type {boolean} */
109
+ logErrors: boolean;
110
+ _udid: string | null;
111
+ _devicesSetPath: string | null;
112
+ set udid(arg: string | null);
113
+ get udid(): string | null;
114
+ set devicesSetPath(arg: string | null);
115
+ get devicesSetPath(): string | null;
116
+ requireUdid(commandName?: null): string;
117
+ requireXcrun(): Promise<any>;
118
+ /**
119
+ * Execute the particular simctl command.
120
+ *
121
+ * @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
126
+ * `SubProcess` instance depending of `opts.asynchronous` value.
127
+ * @throws {Error} If the simctl subcommand command returns non-zero return code.
128
+ */
129
+ exec(subcommand: string, opts?: Partial<ExecOpts>): Promise<import("teen_process").TeenProcessExecResult<any> | import('teen_process').SubProcess>;
130
+ }
131
+ //# sourceMappingURL=simctl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simctl.d.ts","sourceRoot":"","sources":["../../lib/simctl.js"],"names":[],"mappings":";;;;;;UAoBc,MAAM,EAAE;;;;;;;;;;eAIR,OAAO;;;;;kBAEP,OAAO;;;;;cAEP,MAAM;;;;;mBAEN,MAAM,GAAC,MAAM,EAAE;;;;;;;;;;;;;;;iBAYf,MAAM;;;;;eAEN,OAAO;;;;;;;UAEP,MAAM;;;;;oBAIN,MAAM;;AAhCpB;;;;;;;;;;;;;;GAcG;AAGH;;;;;;;;;;;;;;;;;GAiBG;AAGH;IAUE;;OAEG;IACH,mBAFW,QAAQ,UAAU,CAAC,EAU7B;IApBD,mBAAmB;IACnB,OADW,GAAG,QACR;IAEN,qBAAqB;IACrB,aADW,MAAM,CACL;IAEZ,sBAAsB;IACtB,WADW,OAAO,CACR;IAWR,qBAAkD;IAClD,+BAAgF;IAGlF,6BAEC;IAED,0BAEC;IAED,uCAEC;IAED,oCAEC;IAED,wCAMC;IAED,6BAYC;IAED;;;;;;;;;;OAUG;IACH,iBARW,MAAM,SAGN,QAAQ,QAAQ,CAAC,GAChB,QAAQ,oDAA6C,OAAO,cAAc,EAAE,UAAU,CAAC,CAyDlG;CACF"}