appium-ios-simulator 8.1.2 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/build/lib/extensions/applications.d.ts.map +1 -1
- package/build/lib/extensions/applications.js +2 -3
- package/build/lib/extensions/applications.js.map +1 -1
- package/build/lib/extensions/biometric.js +2 -2
- package/build/lib/extensions/biometric.js.map +1 -1
- package/build/lib/extensions/keychain.d.ts.map +1 -1
- package/build/lib/extensions/keychain.js +5 -9
- package/build/lib/extensions/keychain.js.map +1 -1
- package/build/lib/extensions/permissions.js +2 -2
- package/build/lib/extensions/permissions.js.map +1 -1
- package/build/lib/extensions/settings.d.ts.map +1 -1
- package/build/lib/extensions/settings.js +10 -11
- package/build/lib/extensions/settings.js.map +1 -1
- package/build/lib/simulator-xcode-14.d.ts +2 -0
- package/build/lib/simulator-xcode-14.d.ts.map +1 -1
- package/build/lib/simulator-xcode-14.js +19 -22
- package/build/lib/simulator-xcode-14.js.map +1 -1
- package/build/lib/simulator-xcode-15.d.ts.map +1 -1
- package/build/lib/simulator-xcode-15.js +2 -16
- package/build/lib/simulator-xcode-15.js.map +1 -1
- package/build/lib/simulator-xcode-27.d.ts +6 -0
- package/build/lib/simulator-xcode-27.d.ts.map +1 -0
- package/build/lib/simulator-xcode-27.js +13 -0
- package/build/lib/simulator-xcode-27.js.map +1 -0
- package/build/lib/simulator.d.ts.map +1 -1
- package/build/lib/simulator.js +9 -8
- package/build/lib/simulator.js.map +1 -1
- package/build/lib/utils/constants.d.ts +7 -0
- package/build/lib/utils/constants.d.ts.map +1 -0
- package/build/lib/utils/constants.js +10 -0
- package/build/lib/utils/constants.js.map +1 -0
- package/build/lib/{defaults-utils.d.ts → utils/defaults.d.ts} +1 -1
- package/build/lib/utils/defaults.d.ts.map +1 -0
- package/build/lib/{defaults-utils.js → utils/defaults.js} +8 -8
- package/build/lib/utils/defaults.js.map +1 -0
- package/build/lib/utils/devices.d.ts +13 -0
- package/build/lib/utils/devices.d.ts.map +1 -0
- package/build/lib/utils/devices.js +24 -0
- package/build/lib/utils/devices.js.map +1 -0
- package/build/lib/utils/get-devices.d.ts +7 -0
- package/build/lib/utils/get-devices.d.ts.map +1 -0
- package/build/lib/utils/get-devices.js +12 -0
- package/build/lib/utils/get-devices.js.map +1 -0
- package/build/lib/utils/index.d.ts +9 -0
- package/build/lib/utils/index.d.ts.map +1 -0
- package/build/lib/utils/index.js +29 -0
- package/build/lib/utils/index.js.map +1 -0
- package/build/lib/utils/lifecycle.d.ts +6 -0
- package/build/lib/utils/lifecycle.d.ts.map +1 -0
- package/build/lib/utils/lifecycle.js +66 -0
- package/build/lib/utils/lifecycle.js.map +1 -0
- package/build/lib/utils/process.d.ts +11 -0
- package/build/lib/utils/process.d.ts.map +1 -0
- package/build/lib/utils/process.js +36 -0
- package/build/lib/utils/process.js.map +1 -0
- package/build/lib/utils/types.d.ts +4 -0
- package/build/lib/utils/types.d.ts.map +1 -0
- package/build/lib/utils/types.js +3 -0
- package/build/lib/utils/types.js.map +1 -0
- package/build/lib/utils/xcode.d.ts +27 -0
- package/build/lib/utils/xcode.d.ts.map +1 -0
- package/build/lib/utils/xcode.js +80 -0
- package/build/lib/utils/xcode.js.map +1 -0
- package/lib/extensions/applications.ts +8 -4
- package/lib/extensions/biometric.ts +2 -2
- package/lib/extensions/keychain.ts +6 -6
- package/lib/extensions/permissions.ts +2 -0
- package/lib/extensions/settings.ts +7 -8
- package/lib/simulator-xcode-14.ts +27 -22
- package/lib/simulator-xcode-15.ts +4 -15
- package/lib/simulator-xcode-27.ts +9 -0
- package/lib/simulator.ts +14 -10
- package/lib/utils/constants.ts +6 -0
- package/lib/{defaults-utils.ts → utils/defaults.ts} +7 -5
- package/lib/utils/devices.ts +25 -0
- package/lib/utils/get-devices.ts +10 -0
- package/lib/utils/index.ts +20 -0
- package/lib/utils/lifecycle.ts +78 -0
- package/lib/utils/process.ts +31 -0
- package/lib/utils/types.ts +3 -0
- package/lib/utils/xcode.ts +86 -0
- package/package.json +6 -2
- package/build/lib/defaults-utils.d.ts.map +0 -1
- package/build/lib/defaults-utils.js.map +0 -1
- package/build/lib/utils.d.ts +0 -52
- package/build/lib/utils.d.ts.map +0 -1
- package/build/lib/utils.js +0 -227
- package/build/lib/utils.js.map +0 -1
- package/lib/utils.ts +0 -205
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.SimulatorXcode15 = void 0;
|
|
7
7
|
const support_1 = require("@appium/support");
|
|
8
|
-
const teen_process_1 = require("teen_process");
|
|
9
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
const utils_1 = require("./utils");
|
|
10
10
|
const simulator_xcode_14_1 = require("./simulator-xcode-14");
|
|
11
11
|
class SimulatorXcode15 extends simulator_xcode_14_1.SimulatorXcode14 {
|
|
12
12
|
_systemAppBundleIds;
|
|
@@ -111,24 +111,10 @@ class SimulatorXcode15 extends simulator_xcode_14_1.SimulatorXcode14 {
|
|
|
111
111
|
return this._systemAppBundleIds;
|
|
112
112
|
}
|
|
113
113
|
const appsRoot = node_path_1.default.resolve(await this._getSystemRoot(), 'Applications');
|
|
114
|
-
const fetchBundleId = async (appRoot) => {
|
|
115
|
-
const infoPlistPath = node_path_1.default.resolve(appRoot, 'Info.plist');
|
|
116
|
-
try {
|
|
117
|
-
const { stdout } = await (0, teen_process_1.exec)('/usr/libexec/PlistBuddy', [
|
|
118
|
-
'-c',
|
|
119
|
-
'print CFBundleIdentifier',
|
|
120
|
-
infoPlistPath,
|
|
121
|
-
]);
|
|
122
|
-
return stdout.trim();
|
|
123
|
-
}
|
|
124
|
-
catch {
|
|
125
|
-
return null;
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
114
|
const allApps = (await support_1.fs.readdir(appsRoot))
|
|
129
115
|
.filter((x) => x.endsWith('.app'))
|
|
130
116
|
.map((x) => node_path_1.default.join(appsRoot, x));
|
|
131
|
-
const bundleIds = await Promise.all(allApps.map(
|
|
117
|
+
const bundleIds = await Promise.all(allApps.map((appRoot) => (0, utils_1.readBundleIdFromPlist)(node_path_1.default.resolve(appRoot, 'Info.plist'))));
|
|
132
118
|
this._systemAppBundleIds = new Set(bundleIds.filter((x) => x !== null));
|
|
133
119
|
return this._systemAppBundleIds;
|
|
134
120
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simulator-xcode-15.js","sourceRoot":"","sources":["../../lib/simulator-xcode-15.ts"],"names":[],"mappings":";;;;;;AAAA,6CAAmC;AACnC
|
|
1
|
+
{"version":3,"file":"simulator-xcode-15.js","sourceRoot":"","sources":["../../lib/simulator-xcode-15.ts"],"names":[],"mappings":";;;;;;AAAA,6CAAmC;AACnC,0DAA6B;AAC7B,mCAA8C;AAC9C,6DAAsD;AAEtD,MAAa,gBAAiB,SAAQ,qCAAgB;IAC5C,mBAAmB,CAAe;IAE1C;;;;;;OAMG;IACH,cAAc,GAAG,KAAK,EAAE,QAAgB,EAAoB,EAAE;QAC5D,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;YACjE,OAAO,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,YAAE,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;QAC1E,CAAC;QAAC,MAAM,CAAC;YACP,8DAA8D;YAC9D,wCAAwC;YACxC,OAAO,CAAC,MAAM,IAAI,CAAC,wBAAwB,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC,CAAC;IAEF;;;;;OAKG;IACH,KAAK,CAAC,oBAAoB;QACxB,OAAO,mBAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,eA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AC,QAAQ,CAAC,MAAM,CAAC,CAAC;aACjC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,mBAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;QACtC,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,GAAG,CACjC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAA,6BAAqB,EAAC,mBAAI,CAAC,OAAO,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CACrF,CAAC;QACF,IAAI,CAAC,mBAAmB,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;QACrF,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;CACF;AAxHD,4CAwHC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simulator-xcode-27.d.ts","sourceRoot":"","sources":["../../lib/simulator-xcode-27.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AAEtD,qBAAa,gBAAiB,SAAQ,gBAAgB;IACpD,kBAAkB;IAClB,IAAa,gBAAgB,IAAI,MAAM,CAEtC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SimulatorXcode27 = void 0;
|
|
4
|
+
const utils_1 = require("./utils");
|
|
5
|
+
const simulator_xcode_15_1 = require("./simulator-xcode-15");
|
|
6
|
+
class SimulatorXcode27 extends simulator_xcode_15_1.SimulatorXcode15 {
|
|
7
|
+
/** @inheritdoc */
|
|
8
|
+
get uiClientBundleId() {
|
|
9
|
+
return utils_1.DEVICE_HUB_UI_CLIENT_BUNDLE_ID;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.SimulatorXcode27 = SimulatorXcode27;
|
|
13
|
+
//# sourceMappingURL=simulator-xcode-27.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simulator-xcode-27.js","sourceRoot":"","sources":["../../lib/simulator-xcode-27.ts"],"names":[],"mappings":";;;AAAA,mCAAuD;AACvD,6DAAsD;AAEtD,MAAa,gBAAiB,SAAQ,qCAAgB;IACpD,kBAAkB;IAClB,IAAa,gBAAgB;QAC3B,OAAO,sCAA8B,CAAC;IACxC,CAAC;CACF;AALD,4CAKC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simulator.d.ts","sourceRoot":"","sources":["../../lib/simulator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"simulator.d.ts","sourceRoot":"","sources":["../../lib/simulator.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAC,SAAS,EAAE,sBAAsB,EAAC,MAAM,SAAS,CAAC;AAE/D;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,sBAA2B,GAChC,OAAO,CAAC,SAAS,CAAC,CAkCpB"}
|
package/build/lib/simulator.js
CHANGED
|
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.getSimulator = getSimulator;
|
|
37
37
|
const simulator_xcode_14_1 = require("./simulator-xcode-14");
|
|
38
38
|
const simulator_xcode_15_1 = require("./simulator-xcode-15");
|
|
39
|
+
const simulator_xcode_27_1 = require("./simulator-xcode-27");
|
|
39
40
|
const utils_1 = require("./utils");
|
|
40
41
|
const xcode = __importStar(require("appium-xcode"));
|
|
41
42
|
const logger_1 = require("./logger");
|
|
@@ -64,14 +65,14 @@ async function getSimulator(udid, opts = {}) {
|
|
|
64
65
|
}
|
|
65
66
|
(logger ?? logger_1.log).info(`Constructing ${platform} simulator for Xcode version ${xcodeVersion.versionString} with udid '${udid}'`);
|
|
66
67
|
let SimClass;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
if (xcodeVersion.major === utils_1.MIN_SUPPORTED_XCODE_VERSION) {
|
|
69
|
+
SimClass = simulator_xcode_14_1.SimulatorXcode14;
|
|
70
|
+
}
|
|
71
|
+
else if (xcodeVersion.major >= utils_1.MIN_DEVICE_HUB_XCODE_VERSION) {
|
|
72
|
+
SimClass = simulator_xcode_27_1.SimulatorXcode27;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
SimClass = simulator_xcode_15_1.SimulatorXcode15;
|
|
75
76
|
}
|
|
76
77
|
const result = new SimClass(udid, xcodeVersion, logger);
|
|
77
78
|
if (devicesSetPath) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simulator.js","sourceRoot":"","sources":["../../lib/simulator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"simulator.js","sourceRoot":"","sources":["../../lib/simulator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,oCAqCC;AA5DD,6DAAsD;AACtD,6DAAsD;AACtD,6DAAsD;AACtD,mCAKiB;AACjB,oDAAsC;AACtC,qCAA6B;AAG7B;;;;;;;;;GASG;AACI,KAAK,UAAU,YAAY,CAChC,IAAY,EACZ,OAA+B,EAAE;IAEjC,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC;IACtC,MAAM,EAAC,cAAc,GAAG,IAAI,EAAE,cAAc,EAAE,MAAM,EAAC,GAAG,IAAI,CAAC;IAE7D,MAAM,YAAY,GAAG,IAAA,0BAAkB,EAAC,CAAC,MAAM,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAuB,CAAC,CAAC;IAC9F,IAAI,cAAc,EAAE,CAAC;QACnB,MAAM,aAAa,GAAG,MAAM,IAAA,wBAAgB,EAAC,IAAI,EAAE;YACjD,cAAc;SACf,CAAC,CAAC;QAEH,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,2BAA2B,IAAI,GAAG,CAAC,CAAC;QACtD,CAAC;QAED,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC;IACpC,CAAC;IAED,CAAC,MAAM,IAAI,YAAG,CAAC,CAAC,IAAI,CAClB,gBAAgB,QAAQ,gCAAgC,YAAY,CAAC,aAAa,eAAe,IAAI,GAAG,CACzG,CAAC;IACF,IAAI,QAAqF,CAAC;IAC1F,IAAI,YAAY,CAAC,KAAK,KAAK,mCAA2B,EAAE,CAAC;QACvD,QAAQ,GAAG,qCAAgB,CAAC;IAC9B,CAAC;SAAM,IAAI,YAAY,CAAC,KAAK,IAAI,oCAA4B,EAAE,CAAC;QAC9D,QAAQ,GAAG,qCAAgB,CAAC;IAC9B,CAAC;SAAM,CAAC;QACN,QAAQ,GAAG,qCAAgB,CAAC;IAC9B,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;IACxD,IAAI,cAAc,EAAE,CAAC;QACnB,MAAM,CAAC,cAAc,GAAG,cAAc,CAAC;IACzC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const SAFARI_STARTUP_TIMEOUT_MS: number;
|
|
2
|
+
export declare const MOBILE_SAFARI_BUNDLE_ID = "com.apple.mobilesafari";
|
|
3
|
+
export declare const SIMULATOR_UI_CLIENT_BUNDLE_ID = "com.apple.iphonesimulator";
|
|
4
|
+
export declare const DEVICE_HUB_UI_CLIENT_BUNDLE_ID = "com.apple.dt.Devices";
|
|
5
|
+
export declare const MIN_SUPPORTED_XCODE_VERSION = 14;
|
|
6
|
+
export declare const MIN_DEVICE_HUB_XCODE_VERSION = 27;
|
|
7
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../lib/utils/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,QAAY,CAAC;AACnD,eAAO,MAAM,uBAAuB,2BAA2B,CAAC;AAChE,eAAO,MAAM,6BAA6B,8BAA8B,CAAC;AACzE,eAAO,MAAM,8BAA8B,yBAAyB,CAAC;AACrE,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAC9C,eAAO,MAAM,4BAA4B,KAAK,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MIN_DEVICE_HUB_XCODE_VERSION = exports.MIN_SUPPORTED_XCODE_VERSION = exports.DEVICE_HUB_UI_CLIENT_BUNDLE_ID = exports.SIMULATOR_UI_CLIENT_BUNDLE_ID = exports.MOBILE_SAFARI_BUNDLE_ID = exports.SAFARI_STARTUP_TIMEOUT_MS = void 0;
|
|
4
|
+
exports.SAFARI_STARTUP_TIMEOUT_MS = 25 * 1000;
|
|
5
|
+
exports.MOBILE_SAFARI_BUNDLE_ID = 'com.apple.mobilesafari';
|
|
6
|
+
exports.SIMULATOR_UI_CLIENT_BUNDLE_ID = 'com.apple.iphonesimulator';
|
|
7
|
+
exports.DEVICE_HUB_UI_CLIENT_BUNDLE_ID = 'com.apple.dt.Devices';
|
|
8
|
+
exports.MIN_SUPPORTED_XCODE_VERSION = 14;
|
|
9
|
+
exports.MIN_DEVICE_HUB_XCODE_VERSION = 27;
|
|
10
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../lib/utils/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,yBAAyB,GAAG,EAAE,GAAG,IAAI,CAAC;AACtC,QAAA,uBAAuB,GAAG,wBAAwB,CAAC;AACnD,QAAA,6BAA6B,GAAG,2BAA2B,CAAC;AAC5D,QAAA,8BAA8B,GAAG,sBAAsB,CAAC;AACxD,QAAA,2BAA2B,GAAG,EAAE,CAAC;AACjC,QAAA,4BAA4B,GAAG,EAAE,CAAC"}
|
|
@@ -50,4 +50,4 @@ export declare function toXmlArg(value: any, serialize?: boolean): string | Elem
|
|
|
50
50
|
* is the `defaults write <plist>` command suffix
|
|
51
51
|
*/
|
|
52
52
|
export declare function generateDefaultsCommandArgs(valuesMap: Record<string, any>, replace?: boolean): string[][];
|
|
53
|
-
//# sourceMappingURL=defaults
|
|
53
|
+
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../lib/utils/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAKrF,qBAAa,cAAc;IACzB,KAAK,EAAE,MAAM,CAAC;gBAEF,KAAK,EAAE,MAAM;IAIzB;;;;;;OAMG;IACG,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAY5C;;;;;;;;;;OAUG;IACG,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAoB5D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,GAAE,OAAc,GAAG,MAAM,GAAG,OAAO,CA0ChF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC9B,OAAO,GAAE,OAAe,GACvB,MAAM,EAAE,EAAE,CA4BZ"}
|
|
@@ -5,8 +5,8 @@ exports.toXmlArg = toXmlArg;
|
|
|
5
5
|
exports.generateDefaultsCommandArgs = generateDefaultsCommandArgs;
|
|
6
6
|
const xmldom_1 = require("@xmldom/xmldom");
|
|
7
7
|
const teen_process_1 = require("teen_process");
|
|
8
|
-
const logger_1 = require("
|
|
9
|
-
const
|
|
8
|
+
const logger_1 = require("../logger");
|
|
9
|
+
const support_1 = require("@appium/support");
|
|
10
10
|
class NSUserDefaults {
|
|
11
11
|
plist;
|
|
12
12
|
constructor(plist) {
|
|
@@ -25,7 +25,7 @@ class NSUserDefaults {
|
|
|
25
25
|
return JSON.parse(stdout);
|
|
26
26
|
}
|
|
27
27
|
catch (e) {
|
|
28
|
-
throw new Error(`'${this.plist}' cannot be converted to JSON. Original error: ${e.stderr || e.message}
|
|
28
|
+
throw new Error(`'${this.plist}' cannot be converted to JSON. Original error: ${e.stderr || e.message}`, { cause: e });
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
@@ -40,7 +40,7 @@ class NSUserDefaults {
|
|
|
40
40
|
* @throws {Error} If there was an error while updating the plist
|
|
41
41
|
*/
|
|
42
42
|
async update(valuesMap) {
|
|
43
|
-
if (!
|
|
43
|
+
if (!support_1.util.isPlainObject(valuesMap)) {
|
|
44
44
|
throw new TypeError(`plist values must be a map. '${valuesMap}' is given instead`);
|
|
45
45
|
}
|
|
46
46
|
if (Object.keys(valuesMap).length === 0) {
|
|
@@ -51,7 +51,7 @@ class NSUserDefaults {
|
|
|
51
51
|
await Promise.all(commandArgs.map((args) => (0, teen_process_1.exec)('defaults', ['write', this.plist, ...args])));
|
|
52
52
|
}
|
|
53
53
|
catch (e) {
|
|
54
|
-
throw new Error(`Could not write defaults into '${this.plist}'. Original error: ${e.stderr || e.message}
|
|
54
|
+
throw new Error(`Could not write defaults into '${this.plist}'. Original error: ${e.stderr || e.message}`, { cause: e });
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -70,7 +70,7 @@ exports.NSUserDefaults = NSUserDefaults;
|
|
|
70
70
|
*/
|
|
71
71
|
function toXmlArg(value, serialize = true) {
|
|
72
72
|
let xmlDoc = null;
|
|
73
|
-
if (
|
|
73
|
+
if (support_1.util.isPlainObject(value)) {
|
|
74
74
|
xmlDoc = new xmldom_1.DOMParser().parseFromString('<dict></dict>', 'text/xml');
|
|
75
75
|
const documentElement = requireDocumentElement(xmlDoc);
|
|
76
76
|
for (const [subKey, subValue] of Object.entries(value)) {
|
|
@@ -128,7 +128,7 @@ function generateDefaultsCommandArgs(valuesMap, replace = false) {
|
|
|
128
128
|
const resultArgs = [];
|
|
129
129
|
for (const [key, value] of Object.entries(valuesMap)) {
|
|
130
130
|
try {
|
|
131
|
-
if (!replace &&
|
|
131
|
+
if (!replace && support_1.util.isPlainObject(value)) {
|
|
132
132
|
const dictArgs = [key, '-dict-add'];
|
|
133
133
|
for (const [subKey, subValue] of Object.entries(value)) {
|
|
134
134
|
dictArgs.push(subKey, toXmlArg(subValue));
|
|
@@ -164,4 +164,4 @@ function requireDocumentElement(xmlDoc) {
|
|
|
164
164
|
}
|
|
165
165
|
return documentElement;
|
|
166
166
|
}
|
|
167
|
-
//# sourceMappingURL=defaults
|
|
167
|
+
//# sourceMappingURL=defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../../lib/utils/defaults.ts"],"names":[],"mappings":";;;AA4EA,4BA0CC;AAeD,kEA+BC;AApKD,2CAAqF;AACrF,+CAAkC;AAClC,sCAA8B;AAC9B,6CAAqC;AAErC,MAAa,cAAc;IACzB,KAAK,CAAS;IAEd,YAAY,KAAa;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAM;QACV,IAAI,CAAC;YACH,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAA,mBAAI,EAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE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B,CAAC;AAED,SAAS,sBAAsB,CAAC,MAAgB;IAC9C,MAAM,EAAC,eAAe,EAAC,GAAG,MAAM,CAAC;IACjC,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SimulatorInfoOptions } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @param udid - The simulator UDID.
|
|
4
|
+
* @param opts - Options including devicesSetPath.
|
|
5
|
+
* @returns Promise that resolves to simulator info or undefined if not found.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getSimulatorInfo(udid: string, opts?: SimulatorInfoOptions): Promise<any>;
|
|
8
|
+
/**
|
|
9
|
+
* @param udid - The simulator UDID.
|
|
10
|
+
* @returns Promise that resolves to true if simulator exists, false otherwise.
|
|
11
|
+
*/
|
|
12
|
+
export declare function simExists(udid: string): Promise<boolean>;
|
|
13
|
+
//# sourceMappingURL=devices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devices.d.ts","sourceRoot":"","sources":["../../../lib/utils/devices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,SAAS,CAAC;AAGlD;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,oBAAyB,GAC9B,OAAO,CAAC,GAAG,CAAC,CAKd;AAED;;;GAGG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAE9D"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSimulatorInfo = getSimulatorInfo;
|
|
4
|
+
exports.simExists = simExists;
|
|
5
|
+
const get_devices_1 = require("./get-devices");
|
|
6
|
+
/**
|
|
7
|
+
* @param udid - The simulator UDID.
|
|
8
|
+
* @param opts - Options including devicesSetPath.
|
|
9
|
+
* @returns Promise that resolves to simulator info or undefined if not found.
|
|
10
|
+
*/
|
|
11
|
+
async function getSimulatorInfo(udid, opts = {}) {
|
|
12
|
+
const { devicesSetPath } = opts;
|
|
13
|
+
// see the README for github.com/appium/node-simctl for example output of getDevices()
|
|
14
|
+
const devices = Object.values(await (0, get_devices_1.getDevices)({ devicesSetPath })).flat();
|
|
15
|
+
return devices.find((sim) => sim.udid === udid);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @param udid - The simulator UDID.
|
|
19
|
+
* @returns Promise that resolves to true if simulator exists, false otherwise.
|
|
20
|
+
*/
|
|
21
|
+
async function simExists(udid) {
|
|
22
|
+
return !!(await getSimulatorInfo(udid));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=devices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devices.js","sourceRoot":"","sources":["../../../lib/utils/devices.ts"],"names":[],"mappings":";;AAQA,4CAQC;AAMD,8BAEC;AAvBD,+CAAyC;AAEzC;;;;GAIG;AACI,KAAK,UAAU,gBAAgB,CACpC,IAAY,EACZ,OAA6B,EAAE;IAE/B,MAAM,EAAC,cAAc,EAAC,GAAG,IAAI,CAAC;IAC9B,sFAAsF;IACtF,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,IAAA,wBAAU,EAAC,EAAC,cAAc,EAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACzE,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACvD,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,SAAS,CAAC,IAAY;IAC1C,OAAO,CAAC,CAAC,CAAC,MAAM,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { StringRecord } from '@appium/types';
|
|
2
|
+
/**
|
|
3
|
+
* @param simctlOpts - Optional simctl options
|
|
4
|
+
* @returns Promise that resolves to a record of devices grouped by SDK version
|
|
5
|
+
*/
|
|
6
|
+
export declare function getDevices(simctlOpts?: StringRecord): Promise<Record<string, any[]>>;
|
|
7
|
+
//# sourceMappingURL=get-devices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-devices.d.ts","sourceRoot":"","sources":["../../../lib/utils/get-devices.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAEhD;;;GAGG;AACH,wBAAsB,UAAU,CAAC,UAAU,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAE1F"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDevices = getDevices;
|
|
4
|
+
const node_simctl_1 = require("node-simctl");
|
|
5
|
+
/**
|
|
6
|
+
* @param simctlOpts - Optional simctl options
|
|
7
|
+
* @returns Promise that resolves to a record of devices grouped by SDK version
|
|
8
|
+
*/
|
|
9
|
+
async function getDevices(simctlOpts) {
|
|
10
|
+
return await new node_simctl_1.Simctl(simctlOpts).getDevices();
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=get-devices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-devices.js","sourceRoot":"","sources":["../../../lib/utils/get-devices.ts"],"names":[],"mappings":";;AAOA,gCAEC;AATD,6CAAmC;AAGnC;;;GAGG;AACI,KAAK,UAAU,UAAU,CAAC,UAAyB;IACxD,OAAO,MAAM,IAAI,oBAAM,CAAC,UAAU,CAAC,CAAC,UAAU,EAAE,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { SAFARI_STARTUP_TIMEOUT_MS, MOBILE_SAFARI_BUNDLE_ID, SIMULATOR_UI_CLIENT_BUNDLE_ID, DEVICE_HUB_UI_CLIENT_BUNDLE_ID, MIN_SUPPORTED_XCODE_VERSION, MIN_DEVICE_HUB_XCODE_VERSION, } from './constants';
|
|
2
|
+
export type { SimulatorInfoOptions } from './types';
|
|
3
|
+
export { NSUserDefaults, toXmlArg, generateDefaultsCommandArgs } from './defaults';
|
|
4
|
+
export { getDevices } from './get-devices';
|
|
5
|
+
export { getSimulatorInfo, simExists } from './devices';
|
|
6
|
+
export { getMacAppPidByBundleId } from './process';
|
|
7
|
+
export { assertXcodeVersion, getDeveloperRoot, getUiClientAppPath, readBundleIdFromPlist, } from './xcode';
|
|
8
|
+
export { killAllSimulators } from './lifecycle';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,6BAA6B,EAC7B,8BAA8B,EAC9B,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,aAAa,CAAC;AACrB,YAAY,EAAC,oBAAoB,EAAC,MAAM,SAAS,CAAC;AAClD,OAAO,EAAC,cAAc,EAAE,QAAQ,EAAE,2BAA2B,EAAC,MAAM,YAAY,CAAC;AACjF,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,gBAAgB,EAAE,SAAS,EAAC,MAAM,WAAW,CAAC;AACtD,OAAO,EAAC,sBAAsB,EAAC,MAAM,WAAW,CAAC;AACjD,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAC,iBAAiB,EAAC,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.killAllSimulators = exports.readBundleIdFromPlist = exports.getUiClientAppPath = exports.getDeveloperRoot = exports.assertXcodeVersion = exports.getMacAppPidByBundleId = exports.simExists = exports.getSimulatorInfo = exports.getDevices = exports.generateDefaultsCommandArgs = exports.toXmlArg = exports.NSUserDefaults = exports.MIN_DEVICE_HUB_XCODE_VERSION = exports.MIN_SUPPORTED_XCODE_VERSION = exports.DEVICE_HUB_UI_CLIENT_BUNDLE_ID = exports.SIMULATOR_UI_CLIENT_BUNDLE_ID = exports.MOBILE_SAFARI_BUNDLE_ID = exports.SAFARI_STARTUP_TIMEOUT_MS = void 0;
|
|
4
|
+
var constants_1 = require("./constants");
|
|
5
|
+
Object.defineProperty(exports, "SAFARI_STARTUP_TIMEOUT_MS", { enumerable: true, get: function () { return constants_1.SAFARI_STARTUP_TIMEOUT_MS; } });
|
|
6
|
+
Object.defineProperty(exports, "MOBILE_SAFARI_BUNDLE_ID", { enumerable: true, get: function () { return constants_1.MOBILE_SAFARI_BUNDLE_ID; } });
|
|
7
|
+
Object.defineProperty(exports, "SIMULATOR_UI_CLIENT_BUNDLE_ID", { enumerable: true, get: function () { return constants_1.SIMULATOR_UI_CLIENT_BUNDLE_ID; } });
|
|
8
|
+
Object.defineProperty(exports, "DEVICE_HUB_UI_CLIENT_BUNDLE_ID", { enumerable: true, get: function () { return constants_1.DEVICE_HUB_UI_CLIENT_BUNDLE_ID; } });
|
|
9
|
+
Object.defineProperty(exports, "MIN_SUPPORTED_XCODE_VERSION", { enumerable: true, get: function () { return constants_1.MIN_SUPPORTED_XCODE_VERSION; } });
|
|
10
|
+
Object.defineProperty(exports, "MIN_DEVICE_HUB_XCODE_VERSION", { enumerable: true, get: function () { return constants_1.MIN_DEVICE_HUB_XCODE_VERSION; } });
|
|
11
|
+
var defaults_1 = require("./defaults");
|
|
12
|
+
Object.defineProperty(exports, "NSUserDefaults", { enumerable: true, get: function () { return defaults_1.NSUserDefaults; } });
|
|
13
|
+
Object.defineProperty(exports, "toXmlArg", { enumerable: true, get: function () { return defaults_1.toXmlArg; } });
|
|
14
|
+
Object.defineProperty(exports, "generateDefaultsCommandArgs", { enumerable: true, get: function () { return defaults_1.generateDefaultsCommandArgs; } });
|
|
15
|
+
var get_devices_1 = require("./get-devices");
|
|
16
|
+
Object.defineProperty(exports, "getDevices", { enumerable: true, get: function () { return get_devices_1.getDevices; } });
|
|
17
|
+
var devices_1 = require("./devices");
|
|
18
|
+
Object.defineProperty(exports, "getSimulatorInfo", { enumerable: true, get: function () { return devices_1.getSimulatorInfo; } });
|
|
19
|
+
Object.defineProperty(exports, "simExists", { enumerable: true, get: function () { return devices_1.simExists; } });
|
|
20
|
+
var process_1 = require("./process");
|
|
21
|
+
Object.defineProperty(exports, "getMacAppPidByBundleId", { enumerable: true, get: function () { return process_1.getMacAppPidByBundleId; } });
|
|
22
|
+
var xcode_1 = require("./xcode");
|
|
23
|
+
Object.defineProperty(exports, "assertXcodeVersion", { enumerable: true, get: function () { return xcode_1.assertXcodeVersion; } });
|
|
24
|
+
Object.defineProperty(exports, "getDeveloperRoot", { enumerable: true, get: function () { return xcode_1.getDeveloperRoot; } });
|
|
25
|
+
Object.defineProperty(exports, "getUiClientAppPath", { enumerable: true, get: function () { return xcode_1.getUiClientAppPath; } });
|
|
26
|
+
Object.defineProperty(exports, "readBundleIdFromPlist", { enumerable: true, get: function () { return xcode_1.readBundleIdFromPlist; } });
|
|
27
|
+
var lifecycle_1 = require("./lifecycle");
|
|
28
|
+
Object.defineProperty(exports, "killAllSimulators", { enumerable: true, get: function () { return lifecycle_1.killAllSimulators; } });
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/utils/index.ts"],"names":[],"mappings":";;;AAAA,yCAOqB;AANnB,sHAAA,yBAAyB,OAAA;AACzB,oHAAA,uBAAuB,OAAA;AACvB,0HAAA,6BAA6B,OAAA;AAC7B,2HAAA,8BAA8B,OAAA;AAC9B,wHAAA,2BAA2B,OAAA;AAC3B,yHAAA,4BAA4B,OAAA;AAG9B,uCAAiF;AAAzE,0GAAA,cAAc,OAAA;AAAE,oGAAA,QAAQ,OAAA;AAAE,uHAAA,2BAA2B,OAAA;AAC7D,6CAAyC;AAAjC,yGAAA,UAAU,OAAA;AAClB,qCAAsD;AAA9C,2GAAA,gBAAgB,OAAA;AAAE,oGAAA,SAAS,OAAA;AACnC,qCAAiD;AAAzC,iHAAA,sBAAsB,OAAA;AAC9B,iCAKiB;AAJf,2GAAA,kBAAkB,OAAA;AAClB,yGAAA,gBAAgB,OAAA;AAChB,2GAAA,kBAAkB,OAAA;AAClB,8GAAA,qBAAqB,OAAA;AAEvB,yCAA8C;AAAtC,8GAAA,iBAAiB,OAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param timeout - Timeout in milliseconds (default: DEFAULT_SIM_SHUTDOWN_TIMEOUT_MS).
|
|
3
|
+
* @returns Promise that resolves when all simulators are killed.
|
|
4
|
+
*/
|
|
5
|
+
export declare function killAllSimulators(timeout?: number): Promise<void>;
|
|
6
|
+
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../lib/utils/lifecycle.ts"],"names":[],"mappings":"AAcA;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,GAAE,MAAwC,GAChD,OAAO,CAAC,IAAI,CAAC,CAuCf"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.killAllSimulators = killAllSimulators;
|
|
4
|
+
const logger_1 = require("../logger");
|
|
5
|
+
const teen_process_1 = require("teen_process");
|
|
6
|
+
const asyncbox_1 = require("asyncbox");
|
|
7
|
+
const appium_xcode_1 = require("appium-xcode");
|
|
8
|
+
const constants_1 = require("./constants");
|
|
9
|
+
const get_devices_1 = require("./get-devices");
|
|
10
|
+
const process_1 = require("./process");
|
|
11
|
+
const DEFAULT_SIM_SHUTDOWN_TIMEOUT_MS = 60000;
|
|
12
|
+
/**
|
|
13
|
+
* @param timeout - Timeout in milliseconds (default: DEFAULT_SIM_SHUTDOWN_TIMEOUT_MS).
|
|
14
|
+
* @returns Promise that resolves when all simulators are killed.
|
|
15
|
+
*/
|
|
16
|
+
async function killAllSimulators(timeout = DEFAULT_SIM_SHUTDOWN_TIMEOUT_MS) {
|
|
17
|
+
logger_1.log.debug('Killing all iOS Simulators');
|
|
18
|
+
const xcodeVersion = await (0, appium_xcode_1.getVersion)(true);
|
|
19
|
+
const uiClientBundleId = xcodeVersion.major >= constants_1.MIN_DEVICE_HUB_XCODE_VERSION
|
|
20
|
+
? constants_1.DEVICE_HUB_UI_CLIENT_BUNDLE_ID
|
|
21
|
+
: constants_1.SIMULATOR_UI_CLIENT_BUNDLE_ID;
|
|
22
|
+
const startedMs = performance.now();
|
|
23
|
+
try {
|
|
24
|
+
await (0, teen_process_1.exec)('xcrun', ['simctl', 'shutdown', 'all'], { timeout });
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
logger_1.log.debug(`Failed to shutdown all simulators: ${err.stderr || err.message}`);
|
|
28
|
+
}
|
|
29
|
+
const uiClientPid = await (0, process_1.getMacAppPidByBundleId)(uiClientBundleId);
|
|
30
|
+
if (uiClientPid) {
|
|
31
|
+
logger_1.log.debug(`Killing UI client '${uiClientBundleId}' (pid ${uiClientPid})`);
|
|
32
|
+
await (0, process_1.killMacAppByBundleId)(uiClientBundleId);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
logger_1.log.debug(`UI client '${uiClientBundleId}' is not running`);
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
await (0, asyncbox_1.waitForCondition)(allSimsAreDown, {
|
|
39
|
+
waitMs: Math.max(1000, startedMs + timeout - performance.now()),
|
|
40
|
+
intervalMs: 200,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
const remainingDevices = await getNonShutdownDeviceDescriptions();
|
|
45
|
+
const message = remainingDevices.length > 0
|
|
46
|
+
? `The following devices are still not in the correct state after ${timeout} ms:\n` +
|
|
47
|
+
remainingDevices.map((device) => ` ${device}`).join('\n')
|
|
48
|
+
: `Timed out after ${timeout} ms waiting for all simulators to shut down`;
|
|
49
|
+
throw new Error(message, { cause: err });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async function allSimsAreDown() {
|
|
53
|
+
try {
|
|
54
|
+
return (await getNonShutdownDeviceDescriptions()).length === 0;
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
async function getNonShutdownDeviceDescriptions() {
|
|
61
|
+
const devices = Object.values(await (0, get_devices_1.getDevices)()).flat();
|
|
62
|
+
return devices
|
|
63
|
+
.filter((sim) => !['shutdown', 'unavailable', 'disconnected'].includes(sim.state.toLowerCase()))
|
|
64
|
+
.map((sim) => `${sim.name} (${sim.sdk}, udid: ${sim.udid}) is still in state '${sim.state.toLowerCase()}'`);
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=lifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["../../../lib/utils/lifecycle.ts"],"names":[],"mappings":";;AAkBA,8CAyCC;AA3DD,sCAA8B;AAC9B,+CAAkD;AAClD,uCAA0C;AAC1C,+CAAwC;AACxC,2CAIqB;AACrB,+CAAyC;AACzC,uCAAuE;AAEvE,MAAM,+BAA+B,GAAG,KAAK,CAAC;AAE9C;;;GAGG;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BAAgB,GAAG,MAAM,gCAAgC,EAAE,CAAC;QAClE,MAAM,OAAO,GACX,gBAAgB,CAAC,MAAM,GAAG,CAAC;YACzB,CAAC,CAAC,kEAAkE,OAAO,QAAQ;gBACjF,gBAAgB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YAC9D,CAAC,CAAC,mBAAmB,OAAO,6CAA6C,CAAC;QAC9E,MAAM,IAAI,KAAK,CAAC,OAAO,EAAE,EAAC,KAAK,EAAE,GAAG,EAAC,CAAC,CAAC;IACzC,CAAC;AACH,CAAC;AAED,KAAK,UAAU,cAAc;IAC3B,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,gCAAgC,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;IACjE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,KAAK,UAAU,gCAAgC;IAC7C,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,IAAA,wBAAU,GAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACzD,OAAO,OAAO;SACX,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;SAC/F,GAAG,CACF,CAAC,GAAG,EAAE,EAAE,CACN,GAAG,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,GAAG,WAAW,GAAG,CAAC,IAAI,wBAAwB,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,GAAG,CAC/F,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param bundleId - The bundle identifier of a running macOS application.
|
|
3
|
+
* @returns The process ID or null if the application is not running.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getMacAppPidByBundleId(bundleId: string): Promise<string | null>;
|
|
6
|
+
/**
|
|
7
|
+
* @param bundleId - The bundle identifier of a running macOS application.
|
|
8
|
+
* @returns True if the kill command succeeded.
|
|
9
|
+
*/
|
|
10
|
+
export declare function killMacAppByBundleId(bundleId: string): Promise<boolean>;
|
|
11
|
+
//# sourceMappingURL=process.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../../lib/utils/process.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAsB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CASrF;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQ7E"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMacAppPidByBundleId = getMacAppPidByBundleId;
|
|
4
|
+
exports.killMacAppByBundleId = killMacAppByBundleId;
|
|
5
|
+
const logger_1 = require("../logger");
|
|
6
|
+
const teen_process_1 = require("teen_process");
|
|
7
|
+
/**
|
|
8
|
+
* @param bundleId - The bundle identifier of a running macOS application.
|
|
9
|
+
* @returns The process ID or null if the application is not running.
|
|
10
|
+
*/
|
|
11
|
+
async function getMacAppPidByBundleId(bundleId) {
|
|
12
|
+
let stdout;
|
|
13
|
+
try {
|
|
14
|
+
({ stdout } = await (0, teen_process_1.exec)('lsappinfo', ['info', '-only', 'pid', bundleId]));
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
const match = stdout.trim().match(/"pid"=(\d+)/);
|
|
20
|
+
return match?.[1] ?? null;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @param bundleId - The bundle identifier of a running macOS application.
|
|
24
|
+
* @returns True if the kill command succeeded.
|
|
25
|
+
*/
|
|
26
|
+
async function killMacAppByBundleId(bundleId) {
|
|
27
|
+
try {
|
|
28
|
+
await (0, teen_process_1.exec)('lsappinfo', ['kill', '-hard', bundleId]);
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
catch (e) {
|
|
32
|
+
logger_1.log.debug(`Could not kill '${bundleId}' via lsappinfo: ${e.stderr || e.message}`);
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=process.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process.js","sourceRoot":"","sources":["../../../lib/utils/process.ts"],"names":[],"mappings":";;AAOA,wDASC;AAMD,oDAQC;AA9BD,sCAA8B;AAC9B,+CAAkC;AAElC;;;GAGG;AACI,KAAK,UAAU,sBAAsB,CAAC,QAAgB;IAC3D,IAAI,MAAc,CAAC;IACnB,IAAI,CAAC;QACH,CAAC,EAAC,MAAM,EAAC,GAAG,MAAM,IAAA,mBAAI,EAAC,WAAW,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC3E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IACjD,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;AAC5B,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,oBAAoB,CAAC,QAAgB;IACzD,IAAI,CAAC;QACH,MAAM,IAAA,mBAAI,EAAC,WAAW,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;QACrD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,YAAG,CAAC,KAAK,CAAC,mBAAmB,QAAQ,oBAAoB,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QAClF,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/utils/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../lib/utils/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { XcodeVersion } from 'appium-xcode';
|
|
2
|
+
/**
|
|
3
|
+
* @returns Promise that resolves to the developer root path.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getDeveloperRoot(): Promise<string>;
|
|
6
|
+
/**
|
|
7
|
+
* @param bundleId - The bundle identifier of the Simulator UI client.
|
|
8
|
+
* @param xcodeVersion - The active Xcode version.
|
|
9
|
+
* @returns The full path to the UI client app in the active Xcode installation.
|
|
10
|
+
* @throws {Error} If no matching app is found in the active Xcode folder.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getUiClientAppPath(bundleId: string, xcodeVersion: XcodeVersion): Promise<string>;
|
|
13
|
+
/**
|
|
14
|
+
* Asserts that the Xcode version meets the minimum supported version requirement.
|
|
15
|
+
*
|
|
16
|
+
* @template V - The Xcode version type.
|
|
17
|
+
* @param xcodeVersion - The Xcode version to check.
|
|
18
|
+
* @returns The same Xcode version if it meets the requirement.
|
|
19
|
+
* @throws {Error} If the Xcode version is below the minimum supported version.
|
|
20
|
+
*/
|
|
21
|
+
export declare function assertXcodeVersion<V extends XcodeVersion>(xcodeVersion: V): V;
|
|
22
|
+
/**
|
|
23
|
+
* @param infoPlistPath - The full path to an Info.plist file.
|
|
24
|
+
* @returns The bundle identifier or null if it cannot be read.
|
|
25
|
+
*/
|
|
26
|
+
export declare function readBundleIdFromPlist(infoPlistPath: string): Promise<string | null>;
|
|
27
|
+
//# sourceMappingURL=xcode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xcode.d.ts","sourceRoot":"","sources":["../../../lib/utils/xcode.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAG/C;;GAEG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,CAGxD;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,MAAM,CAAC,CA2BjB;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,YAAY,EAAE,YAAY,EAAE,CAAC,GAAG,CAAC,CAQ7E;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAWzF"}
|