node-simctl 8.1.7 → 8.2.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.
- package/CHANGELOG.md +12 -0
- package/build/lib/helpers.d.ts +0 -6
- package/build/lib/helpers.d.ts.map +1 -1
- package/build/lib/helpers.js +0 -10
- package/build/lib/helpers.js.map +1 -1
- package/build/lib/simctl.d.ts +31 -31
- package/build/lib/simctl.d.ts.map +1 -1
- package/build/lib/simctl.js +55 -55
- package/build/lib/simctl.js.map +1 -1
- package/build/lib/subcommands/appinfo.d.ts.map +1 -1
- package/build/lib/subcommands/appinfo.js +4 -5
- package/build/lib/subcommands/appinfo.js.map +1 -1
- package/build/lib/subcommands/boot.d.ts.map +1 -1
- package/build/lib/subcommands/boot.js +1 -5
- package/build/lib/subcommands/boot.js.map +1 -1
- package/build/lib/subcommands/bootstatus.d.ts.map +1 -1
- package/build/lib/subcommands/bootstatus.js +1 -5
- package/build/lib/subcommands/bootstatus.js.map +1 -1
- package/build/lib/subcommands/create.d.ts.map +1 -1
- package/build/lib/subcommands/create.js +2 -6
- package/build/lib/subcommands/create.js.map +1 -1
- package/build/lib/subcommands/io.js +2 -2
- package/build/lib/subcommands/io.js.map +1 -1
- package/build/lib/subcommands/keychain.d.ts.map +1 -1
- package/build/lib/subcommands/keychain.js +20 -21
- package/build/lib/subcommands/keychain.js.map +1 -1
- package/build/lib/subcommands/launch.d.ts.map +1 -1
- package/build/lib/subcommands/launch.js +1 -5
- package/build/lib/subcommands/launch.js.map +1 -1
- package/build/lib/subcommands/list.d.ts.map +1 -1
- package/build/lib/subcommands/list.js +12 -13
- package/build/lib/subcommands/list.js.map +1 -1
- package/build/lib/subcommands/location.d.ts.map +1 -1
- package/build/lib/subcommands/location.js +14 -14
- package/build/lib/subcommands/location.js.map +1 -1
- package/build/lib/subcommands/push.js +2 -2
- package/build/lib/subcommands/push.js.map +1 -1
- package/build/lib/subcommands/shutdown.d.ts.map +1 -1
- package/build/lib/subcommands/shutdown.js +1 -5
- package/build/lib/subcommands/shutdown.js.map +1 -1
- package/build/lib/subcommands/spawn.d.ts.map +1 -1
- package/build/lib/subcommands/spawn.js +4 -8
- package/build/lib/subcommands/spawn.js.map +1 -1
- package/build/lib/subcommands/ui.d.ts.map +1 -1
- package/build/lib/subcommands/ui.js +3 -7
- package/build/lib/subcommands/ui.js.map +1 -1
- package/lib/helpers.ts +0 -10
- package/lib/simctl.ts +60 -63
- package/lib/subcommands/appinfo.ts +6 -2
- package/lib/subcommands/boot.ts +1 -2
- package/lib/subcommands/bootstatus.ts +4 -4
- package/lib/subcommands/create.ts +2 -3
- package/lib/subcommands/io.ts +2 -2
- package/lib/subcommands/keychain.ts +22 -23
- package/lib/subcommands/launch.ts +1 -2
- package/lib/subcommands/list.ts +15 -17
- package/lib/subcommands/location.ts +15 -15
- package/lib/subcommands/push.ts +2 -2
- package/lib/subcommands/shutdown.ts +1 -2
- package/lib/subcommands/spawn.ts +4 -5
- package/lib/subcommands/ui.ts +3 -4
- package/package.json +1 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [8.2.1](https://github.com/appium/node-simctl/compare/v8.2.0...v8.2.1) (2026-04-28)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* Copilot review comments ([#295](https://github.com/appium/node-simctl/issues/295)) ([1055143](https://github.com/appium/node-simctl/commit/10551433cd68d2c8ad298392a9ab354deb5a841d))
|
|
6
|
+
|
|
7
|
+
## [8.2.0](https://github.com/appium/node-simctl/compare/v8.1.7...v8.2.0) (2026-04-25)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Strip lodash, bluebird and uuid usages ([#294](https://github.com/appium/node-simctl/issues/294)) ([ffabc5b](https://github.com/appium/node-simctl/commit/ffabc5b1ed3d8bf18d1d8679dc89664fcc8033a5))
|
|
12
|
+
|
|
1
13
|
## [8.1.7](https://github.com/appium/node-simctl/compare/v8.1.6...v8.1.7) (2026-04-10)
|
|
2
14
|
|
|
3
15
|
### Miscellaneous Chores
|
package/build/lib/helpers.d.ts
CHANGED
|
@@ -13,12 +13,6 @@ export declare function normalizeVersion(version: string): string;
|
|
|
13
13
|
* @returns The xcrun binary name
|
|
14
14
|
*/
|
|
15
15
|
export declare function getXcrunBinary(): string;
|
|
16
|
-
/**
|
|
17
|
-
* Generate a UUID v4
|
|
18
|
-
*
|
|
19
|
-
* @returns Promise resolving to UUID string
|
|
20
|
-
*/
|
|
21
|
-
export declare function uuidV4(): Promise<string>;
|
|
22
16
|
/**
|
|
23
17
|
* Convert plist-style output to JSON using plutil
|
|
24
18
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../lib/helpers.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB,QAAiB,CAAC;AACnD,eAAO,MAAM,gBAAgB,wCAAwC,CAAC;AAEtE;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAMxD;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../lib/helpers.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB,QAAiB,CAAC;AACnD,eAAO,MAAM,gBAAgB,wCAAwC,CAAC;AAEtE;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAMxD;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAkCzE"}
|
package/build/lib/helpers.js
CHANGED
|
@@ -36,7 +36,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.SIM_RUNTIME_NAME = exports.DEFAULT_EXEC_TIMEOUT = void 0;
|
|
37
37
|
exports.normalizeVersion = normalizeVersion;
|
|
38
38
|
exports.getXcrunBinary = getXcrunBinary;
|
|
39
|
-
exports.uuidV4 = uuidV4;
|
|
40
39
|
exports.convertPlistToJson = convertPlistToJson;
|
|
41
40
|
const semver = __importStar(require("semver"));
|
|
42
41
|
const node_child_process_1 = require("node:child_process");
|
|
@@ -64,15 +63,6 @@ function normalizeVersion(version) {
|
|
|
64
63
|
function getXcrunBinary() {
|
|
65
64
|
return process.env.XCRUN_BINARY || 'xcrun';
|
|
66
65
|
}
|
|
67
|
-
/**
|
|
68
|
-
* Generate a UUID v4
|
|
69
|
-
*
|
|
70
|
-
* @returns Promise resolving to UUID string
|
|
71
|
-
*/
|
|
72
|
-
async function uuidV4() {
|
|
73
|
-
const uuidLib = await import('uuid');
|
|
74
|
-
return uuidLib.v4();
|
|
75
|
-
}
|
|
76
66
|
/**
|
|
77
67
|
* Convert plist-style output to JSON using plutil
|
|
78
68
|
*
|
package/build/lib/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../lib/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,4CAMC;AAKD,wCAEC;
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../lib/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,4CAMC;AAKD,wCAEC;AASD,gDAkCC;AAvED,+CAAiC;AACjC,2DAAyC;AACzC,6CAAqC;AAExB,QAAA,oBAAoB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,KAAK;AAC5C,QAAA,gBAAgB,GAAG,qCAAqC,CAAC;AAEtE;;;;;;;GAOG;AACH,SAAgB,gBAAgB,CAAC,OAAe;IAC9C,M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BACZ,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,IAAI,KAAK,CAAC,2BAA2B,IAAI,YAAY,MAAM,EAAE,CAAC,CAAC,CAAC;gBACzE,CAAC;YACH,CAAC,CAAC,CAAC;YACH,aAAa,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;gBAChC,WAAW,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;gBACxC,MAAM,CAAC,CAAC,CAAC,CAAC;YACZ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACtB,MAAM,IAAI,KAAK,CACb,oCAAoC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CACvF,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,aAAa,CAAC,kBAAkB,EAAE,CAAC;QACnC,WAAW,CAAC,kBAAkB,EAAE,CAAC;IACnC,CAAC;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC"}
|
package/build/lib/simctl.d.ts
CHANGED
|
@@ -25,37 +25,6 @@ import * as uninstallCommands from './subcommands/uninstall';
|
|
|
25
25
|
import * as locationCommands from './subcommands/location';
|
|
26
26
|
import type { ExecOpts, SimctlOpts, ExecResult } from './types';
|
|
27
27
|
export declare class Simctl {
|
|
28
|
-
private xcrun;
|
|
29
|
-
private execTimeout;
|
|
30
|
-
private logErrors;
|
|
31
|
-
private _udid;
|
|
32
|
-
private _devicesSetPath;
|
|
33
|
-
constructor(opts?: SimctlOpts);
|
|
34
|
-
set udid(value: string | null);
|
|
35
|
-
get udid(): string | null;
|
|
36
|
-
set devicesSetPath(value: string | null);
|
|
37
|
-
get devicesSetPath(): string | null;
|
|
38
|
-
/**
|
|
39
|
-
* @param commandName - Optional command name for error message
|
|
40
|
-
* @returns The UDID string
|
|
41
|
-
* @throws {Error} If UDID is not set
|
|
42
|
-
*/
|
|
43
|
-
requireUdid(commandName?: string | null): string;
|
|
44
|
-
/**
|
|
45
|
-
* @returns Promise resolving to the xcrun binary path
|
|
46
|
-
*/
|
|
47
|
-
requireXcrun(): Promise<string>;
|
|
48
|
-
/**
|
|
49
|
-
* Execute the particular simctl command.
|
|
50
|
-
*
|
|
51
|
-
* @param subcommand - One of available simctl subcommands.
|
|
52
|
-
* Execute `xcrun simctl` in Terminal to see the full list of available subcommands.
|
|
53
|
-
* @param opts - Execution options
|
|
54
|
-
* @return Either the result of teen process's `exec` or
|
|
55
|
-
* `SubProcess` instance depending of `opts.asynchronous` value.
|
|
56
|
-
* @throws {Error} If the simctl subcommand command returns non-zero return code.
|
|
57
|
-
*/
|
|
58
|
-
exec<T extends ExecOpts>(subcommand: string, opts?: T): Promise<ExecResult<T>>;
|
|
59
28
|
addMedia: typeof addmediaCommands.addMedia;
|
|
60
29
|
appInfo: typeof appinfoCommands.appInfo;
|
|
61
30
|
bootDevice: typeof bootCommands.bootDevice;
|
|
@@ -97,6 +66,37 @@ export declare class Simctl {
|
|
|
97
66
|
getContentSize: typeof uiCommands.getContentSize;
|
|
98
67
|
setContentSize: typeof uiCommands.setContentSize;
|
|
99
68
|
removeApp: typeof uninstallCommands.removeApp;
|
|
69
|
+
private xcrun;
|
|
70
|
+
private execTimeout;
|
|
71
|
+
private logErrors;
|
|
72
|
+
private _udid;
|
|
73
|
+
private _devicesSetPath;
|
|
74
|
+
constructor(opts?: SimctlOpts);
|
|
75
|
+
get udid(): string | null;
|
|
76
|
+
get devicesSetPath(): string | null;
|
|
77
|
+
set udid(value: string | null);
|
|
78
|
+
set devicesSetPath(value: string | null);
|
|
79
|
+
/**
|
|
80
|
+
* @param commandName - Optional command name for error message
|
|
81
|
+
* @returns The UDID string
|
|
82
|
+
* @throws {Error} If UDID is not set
|
|
83
|
+
*/
|
|
84
|
+
requireUdid(commandName?: string | null): string;
|
|
85
|
+
/**
|
|
86
|
+
* @returns Promise resolving to the xcrun binary path
|
|
87
|
+
*/
|
|
88
|
+
requireXcrun(): Promise<string>;
|
|
89
|
+
/**
|
|
90
|
+
* Execute the particular simctl command.
|
|
91
|
+
*
|
|
92
|
+
* @param subcommand - One of available simctl subcommands.
|
|
93
|
+
* Execute `xcrun simctl` in Terminal to see the full list of available subcommands.
|
|
94
|
+
* @param opts - Execution options
|
|
95
|
+
* @return Either the result of teen process's `exec` or
|
|
96
|
+
* `SubProcess` instance depending of `opts.asynchronous` value.
|
|
97
|
+
* @throws {Error} If the simctl subcommand command returns non-zero return code.
|
|
98
|
+
*/
|
|
99
|
+
exec<T extends ExecOpts>(subcommand: string, opts?: T): Promise<ExecResult<T>>;
|
|
100
100
|
}
|
|
101
101
|
export default Simctl;
|
|
102
102
|
//# sourceMappingURL=simctl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simctl.d.ts","sourceRoot":"","sources":["../../lib/simctl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"simctl.d.ts","sourceRoot":"","sources":["../../lib/simctl.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,kBAAkB,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,uBAAuB,MAAM,iCAAiC,CAAC;AAC3E,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO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|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.Simctl = void 0;
|
|
40
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
41
40
|
const which_1 = __importDefault(require("which"));
|
|
42
41
|
const logger_1 = require("./logger");
|
|
43
42
|
const helpers_1 = require("./helpers");
|
|
@@ -69,30 +68,72 @@ const uninstallCommands = __importStar(require("./subcommands/uninstall"));
|
|
|
69
68
|
const locationCommands = __importStar(require("./subcommands/location"));
|
|
70
69
|
const SIMCTL_ENV_PREFIX = 'SIMCTL_CHILD_';
|
|
71
70
|
class Simctl {
|
|
71
|
+
// Extension methods
|
|
72
|
+
addMedia = addmediaCommands.addMedia;
|
|
73
|
+
appInfo = appinfoCommands.appInfo;
|
|
74
|
+
bootDevice = bootCommands.bootDevice;
|
|
75
|
+
startBootMonitor = bootstatusCommands.startBootMonitor;
|
|
76
|
+
createDevice = createCommands.createDevice;
|
|
77
|
+
deleteDevice = deleteCommands.deleteDevice;
|
|
78
|
+
eraseDevice = eraseCommands.eraseDevice;
|
|
79
|
+
getAppContainer = getappcontainerCommands.getAppContainer;
|
|
80
|
+
getEnv = envCommands.getEnv;
|
|
81
|
+
installApp = installCommands.installApp;
|
|
82
|
+
getScreenshot = ioCommands.getScreenshot;
|
|
83
|
+
addRootCertificate = keychainCommands.addRootCertificate;
|
|
84
|
+
addCertificate = keychainCommands.addCertificate;
|
|
85
|
+
resetKeychain = keychainCommands.resetKeychain;
|
|
86
|
+
launchApp = launchCommands.launchApp;
|
|
87
|
+
getDevicesByParsing = listCommands.getDevicesByParsing;
|
|
88
|
+
getDevices = listCommands.getDevices;
|
|
89
|
+
getRuntimeForPlatformVersionViaJson = listCommands.getRuntimeForPlatformVersionViaJson;
|
|
90
|
+
getRuntimeForPlatformVersion = listCommands.getRuntimeForPlatformVersion;
|
|
91
|
+
getDeviceTypes = listCommands.getDeviceTypes;
|
|
92
|
+
list = listCommands.list;
|
|
93
|
+
setLocation = locationCommands.setLocation;
|
|
94
|
+
clearLocation = locationCommands.clearLocation;
|
|
95
|
+
openUrl = openurlCommands.openUrl;
|
|
96
|
+
setPasteboard = pbcopyCommands.setPasteboard;
|
|
97
|
+
getPasteboard = pbpasteCommands.getPasteboard;
|
|
98
|
+
grantPermission = privacyCommands.grantPermission;
|
|
99
|
+
revokePermission = privacyCommands.revokePermission;
|
|
100
|
+
resetPermission = privacyCommands.resetPermission;
|
|
101
|
+
pushNotification = pushCommands.pushNotification;
|
|
102
|
+
shutdownDevice = shutdownCommands.shutdownDevice;
|
|
103
|
+
spawnProcess = spawnCommands.spawnProcess;
|
|
104
|
+
spawnSubProcess = spawnCommands.spawnSubProcess;
|
|
105
|
+
terminateApp = terminateCommands.terminateApp;
|
|
106
|
+
getAppearance = uiCommands.getAppearance;
|
|
107
|
+
setAppearance = uiCommands.setAppearance;
|
|
108
|
+
getIncreaseContrast = uiCommands.getIncreaseContrast;
|
|
109
|
+
setIncreaseContrast = uiCommands.setIncreaseContrast;
|
|
110
|
+
getContentSize = uiCommands.getContentSize;
|
|
111
|
+
setContentSize = uiCommands.setContentSize;
|
|
112
|
+
removeApp = uninstallCommands.removeApp;
|
|
72
113
|
xcrun;
|
|
73
114
|
execTimeout;
|
|
74
115
|
logErrors;
|
|
75
116
|
_udid;
|
|
76
117
|
_devicesSetPath;
|
|
77
118
|
constructor(opts = {}) {
|
|
78
|
-
this.xcrun =
|
|
119
|
+
this.xcrun = { ...(opts.xcrun ?? { path: null }) };
|
|
79
120
|
this.execTimeout = opts.execTimeout ?? helpers_1.DEFAULT_EXEC_TIMEOUT;
|
|
80
121
|
this.logErrors = opts.logErrors ?? true;
|
|
81
122
|
this._udid = opts.udid ?? null;
|
|
82
123
|
this._devicesSetPath = opts.devicesSetPath ?? null;
|
|
83
124
|
}
|
|
84
|
-
set udid(value) {
|
|
85
|
-
this._udid = value;
|
|
86
|
-
}
|
|
87
125
|
get udid() {
|
|
88
126
|
return this._udid;
|
|
89
127
|
}
|
|
90
|
-
set devicesSetPath(value) {
|
|
91
|
-
this._devicesSetPath = value;
|
|
92
|
-
}
|
|
93
128
|
get devicesSetPath() {
|
|
94
129
|
return this._devicesSetPath;
|
|
95
130
|
}
|
|
131
|
+
set udid(value) {
|
|
132
|
+
this._udid = value;
|
|
133
|
+
}
|
|
134
|
+
set devicesSetPath(value) {
|
|
135
|
+
this._devicesSetPath = value;
|
|
136
|
+
}
|
|
96
137
|
/**
|
|
97
138
|
* @param commandName - Optional command name for error message
|
|
98
139
|
* @returns The UDID string
|
|
@@ -145,7 +186,11 @@ class Simctl {
|
|
|
145
186
|
];
|
|
146
187
|
// Prefix all passed in environment variables with 'SIMCTL_CHILD_', simctl
|
|
147
188
|
// will then pass these to the child (spawned) process.
|
|
148
|
-
const
|
|
189
|
+
const envWithPrefixedKeys = Object.fromEntries(Object.entries(initialEnv).map(([key, value]) => [
|
|
190
|
+
key.startsWith(SIMCTL_ENV_PREFIX) ? key : `${SIMCTL_ENV_PREFIX}${key}`,
|
|
191
|
+
value,
|
|
192
|
+
]));
|
|
193
|
+
const env = { ...process.env, ...envWithPrefixedKeys };
|
|
149
194
|
const execOpts = {
|
|
150
195
|
env,
|
|
151
196
|
encoding,
|
|
@@ -157,10 +202,7 @@ class Simctl {
|
|
|
157
202
|
try {
|
|
158
203
|
let execArgs;
|
|
159
204
|
if (architectures?.length) {
|
|
160
|
-
const archArgs =
|
|
161
|
-
'-arch',
|
|
162
|
-
arch,
|
|
163
|
-
]));
|
|
205
|
+
const archArgs = (Array.isArray(architectures) ? architectures : [architectures]).flatMap((arch) => ['-arch', arch]);
|
|
164
206
|
execArgs = ['arch', [...archArgs, xcrun, ...args], execOpts];
|
|
165
207
|
}
|
|
166
208
|
else {
|
|
@@ -185,48 +227,6 @@ class Simctl {
|
|
|
185
227
|
throw e;
|
|
186
228
|
}
|
|
187
229
|
}
|
|
188
|
-
// Extension methods
|
|
189
|
-
addMedia = addmediaCommands.addMedia;
|
|
190
|
-
appInfo = appinfoCommands.appInfo;
|
|
191
|
-
bootDevice = bootCommands.bootDevice;
|
|
192
|
-
startBootMonitor = bootstatusCommands.startBootMonitor;
|
|
193
|
-
createDevice = createCommands.createDevice;
|
|
194
|
-
deleteDevice = deleteCommands.deleteDevice;
|
|
195
|
-
eraseDevice = eraseCommands.eraseDevice;
|
|
196
|
-
getAppContainer = getappcontainerCommands.getAppContainer;
|
|
197
|
-
getEnv = envCommands.getEnv;
|
|
198
|
-
installApp = installCommands.installApp;
|
|
199
|
-
getScreenshot = ioCommands.getScreenshot;
|
|
200
|
-
addRootCertificate = keychainCommands.addRootCertificate;
|
|
201
|
-
addCertificate = keychainCommands.addCertificate;
|
|
202
|
-
resetKeychain = keychainCommands.resetKeychain;
|
|
203
|
-
launchApp = launchCommands.launchApp;
|
|
204
|
-
getDevicesByParsing = listCommands.getDevicesByParsing;
|
|
205
|
-
getDevices = listCommands.getDevices;
|
|
206
|
-
getRuntimeForPlatformVersionViaJson = listCommands.getRuntimeForPlatformVersionViaJson;
|
|
207
|
-
getRuntimeForPlatformVersion = listCommands.getRuntimeForPlatformVersion;
|
|
208
|
-
getDeviceTypes = listCommands.getDeviceTypes;
|
|
209
|
-
list = listCommands.list;
|
|
210
|
-
setLocation = locationCommands.setLocation;
|
|
211
|
-
clearLocation = locationCommands.clearLocation;
|
|
212
|
-
openUrl = openurlCommands.openUrl;
|
|
213
|
-
setPasteboard = pbcopyCommands.setPasteboard;
|
|
214
|
-
getPasteboard = pbpasteCommands.getPasteboard;
|
|
215
|
-
grantPermission = privacyCommands.grantPermission;
|
|
216
|
-
revokePermission = privacyCommands.revokePermission;
|
|
217
|
-
resetPermission = privacyCommands.resetPermission;
|
|
218
|
-
pushNotification = pushCommands.pushNotification;
|
|
219
|
-
shutdownDevice = shutdownCommands.shutdownDevice;
|
|
220
|
-
spawnProcess = spawnCommands.spawnProcess;
|
|
221
|
-
spawnSubProcess = spawnCommands.spawnSubProcess;
|
|
222
|
-
terminateApp = terminateCommands.terminateApp;
|
|
223
|
-
getAppearance = uiCommands.getAppearance;
|
|
224
|
-
setAppearance = uiCommands.setAppearance;
|
|
225
|
-
getIncreaseContrast = uiCommands.getIncreaseContrast;
|
|
226
|
-
setIncreaseContrast = uiCommands.setIncreaseContrast;
|
|
227
|
-
getContentSize = uiCommands.getContentSize;
|
|
228
|
-
setContentSize = uiCommands.setContentSize;
|
|
229
|
-
removeApp = uninstallCommands.removeApp;
|
|
230
230
|
}
|
|
231
231
|
exports.Simctl = Simctl;
|
|
232
232
|
exports.default = Simctl;
|
package/build/lib/simctl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simctl.js","sourceRoot":"","sources":["../../lib/simctl.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"simctl.js","sourceRoot":"","sources":["../../lib/simctl.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,qCAAyC;AACzC,uCAA+D;AAC/D,+CAAwD;AACxD,yEAA2D;AAC3D,uEAAyD;AACzD,iEAAmD;AACnD,6EAA+D;AAC/D,qEAAuD;AACvD,qEAAuD;AACvD,mEAAqD;AACrD,yFAA2E;AAC3E,uEAAyD;AACzD,6DAA+C;AAC/C,yEAA2D;AAC3D,qEAAuD;AACvD,iEAAmD;AACnD,uEAAyD;AACzD,qEAAuD;AACvD,uEAAyD;AACzD,uEAAyD;AACzD,iEAAmD;AACnD,kEAAoD;AACpD,yEAA2D;AAC3D,mEAAqD;AACrD,2EAA6D;AAC7D,6DAA+C;AAC/C,2EAA6D;AAC7D,yEAA2D;AAG3D,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAE1C,MAAa,MAAM;IACjB,oBAAoB;IACpB,QAAQ,GAAG,gBAAgB,CAAC,QAAQ,CAAC;IACrC,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC;IAClC,U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EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC;YAC/D,CAAC;iBAAM,CAAC;gBACN,QAAQ,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;YACrC,CAAC;YACD,mFAAmF;YACnF,OAAO,CACL,YAAY,CAAC,CAAC,CAAC,IAAI,yBAAU,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,IAAA,mBAAM,EAAC,GAAG,QAAQ,CAAC,CACtD,CAAC;QACrB,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,EAAE,CAAC;gBAClC,uEAAuE;gBACvE,wBAAwB;YAC1B,CAAC;iBAAM,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;gBACpB,MAAM,GAAG,GAAG,kBAAkB,UAAU,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;gBAChE,YAAG,CAAC,KAAK,CAAC,mBAAU,EAAE,GAAG,CAAC,CAAC;gBAC3B,CAAC,CAAC,OAAO,GAAG,GAAG,CAAC;YAClB,CAAC;iBAAM,CAAC;gBACN,YAAG,CAAC,KAAK,CAAC,mBAAU,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;YACnC,CAAC;YACD,MAAM,CAAC,CAAC;QACV,CAAC;IACH,CAAC;CACF;AAxLD,wBAwLC;AAED,kBAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appinfo.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/appinfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"appinfo.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/appinfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAGtC;;;;;;;;;GASG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CA4B9E"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.appInfo = appInfo;
|
|
7
4
|
const helpers_1 = require("../helpers");
|
|
8
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
9
5
|
/**
|
|
10
6
|
* Get information about an app installed on the simulator
|
|
11
7
|
*
|
|
@@ -33,7 +29,10 @@ async function appInfo(bundleId) {
|
|
|
33
29
|
throw new Error(`Cannot retrieve app info for ${bundleId}: ${err instanceof Error ? err.message : String(err)}`);
|
|
34
30
|
}
|
|
35
31
|
}
|
|
36
|
-
if (!
|
|
32
|
+
if (!result ||
|
|
33
|
+
typeof result !== 'object' ||
|
|
34
|
+
Array.isArray(result) ||
|
|
35
|
+
!('ApplicationType' in result)) {
|
|
37
36
|
throw new Error(`App with bundle identifier "${bundleId}" not found. Is it installed?`);
|
|
38
37
|
}
|
|
39
38
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appinfo.js","sourceRoot":"","sources":["../../../lib/subcommands/appinfo.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"appinfo.js","sourceRoot":"","sources":["../../../lib/subcommands/appinfo.ts"],"names":[],"mappings":";;AAcA,0BA4BC;AAxCD,wCAA8C;AAE9C;;;;;;;;;GASG;AACI,KAAK,UAAU,OAAO,CAAe,QAAgB;IAC1D,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;QAC1C,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC;KAC9C,CAAC,CAAC;IACH,IAAI,MAAW,CAAC;IAChB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;IAAC,MAAM,CAAC;QACP,0EAA0E;QAC1E,IAAI,CAAC;YACH,MAAM,GAAG,MAAM,IAAA,4BAAkB,EAAC,MAAM,CAAC,CAAC;QAC5C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CACb,gCAAgC,QAAQ,KAAK,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAChG,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IACE,CAAC,MAAM;QACP,OAAO,MAAM,KAAK,QAAQ;QAC1B,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QACrB,CAAC,CAAC,iBAAiB,IAAI,MAAM,CAAC,EAC9B,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,+BAA+B,QAAQ,+BAA+B,CAAC,CAAC;IAC1F,CAAC;IAED,OAAO,MAAiB,CAAC;AAC3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/boot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/boot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AAEtC;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAW5D"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.bootDevice = bootDevice;
|
|
7
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
8
4
|
const logger_1 = require("../logger");
|
|
9
5
|
/**
|
|
10
6
|
* Boot the particular Simulator if it is not running.
|
|
@@ -20,7 +16,7 @@ async function bootDevice() {
|
|
|
20
16
|
});
|
|
21
17
|
}
|
|
22
18
|
catch (e) {
|
|
23
|
-
if (
|
|
19
|
+
if (e.message?.includes('Unable to boot device in current state: Booted')) {
|
|
24
20
|
throw e;
|
|
25
21
|
}
|
|
26
22
|
logger_1.log.debug(logger_1.LOG_PREFIX, `Simulator already in 'Booted' state. Continuing`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.js","sourceRoot":"","sources":["../../../lib/subcommands/boot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"boot.js","sourceRoot":"","sources":["../../../lib/subcommands/boot.ts"],"names":[],"mappings":";;AAUA,gCAWC;AArBD,sCAA0C;AAG1C;;;;;;GAMG;AACI,KAAK,UAAU,UAAU;IAC9B,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACtB,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;SACjC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,IAAI,CAAC,CAAC,OAAO,EAAE,QAAQ,CAAC,gDAAgD,CAAC,EAAE,CAAC;YAC1E,MAAM,CAAC,CAAC;QACV,CAAC;QACD,YAAG,CAAC,KAAK,CAAC,mBAAU,EAAE,iDAAiD,CAAC,CAAC;IAC3E,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstatus.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/bootstatus.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bootstatus.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/bootstatus.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAE7C;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,kBAAuB,GAC5B,OAAO,CAAC,UAAU,CAAC,CAwFrB"}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.startBootMonitor = startBootMonitor;
|
|
7
4
|
const logger_1 = require("../logger");
|
|
8
5
|
const asyncbox_1 = require("asyncbox");
|
|
9
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
10
6
|
/**
|
|
11
7
|
* Start monitoring for boot status of the particular Simulator.
|
|
12
8
|
* If onFinished property is not set then the method will block
|
|
@@ -57,7 +53,7 @@ async function startBootMonitor(opts = {}) {
|
|
|
57
53
|
isBootingFinished = true;
|
|
58
54
|
}
|
|
59
55
|
else {
|
|
60
|
-
const errMessage =
|
|
56
|
+
const errMessage = status.length === 0
|
|
61
57
|
? `The simulator booting process has exited with code ${code} by signal ${signal}`
|
|
62
58
|
: status.join('\n');
|
|
63
59
|
error = new Error(errMessage);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstatus.js","sourceRoot":"","sources":["../../../lib/subcommands/bootstatus.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bootstatus.js","sourceRoot":"","sources":["../../../lib/subcommands/bootstatus.ts"],"names":[],"mappings":";;AAkBA,4CA2FC;AA7GD,sCAA8B;AAC9B,uCAA0C;AAK1C;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,gBAAgB,CAEpC,OAA2B,EAAE;IAE7B,MAAM,EACJ,OAAO,GAAG,MAAM,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,UAAU,EACV,OAAO,EACP,aAAa,GACd,GAAG,IAAI,CAAC;IACT,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IAE5C,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,iBAAiB,GAAG,KAAK,CAAC;IAC9B,IAAI,KAAK,GAAiB,IAAI,CAAC;IAC/B,IAAI,cAAc,GAA0B,IAAI,CAAC;IACjD,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;IACpB,IAAI,aAAa,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClB,CAAC;IACD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;QAChD,IAAI;QACJ,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;IACH,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,EAAE;QACpC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClB,IAAI,sBAAsB,IAAI,IAAI,CAAC,QAAQ,CAAC,2BAA2B,CAAC,EAAE,CAAC;YACzE,sBAAsB,EAAE,CAAC;QAC3B,CAAC;aAAM,IAAI,kBAAkB,IAAI,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,CAAC;YACxE,kBAAkB,EAAE,CAAC;QACvB,CAAC;IACH,CAAC,CAAC;IACF,KAAK,MAA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AAc,GAAG,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;SAAM,CAAC;QACN,IAAI,CAAC;YACH,MAAM,IAAA,2BAAgB,EACpB,GAAG,EAAE;gBACH,IAAI,KAAK,EAAE,CAAC;oBACV,MAAM,KAAK,CAAC;gBACd,CAAC;gBACD,OAAO,iBAAiB,CAAC;YAC3B,CAAC,EACD,EAAC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAC,CACnC,CAAC;QACJ,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,WAAW,EAAE,CAAC;YACpB,MAAM,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACxC,MAAM,IAAI,KAAK,CACb,iBAAiB,IAAI,uCAAuC,OAAO,KAAK;gBACtE,oBAAoB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC1C,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/create.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/create.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,UAAU,CAAC;AAK9C;;;;;;;;;;;GAWG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,EACvB,IAAI,GAAE,eAAoB,GACzB,OAAO,CAAC,MAAM,CAAC,CAqFjB"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.createDevice = createDevice;
|
|
7
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
8
4
|
const logger_1 = require("../logger");
|
|
9
5
|
const asyncbox_1 = require("asyncbox");
|
|
10
6
|
const helpers_1 = require("../helpers");
|
|
@@ -30,7 +26,7 @@ async function createDevice(name, deviceTypeId, platformVersion, opts = {}) {
|
|
|
30
26
|
runtimeIds.push(await this.getRuntimeForPlatformVersionViaJson(platformVersion, platform));
|
|
31
27
|
}
|
|
32
28
|
catch { }
|
|
33
|
-
if (
|
|
29
|
+
if (runtimeIds.length === 0) {
|
|
34
30
|
// at first make sure that the runtime id is the right one
|
|
35
31
|
// in some versions of Xcode it will be a patch version
|
|
36
32
|
let runtimeId;
|
|
@@ -75,7 +71,7 @@ async function createDevice(name, deviceTypeId, platformVersion, opts = {}) {
|
|
|
75
71
|
// make sure that it gets out of the "Creating" state
|
|
76
72
|
const retries = parseInt(`${timeout / 1000}`, 10);
|
|
77
73
|
await (0, asyncbox_1.retryInterval)(retries, 1000, async () => {
|
|
78
|
-
const devices =
|
|
74
|
+
const devices = Object.values(await this.getDevices()).flatMap((entries) => entries);
|
|
79
75
|
for (const device of devices) {
|
|
80
76
|
if (device.udid === udid) {
|
|
81
77
|
if (device.state === 'Creating') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../lib/subcommands/create.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../lib/subcommands/create.ts"],"names":[],"mappings":";;AAqBA,oCA2FC;AAhHD,sCAA0C;AAC1C,uCAAuC;AACvC,wCAA8D;AAI9D,MAAM,2BAA2B,GAAG,KAAK,CAAC;AAC1C,MAAM,gCAAgC,GAAG,KAAK,CAAC;AAE/C;;;;;;;;;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,CAAC,KAAK,KAAK,UAAU,EAAE,CAAC;oBAChC,gBAAgB;oBAChB,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,uBAAuB,CAAC,CAAC;gBACpE,CAAC;qBAAM,CAAC;oBACN,2BAA2B;oBAC3B,OAAO;gBACT,CAAC;YACH,CAAC;QACH,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,mBAAmB,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -5,10 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getScreenshot = getScreenshot;
|
|
7
7
|
const rimraf_1 = require("rimraf");
|
|
8
|
+
const node_crypto_1 = require("node:crypto");
|
|
8
9
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
10
|
const node_os_1 = __importDefault(require("node:os"));
|
|
10
11
|
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
11
|
-
const helpers_1 = require("../helpers");
|
|
12
12
|
/**
|
|
13
13
|
* Gets base64 screenshot for device
|
|
14
14
|
* It is required that Simulator is in _booted_ state.
|
|
@@ -21,7 +21,7 @@ const helpers_1 = require("../helpers");
|
|
|
21
21
|
*/
|
|
22
22
|
async function getScreenshot() {
|
|
23
23
|
const udid = this.requireUdid('io screenshot');
|
|
24
|
-
const pathToScreenshotPng = node_path_1.default.resolve(node_os_1.default.tmpdir(), `${
|
|
24
|
+
const pathToScreenshotPng = node_path_1.default.resolve(node_os_1.default.tmpdir(), `${(0, node_crypto_1.randomUUID)()}.png`);
|
|
25
25
|
try {
|
|
26
26
|
await this.exec('io', {
|
|
27
27
|
args: [udid, 'screenshot', pathToScreenshotPng],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"io.js","sourceRoot":"","sources":["../../../lib/subcommands/io.ts"],"names":[],"mappings":";;;;;AAiBA,sCAWC;AA5BD,mCAA8B;AAC9B,0DAA6B;AAC7B,sDAAyB;AACzB,gEAAkC;
|
|
1
|
+
{"version":3,"file":"io.js","sourceRoot":"","sources":["../../../lib/subcommands/io.ts"],"names":[],"mappings":";;;;;AAiBA,sCAWC;AA5BD,mCAA8B;AAC9B,6CAAuC;AACvC,0DAA6B;AAC7B,sDAAyB;AACzB,gEAAkC;AAGlC;;;;;;;;;GASG;AACI,KAAK,UAAU,aAAa;IACjC,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IAC/C,MAAM,mBAAmB,GAAG,mBAAI,CAAC,OAAO,CAAC,iBAAE,CAAC,MAAM,EAAE,EAAE,GAAG,IAAA,wBAAU,GAAE,MAAM,CAAC,CAAC;IAC7E,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACpB,IAAI,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,mBAAmB,CAAC;SAChD,CAAC,CAAC;QACH,OAAO,CAAC,MAAM,kBAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACrE,CAAC;YAAS,CAAC;QACT,MAAM,IAAA,eAAM,EAAC,mBAAmB,CAAC,CAAC;IACpC,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keychain.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/keychain.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"keychain.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/keychain.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;AAE1C;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GAAG,MAAM,EACrB,IAAI,GAAE,WAAgB,GACrB,OAAO,CAAC,IAAI,CAAC,CAWf;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GAAG,MAAM,EACrB,IAAI,GAAE,WAAgB,GACrB,OAAO,CAAC,IAAI,CAAC,CAWf;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI/D"}
|
|
@@ -8,29 +8,9 @@ exports.addCertificate = addCertificate;
|
|
|
8
8
|
exports.resetKeychain = resetKeychain;
|
|
9
9
|
const node_os_1 = __importDefault(require("node:os"));
|
|
10
10
|
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
11
|
-
const
|
|
11
|
+
const node_crypto_1 = require("node:crypto");
|
|
12
12
|
const node_path_1 = __importDefault(require("node:path"));
|
|
13
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
14
13
|
const rimraf_1 = require("rimraf");
|
|
15
|
-
/**
|
|
16
|
-
* @param payload - Certificate payload (string or Buffer)
|
|
17
|
-
* @param onPayloadStored - Callback function to execute with the file path
|
|
18
|
-
*/
|
|
19
|
-
async function handleRawPayload(payload, onPayloadStored) {
|
|
20
|
-
const filePath = node_path_1.default.resolve(node_os_1.default.tmpdir(), `${await (0, helpers_1.uuidV4)()}.pem`);
|
|
21
|
-
try {
|
|
22
|
-
if (lodash_1.default.isBuffer(payload)) {
|
|
23
|
-
await promises_1.default.writeFile(filePath, payload);
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
await promises_1.default.writeFile(filePath, payload, 'utf8');
|
|
27
|
-
}
|
|
28
|
-
await onPayloadStored(filePath);
|
|
29
|
-
}
|
|
30
|
-
finally {
|
|
31
|
-
await (0, rimraf_1.rimraf)(filePath);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
14
|
/**
|
|
35
15
|
* Adds the given certificate to the Trusted Root Store on the simulator
|
|
36
16
|
*
|
|
@@ -92,4 +72,23 @@ async function resetKeychain() {
|
|
|
92
72
|
args: [this.requireUdid('keychain reset'), 'reset'],
|
|
93
73
|
});
|
|
94
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* @param payload - Certificate payload (string or Buffer)
|
|
77
|
+
* @param onPayloadStored - Callback function to execute with the file path
|
|
78
|
+
*/
|
|
79
|
+
async function handleRawPayload(payload, onPayloadStored) {
|
|
80
|
+
const filePath = node_path_1.default.resolve(node_os_1.default.tmpdir(), `${(0, node_crypto_1.randomUUID)()}.pem`);
|
|
81
|
+
try {
|
|
82
|
+
if (Buffer.isBuffer(payload)) {
|
|
83
|
+
await promises_1.default.writeFile(filePath, payload);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
await promises_1.default.writeFile(filePath, payload, 'utf8');
|
|
87
|
+
}
|
|
88
|
+
await onPayloadStored(filePath);
|
|
89
|
+
}
|
|
90
|
+
finally {
|
|
91
|
+
await (0, rimraf_1.rimraf)(filePath);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
95
94
|
//# sourceMappingURL=keychain.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keychain.js","sourceRoot":"","sources":["../../../lib/subcommands/keychain.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"keychain.js","sourceRoot":"","sources":["../../../lib/subcommands/keychain.ts"],"names":[],"mappings":";;;;;AAoBA,gDAeC;AAcD,wCAeC;AAUD,sCAIC;AA9ED,sDAAyB;AACzB,gEAAkC;AAClC,6CAAuC;AACvC,0DAA6B;AAC7B,mCAA8B;AAI9B;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,kBAAkB,CAEtC,IAAqB,EACrB,OAAoB,EAAE;IAEtB,MAAM,EAAC,GAAG,GAAG,KAAK,EAAC,GAAG,IAAI,CAAC;IAC3B,MAAM,UAAU,GAAG,KAAK,EAAE,QAAgB,EAAE,EAAE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