node-simctl 8.2.9 → 9.1.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 +16 -0
- package/build/lib/helpers.d.ts.map +1 -1
- package/build/lib/helpers.js +13 -50
- package/build/lib/helpers.js.map +1 -1
- package/build/lib/index.d.ts +2 -2
- package/build/lib/index.d.ts.map +1 -1
- package/build/lib/index.js +3 -6
- package/build/lib/index.js.map +1 -1
- package/build/lib/logger.d.ts +1 -1
- package/build/lib/logger.d.ts.map +1 -1
- package/build/lib/logger.js +3 -9
- package/build/lib/logger.js.map +1 -1
- package/build/lib/simctl.d.ts +26 -26
- package/build/lib/simctl.d.ts.map +1 -1
- package/build/lib/simctl.js +44 -88
- package/build/lib/simctl.js.map +1 -1
- package/build/lib/subcommands/addmedia.d.ts +1 -1
- package/build/lib/subcommands/addmedia.d.ts.map +1 -1
- package/build/lib/subcommands/addmedia.js +1 -4
- package/build/lib/subcommands/addmedia.js.map +1 -1
- package/build/lib/subcommands/appinfo.d.ts +2 -2
- package/build/lib/subcommands/appinfo.d.ts.map +1 -1
- package/build/lib/subcommands/appinfo.js +7 -11
- package/build/lib/subcommands/appinfo.js.map +1 -1
- package/build/lib/subcommands/boot.d.ts +1 -1
- package/build/lib/subcommands/boot.d.ts.map +1 -1
- package/build/lib/subcommands/boot.js +3 -6
- package/build/lib/subcommands/boot.js.map +1 -1
- package/build/lib/subcommands/bootstatus.d.ts +2 -2
- package/build/lib/subcommands/bootstatus.d.ts.map +1 -1
- package/build/lib/subcommands/bootstatus.js +6 -9
- package/build/lib/subcommands/bootstatus.js.map +1 -1
- package/build/lib/subcommands/create.d.ts +2 -2
- package/build/lib/subcommands/create.d.ts.map +1 -1
- package/build/lib/subcommands/create.js +9 -12
- package/build/lib/subcommands/create.js.map +1 -1
- package/build/lib/subcommands/delete.d.ts +1 -1
- package/build/lib/subcommands/delete.d.ts.map +1 -1
- package/build/lib/subcommands/delete.js +1 -4
- package/build/lib/subcommands/delete.js.map +1 -1
- package/build/lib/subcommands/erase.d.ts +1 -1
- package/build/lib/subcommands/erase.d.ts.map +1 -1
- package/build/lib/subcommands/erase.js +3 -6
- package/build/lib/subcommands/erase.js.map +1 -1
- package/build/lib/subcommands/get_app_container.d.ts +1 -1
- package/build/lib/subcommands/get_app_container.d.ts.map +1 -1
- package/build/lib/subcommands/get_app_container.js +1 -4
- package/build/lib/subcommands/get_app_container.js.map +1 -1
- package/build/lib/subcommands/getenv.d.ts +1 -1
- package/build/lib/subcommands/getenv.d.ts.map +1 -1
- package/build/lib/subcommands/getenv.js +1 -4
- package/build/lib/subcommands/getenv.js.map +1 -1
- package/build/lib/subcommands/install.d.ts +1 -1
- package/build/lib/subcommands/install.d.ts.map +1 -1
- package/build/lib/subcommands/install.js +1 -4
- package/build/lib/subcommands/install.js.map +1 -1
- package/build/lib/subcommands/io.d.ts +1 -1
- package/build/lib/subcommands/io.d.ts.map +1 -1
- package/build/lib/subcommands/io.js +9 -15
- package/build/lib/subcommands/io.js.map +1 -1
- package/build/lib/subcommands/keychain.d.ts +2 -2
- package/build/lib/subcommands/keychain.d.ts.map +1 -1
- package/build/lib/subcommands/keychain.js +12 -20
- package/build/lib/subcommands/keychain.js.map +1 -1
- package/build/lib/subcommands/launch.d.ts +1 -1
- package/build/lib/subcommands/launch.d.ts.map +1 -1
- package/build/lib/subcommands/launch.js +3 -6
- package/build/lib/subcommands/launch.js.map +1 -1
- package/build/lib/subcommands/list.d.ts +2 -2
- package/build/lib/subcommands/list.d.ts.map +1 -1
- package/build/lib/subcommands/list.js +12 -20
- package/build/lib/subcommands/list.js.map +1 -1
- package/build/lib/subcommands/location.d.ts +1 -1
- package/build/lib/subcommands/location.d.ts.map +1 -1
- package/build/lib/subcommands/location.js +2 -6
- package/build/lib/subcommands/location.js.map +1 -1
- package/build/lib/subcommands/openurl.d.ts +1 -1
- package/build/lib/subcommands/openurl.d.ts.map +1 -1
- package/build/lib/subcommands/openurl.js +1 -4
- package/build/lib/subcommands/openurl.js.map +1 -1
- package/build/lib/subcommands/pbcopy.d.ts +1 -1
- package/build/lib/subcommands/pbcopy.d.ts.map +1 -1
- package/build/lib/subcommands/pbcopy.js +1 -4
- package/build/lib/subcommands/pbcopy.js.map +1 -1
- package/build/lib/subcommands/pbpaste.d.ts +1 -1
- package/build/lib/subcommands/pbpaste.d.ts.map +1 -1
- package/build/lib/subcommands/pbpaste.js +1 -4
- package/build/lib/subcommands/pbpaste.js.map +1 -1
- package/build/lib/subcommands/privacy.d.ts +1 -1
- package/build/lib/subcommands/privacy.d.ts.map +1 -1
- package/build/lib/subcommands/privacy.js +3 -8
- package/build/lib/subcommands/privacy.js.map +1 -1
- package/build/lib/subcommands/push.d.ts +1 -1
- package/build/lib/subcommands/push.d.ts.map +1 -1
- package/build/lib/subcommands/push.js +9 -15
- package/build/lib/subcommands/push.js.map +1 -1
- package/build/lib/subcommands/shutdown.d.ts +1 -1
- package/build/lib/subcommands/shutdown.d.ts.map +1 -1
- package/build/lib/subcommands/shutdown.js +3 -6
- package/build/lib/subcommands/shutdown.js.map +1 -1
- package/build/lib/subcommands/spawn.d.ts +1 -1
- package/build/lib/subcommands/spawn.d.ts.map +1 -1
- package/build/lib/subcommands/spawn.js +2 -6
- package/build/lib/subcommands/spawn.js.map +1 -1
- package/build/lib/subcommands/terminate.d.ts +1 -1
- package/build/lib/subcommands/terminate.d.ts.map +1 -1
- package/build/lib/subcommands/terminate.js +1 -4
- package/build/lib/subcommands/terminate.js.map +1 -1
- package/build/lib/subcommands/ui.d.ts +1 -1
- package/build/lib/subcommands/ui.d.ts.map +1 -1
- package/build/lib/subcommands/ui.js +6 -14
- package/build/lib/subcommands/ui.js.map +1 -1
- package/build/lib/subcommands/uninstall.d.ts +1 -1
- package/build/lib/subcommands/uninstall.d.ts.map +1 -1
- package/build/lib/subcommands/uninstall.js +1 -4
- package/build/lib/subcommands/uninstall.js.map +1 -1
- package/build/lib/types.d.ts.map +1 -1
- package/build/lib/types.js +1 -2
- package/lib/helpers.ts +5 -5
- package/lib/index.ts +2 -2
- package/lib/logger.ts +1 -1
- package/lib/simctl.ts +38 -47
- package/lib/subcommands/addmedia.ts +3 -5
- package/lib/subcommands/appinfo.ts +7 -13
- package/lib/subcommands/boot.ts +2 -2
- package/lib/subcommands/bootstatus.ts +6 -15
- package/lib/subcommands/create.ts +6 -7
- package/lib/subcommands/delete.ts +1 -1
- package/lib/subcommands/erase.ts +2 -1
- package/lib/subcommands/get_app_container.ts +1 -1
- package/lib/subcommands/getenv.ts +1 -1
- package/lib/subcommands/install.ts +1 -1
- package/lib/subcommands/io.ts +6 -4
- package/lib/subcommands/keychain.ts +8 -14
- package/lib/subcommands/launch.ts +3 -6
- package/lib/subcommands/list.ts +6 -13
- package/lib/subcommands/location.ts +2 -6
- package/lib/subcommands/openurl.ts +2 -1
- package/lib/subcommands/pbcopy.ts +3 -6
- package/lib/subcommands/pbpaste.ts +2 -5
- package/lib/subcommands/privacy.ts +2 -6
- package/lib/subcommands/push.ts +6 -4
- package/lib/subcommands/shutdown.ts +2 -2
- package/lib/subcommands/spawn.ts +2 -1
- package/lib/subcommands/terminate.ts +1 -1
- package/lib/subcommands/ui.ts +1 -1
- package/lib/subcommands/uninstall.ts +1 -1
- package/lib/types.ts +1 -3
- package/package.json +37 -39
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/boot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/boot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEzC;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAW5D"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.bootDevice = bootDevice;
|
|
4
|
-
const logger_1 = require("../logger");
|
|
1
|
+
import { log, LOG_PREFIX } from '../logger.js';
|
|
5
2
|
/**
|
|
6
3
|
* Boot the particular Simulator if it is not running.
|
|
7
4
|
*
|
|
@@ -9,7 +6,7 @@ const logger_1 = require("../logger");
|
|
|
9
6
|
* returns non-zero return code.
|
|
10
7
|
* @throws {Error} If the `udid` instance property is unset
|
|
11
8
|
*/
|
|
12
|
-
async function bootDevice() {
|
|
9
|
+
export async function bootDevice() {
|
|
13
10
|
try {
|
|
14
11
|
await this.exec('boot', {
|
|
15
12
|
args: [this.requireUdid('boot')],
|
|
@@ -19,7 +16,7 @@ async function bootDevice() {
|
|
|
19
16
|
if (e.message?.includes('Unable to boot device in current state: Booted')) {
|
|
20
17
|
throw e;
|
|
21
18
|
}
|
|
22
|
-
|
|
19
|
+
log.debug(LOG_PREFIX, `Simulator already in 'Booted' state. Continuing`);
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
22
|
//# sourceMappingURL=boot.js.map
|
|
@@ -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":"AAAA,OAAO,EAAC,GAAG,EAAE,UAAU,EAAC,MAAM,cAAc,CAAC;AAG7C;;;;;;GAMG;AACH,MAAM,CAAC,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,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,iDAAiD,CAAC,CAAC;IAC3E,CAAC;AACH,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Simctl } from '../simctl';
|
|
2
|
-
import type { BootMonitorOptions } from '../types';
|
|
3
1
|
import type { SubProcess } from 'teen_process';
|
|
2
|
+
import type { Simctl } from '../simctl.js';
|
|
3
|
+
import type { BootMonitorOptions } from '../types.js';
|
|
4
4
|
/**
|
|
5
5
|
* Start monitoring for boot status of the particular Simulator.
|
|
6
6
|
* If onFinished property is not set then the method will block
|
|
@@ -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":"AACA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAG7C,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,aAAa,CAAC;AAEpD;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,kBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC,CAiFvG"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.startBootMonitor = startBootMonitor;
|
|
4
|
-
const logger_1 = require("../logger");
|
|
5
|
-
const asyncbox_1 = require("asyncbox");
|
|
1
|
+
import { waitForCondition } from 'asyncbox';
|
|
2
|
+
import { log, LOG_PREFIX } from '../logger.js';
|
|
6
3
|
/**
|
|
7
4
|
* Start monitoring for boot status of the particular Simulator.
|
|
8
5
|
* If onFinished property is not set then the method will block
|
|
@@ -15,8 +12,8 @@ const asyncbox_1 = require("asyncbox");
|
|
|
15
12
|
* property is not set.
|
|
16
13
|
* @throws {Error} If the `udid` instance property is unset
|
|
17
14
|
*/
|
|
18
|
-
async function startBootMonitor(opts = {}) {
|
|
19
|
-
const { timeout = 240000, onWaitingDataMigration, onWaitingSystemApp, onFinished, onError, shouldPreboot
|
|
15
|
+
export async function startBootMonitor(opts = {}) {
|
|
16
|
+
const { timeout = 240000, onWaitingDataMigration, onWaitingSystemApp, onFinished, onError, shouldPreboot } = opts;
|
|
20
17
|
const udid = this.requireUdid('bootstatus');
|
|
21
18
|
const status = [];
|
|
22
19
|
let isBootingFinished = false;
|
|
@@ -69,7 +66,7 @@ async function startBootMonitor(opts = {}) {
|
|
|
69
66
|
await bootMonitor.stop();
|
|
70
67
|
}
|
|
71
68
|
catch (e) {
|
|
72
|
-
|
|
69
|
+
log.warn(LOG_PREFIX, e.message);
|
|
73
70
|
}
|
|
74
71
|
}
|
|
75
72
|
};
|
|
@@ -79,7 +76,7 @@ async function startBootMonitor(opts = {}) {
|
|
|
79
76
|
}
|
|
80
77
|
else {
|
|
81
78
|
try {
|
|
82
|
-
await
|
|
79
|
+
await waitForCondition(() => {
|
|
83
80
|
if (error) {
|
|
84
81
|
throw error;
|
|
85
82
|
}
|
|
@@ -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":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,UAAU,CAAC;AAG1C,OAAO,EAAC,GAAG,EAAE,UAAU,EAAC,MAAM,cAAc,CAAC;AAI7C;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAe,OAA2B,EAAE;IACh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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,5 +1,5 @@
|
|
|
1
|
-
import type { Simctl } from '../simctl';
|
|
2
|
-
import type { SimCreationOpts } from '../types';
|
|
1
|
+
import type { Simctl } from '../simctl.js';
|
|
2
|
+
import type { SimCreationOpts } from '../types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Create Simulator device with given name for the particular
|
|
5
5
|
* platform type and version.
|
|
@@ -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":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,aAAa,CAAC;AAKjD;;;;;;;;;;;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,CAmFjB"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const logger_1 = require("../logger");
|
|
5
|
-
const asyncbox_1 = require("asyncbox");
|
|
6
|
-
const helpers_1 = require("../helpers");
|
|
1
|
+
import { retryInterval } from 'asyncbox';
|
|
2
|
+
import { SIM_RUNTIME_NAME, normalizeVersion } from '../helpers.js';
|
|
3
|
+
import { log, LOG_PREFIX } from '../logger.js';
|
|
7
4
|
const SIM_RUNTIME_NAME_SUFFIX_IOS = 'iOS';
|
|
8
5
|
const DEFAULT_CREATE_SIMULATOR_TIMEOUT = 10000;
|
|
9
6
|
/**
|
|
@@ -18,7 +15,7 @@ const DEFAULT_CREATE_SIMULATOR_TIMEOUT = 10000;
|
|
|
18
15
|
* @throws {Error} If the corresponding simctl subcommand command
|
|
19
16
|
* returns non-zero return code.
|
|
20
17
|
*/
|
|
21
|
-
async function createDevice(name, deviceTypeId, platformVersion, opts = {}) {
|
|
18
|
+
export async function createDevice(name, deviceTypeId, platformVersion, opts = {}) {
|
|
22
19
|
const { platform = SIM_RUNTIME_NAME_SUFFIX_IOS, timeout = DEFAULT_CREATE_SIMULATOR_TIMEOUT } = opts;
|
|
23
20
|
const runtimeIds = [];
|
|
24
21
|
// Try getting runtimeId using JSON flag
|
|
@@ -34,24 +31,24 @@ async function createDevice(name, deviceTypeId, platformVersion, opts = {}) {
|
|
|
34
31
|
runtimeId = await this.getRuntimeForPlatformVersion(platformVersion, platform);
|
|
35
32
|
}
|
|
36
33
|
catch {
|
|
37
|
-
|
|
34
|
+
log.warn(LOG_PREFIX, `Unable to find runtime for iOS '${platformVersion}'. Continuing`);
|
|
38
35
|
runtimeId = platformVersion;
|
|
39
36
|
}
|
|
40
37
|
// get the possible runtimes, which will be iterated over
|
|
41
38
|
// start with major-minor version
|
|
42
|
-
const potentialRuntimeIds = [
|
|
39
|
+
const potentialRuntimeIds = [normalizeVersion(runtimeId)];
|
|
43
40
|
if (runtimeId.split('.').length === 3) {
|
|
44
41
|
// add patch version if it exists
|
|
45
42
|
potentialRuntimeIds.push(runtimeId);
|
|
46
43
|
}
|
|
47
44
|
// add modified versions, since modern Xcodes use this, then the bare
|
|
48
45
|
// versions, to accomodate older Xcodes
|
|
49
|
-
runtimeIds.push(...potentialRuntimeIds.map((id) => `${
|
|
46
|
+
runtimeIds.push(...potentialRuntimeIds.map((id) => `${SIM_RUNTIME_NAME}${platform}-${id.replace(/\./g, '-')}`), ...potentialRuntimeIds);
|
|
50
47
|
}
|
|
51
48
|
// go through the runtime ids and try to create a simulator with each
|
|
52
49
|
let udid;
|
|
53
50
|
for (const runtimeId of runtimeIds) {
|
|
54
|
-
|
|
51
|
+
log.debug(LOG_PREFIX, `Creating simulator with name '${name}', device type id '${deviceTypeId}' and runtime id '${runtimeId}'`);
|
|
55
52
|
try {
|
|
56
53
|
const { stdout } = await this.exec('create', {
|
|
57
54
|
args: [name, deviceTypeId, runtimeId],
|
|
@@ -70,7 +67,7 @@ async function createDevice(name, deviceTypeId, platformVersion, opts = {}) {
|
|
|
70
67
|
}
|
|
71
68
|
// make sure that it gets out of the "Creating" state
|
|
72
69
|
const retries = parseInt(`${timeout / 1000}`, 10);
|
|
73
|
-
await
|
|
70
|
+
await retryInterval(retries, 1000, async () => {
|
|
74
71
|
const devices = Object.values(await this.getDevices()).flatMap((entries) => entries);
|
|
75
72
|
for (const device of devices) {
|
|
76
73
|
if (device.udid === udid) {
|
|
@@ -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":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AAEvC,OAAO,EAAC,gBAAgB,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AACjE,OAAO,EAAC,GAAG,EAAE,UAAU,EAAC,MAAM,cAAc,CAAC;AAI7C,MAAM,2BAA2B,GAAG,KAAK,CAAC;AAC1C,MAAM,gCAAgC,GAAG,KAAK,CAAC;AAE/C;;;;;;;;;;;GAWG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AAM,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/delete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/delete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEzC;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI9D"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteDevice = deleteDevice;
|
|
4
1
|
/**
|
|
5
2
|
* Delete the particular Simulator from available devices list.
|
|
6
3
|
*
|
|
@@ -8,7 +5,7 @@ exports.deleteDevice = deleteDevice;
|
|
|
8
5
|
* returns non-zero return code.
|
|
9
6
|
* @throws {Error} If the `udid` instance property is unset
|
|
10
7
|
*/
|
|
11
|
-
async function deleteDevice() {
|
|
8
|
+
export async function deleteDevice() {
|
|
12
9
|
await this.exec('delete', {
|
|
13
10
|
args: [this.requireUdid('delete')],
|
|
14
11
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../lib/subcommands/delete.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../lib/subcommands/delete.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;QACxB,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;KACnC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"erase.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/erase.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"erase.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/erase.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEzC;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,MAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAWrF"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.eraseDevice = eraseDevice;
|
|
4
|
-
const asyncbox_1 = require("asyncbox");
|
|
1
|
+
import { retryInterval } from 'asyncbox';
|
|
5
2
|
/**
|
|
6
3
|
* Reset the content and settings of the particular Simulator.
|
|
7
4
|
* It is required that Simulator is in _shutdown_ state.
|
|
@@ -12,10 +9,10 @@ const asyncbox_1 = require("asyncbox");
|
|
|
12
9
|
* returns non-zero return code.
|
|
13
10
|
* @throws {Error} If the `udid` instance property is unset
|
|
14
11
|
*/
|
|
15
|
-
async function eraseDevice(timeout = 1000) {
|
|
12
|
+
export async function eraseDevice(timeout = 1000) {
|
|
16
13
|
// retry erase with a sleep in between because it's flakey
|
|
17
14
|
const retries = parseInt(`${timeout / 200}`, 10);
|
|
18
|
-
await
|
|
15
|
+
await retryInterval(retries, 200, async () => await this.exec('erase', {
|
|
19
16
|
args: [this.requireUdid('erase')],
|
|
20
17
|
}));
|
|
21
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"erase.js","sourceRoot":"","sources":["../../../lib/subcommands/erase.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"erase.js","sourceRoot":"","sources":["../../../lib/subcommands/erase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AAIvC;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAe,UAAkB,IAAI;IACpE,0DAA0D;IAC1D,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,OAAO,GAAG,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;IACjD,MAAM,aAAa,CACjB,OAAO,EACP,GAAG,EACH,KAAK,IAAI,EAAE,CACT,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;QACvB,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;KAClC,CAAC,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get_app_container.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/get_app_container.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"get_app_container.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/get_app_container.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEzC;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,aAAa,GAAE,MAAM,GAAG,IAAW,GAClC,OAAO,CAAC,MAAM,CAAC,CAOjB"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAppContainer = getAppContainer;
|
|
4
1
|
/**
|
|
5
2
|
* Get the full path to the particular application container
|
|
6
3
|
* on the local file system. Note, that this subcommand throws
|
|
@@ -18,7 +15,7 @@ exports.getAppContainer = getAppContainer;
|
|
|
18
15
|
* returns non-zero return code.
|
|
19
16
|
* @throws {Error} If the `udid` instance property is unset
|
|
20
17
|
*/
|
|
21
|
-
async function getAppContainer(bundleId, containerType = null) {
|
|
18
|
+
export async function getAppContainer(bundleId, containerType = null) {
|
|
22
19
|
const args = [this.requireUdid('get_app_container'), bundleId];
|
|
23
20
|
if (containerType) {
|
|
24
21
|
args.push(containerType);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get_app_container.js","sourceRoot":"","sources":["../../../lib/subcommands/get_app_container.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get_app_container.js","sourceRoot":"","sources":["../../../lib/subcommands/get_app_container.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAEnC,QAAgB,EAChB,gBAA+B,IAAI;IAEnC,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC/D,IAAI,aAAa,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC3B,CAAC;IACD,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAC,IAAI,EAAC,CAAC,CAAC;IAC9D,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AAC/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getenv.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/getenv.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"getenv.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/getenv.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEzC;;;;;;;;GAQG;AACH,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAMlF"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getEnv = getEnv;
|
|
4
1
|
/**
|
|
5
2
|
* Retrieves the value of a Simulator environment variable
|
|
6
3
|
*
|
|
@@ -10,7 +7,7 @@ exports.getEnv = getEnv;
|
|
|
10
7
|
* @throws {Error} If there was an error while running the command
|
|
11
8
|
* @throws {Error} If the `udid` instance property is unset
|
|
12
9
|
*/
|
|
13
|
-
async function getEnv(varName) {
|
|
10
|
+
export async function getEnv(varName) {
|
|
14
11
|
const { stdout, stderr } = await this.exec('getenv', {
|
|
15
12
|
args: [this.requireUdid('getenv'), varName],
|
|
16
13
|
logErrors: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getenv.js","sourceRoot":"","sources":["../../../lib/subcommands/getenv.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getenv.js","sourceRoot":"","sources":["../../../lib/subcommands/getenv.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAAe,OAAe;IACxD,MAAM,EAAC,MAAM,EAAE,MAAM,EAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;QACjD,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;QAC3C,SAAS,EAAE,KAAK;KACjB,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;AAChC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/install.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/install.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEzC;;;;;;;;;GASG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI7E"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.installApp = installApp;
|
|
4
1
|
/**
|
|
5
2
|
* Install the particular application package on Simulator.
|
|
6
3
|
* It is required that Simulator is in _booted_ state.
|
|
@@ -11,7 +8,7 @@ exports.installApp = installApp;
|
|
|
11
8
|
* returns non-zero return code.
|
|
12
9
|
* @throws {Error} If the `udid` instance property is unset
|
|
13
10
|
*/
|
|
14
|
-
async function installApp(appPath) {
|
|
11
|
+
export async function installApp(appPath) {
|
|
15
12
|
await this.exec('install', {
|
|
16
13
|
args: [this.requireUdid('install'), appPath],
|
|
17
14
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../lib/subcommands/install.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../lib/subcommands/install.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAe,OAAe;IAC5D,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;QACzB,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;KAC7C,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/io.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/io.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEzC;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAWjE"}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.getScreenshot = getScreenshot;
|
|
7
|
-
const rimraf_1 = require("rimraf");
|
|
8
|
-
const node_crypto_1 = require("node:crypto");
|
|
9
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
-
const node_os_1 = __importDefault(require("node:os"));
|
|
11
|
-
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import fs from 'node:fs/promises';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { rimraf } from 'rimraf';
|
|
12
6
|
/**
|
|
13
7
|
* Gets base64 screenshot for device
|
|
14
8
|
* It is required that Simulator is in _booted_ state.
|
|
@@ -19,17 +13,17 @@ const promises_1 = __importDefault(require("node:fs/promises"));
|
|
|
19
13
|
* returns non-zero return code.
|
|
20
14
|
* @throws {Error} If the `udid` instance property is unset
|
|
21
15
|
*/
|
|
22
|
-
async function getScreenshot() {
|
|
16
|
+
export async function getScreenshot() {
|
|
23
17
|
const udid = this.requireUdid('io screenshot');
|
|
24
|
-
const pathToScreenshotPng =
|
|
18
|
+
const pathToScreenshotPng = path.resolve(os.tmpdir(), `${randomUUID()}.png`);
|
|
25
19
|
try {
|
|
26
20
|
await this.exec('io', {
|
|
27
21
|
args: [udid, 'screenshot', pathToScreenshotPng],
|
|
28
22
|
});
|
|
29
|
-
return (await
|
|
23
|
+
return (await fs.readFile(pathToScreenshotPng)).toString('base64');
|
|
30
24
|
}
|
|
31
25
|
finally {
|
|
32
|
-
await
|
|
26
|
+
await rimraf(pathToScreenshotPng);
|
|
33
27
|
}
|
|
34
28
|
}
|
|
35
29
|
//# sourceMappingURL=io.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"io.js","sourceRoot":"","sources":["../../../lib/subcommands/io.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"io.js","sourceRoot":"","sources":["../../../lib/subcommands/io.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAC,MAAM,EAAC,MAAM,QAAQ,CAAC;AAI9B;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IAC/C,MAAM,mBAAmB,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,GAAG,UAAU,EAAE,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,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACrE,CAAC;YAAS,CAAC;QACT,MAAM,MAAM,CAAC,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":"AAOA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,aAAa,CAAC;AAE7C;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAWnH;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAW/G;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI/D"}
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.addRootCertificate = addRootCertificate;
|
|
7
|
-
exports.addCertificate = addCertificate;
|
|
8
|
-
exports.resetKeychain = resetKeychain;
|
|
9
|
-
const node_os_1 = __importDefault(require("node:os"));
|
|
10
|
-
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
11
|
-
const node_crypto_1 = require("node:crypto");
|
|
12
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
13
|
-
const rimraf_1 = require("rimraf");
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import fs from 'node:fs/promises';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { rimraf } from 'rimraf';
|
|
14
6
|
/**
|
|
15
7
|
* Adds the given certificate to the Trusted Root Store on the simulator
|
|
16
8
|
*
|
|
@@ -23,7 +15,7 @@ const rimraf_1 = require("rimraf");
|
|
|
23
15
|
* or there was an error while adding the certificate
|
|
24
16
|
* @throws {Error} If the `udid` instance property is unset
|
|
25
17
|
*/
|
|
26
|
-
async function addRootCertificate(cert, opts = {}) {
|
|
18
|
+
export async function addRootCertificate(cert, opts = {}) {
|
|
27
19
|
const { raw = false } = opts;
|
|
28
20
|
const execMethod = async (certPath) => await this.exec('keychain', {
|
|
29
21
|
args: [this.requireUdid('keychain add-root-cert'), 'add-root-cert', certPath],
|
|
@@ -47,7 +39,7 @@ async function addRootCertificate(cert, opts = {}) {
|
|
|
47
39
|
* or there was an error while adding the certificate
|
|
48
40
|
* @throws {Error} If the `udid` instance property is unset
|
|
49
41
|
*/
|
|
50
|
-
async function addCertificate(cert, opts = {}) {
|
|
42
|
+
export async function addCertificate(cert, opts = {}) {
|
|
51
43
|
const { raw = false } = opts;
|
|
52
44
|
const execMethod = async (certPath) => await this.exec('keychain', {
|
|
53
45
|
args: [this.requireUdid('keychain add-cert'), 'add-cert', certPath],
|
|
@@ -67,7 +59,7 @@ async function addCertificate(cert, opts = {}) {
|
|
|
67
59
|
* or there was an error while resetting the keychain
|
|
68
60
|
* @throws {Error} If the `udid` instance property is unset
|
|
69
61
|
*/
|
|
70
|
-
async function resetKeychain() {
|
|
62
|
+
export async function resetKeychain() {
|
|
71
63
|
await this.exec('keychain', {
|
|
72
64
|
args: [this.requireUdid('keychain reset'), 'reset'],
|
|
73
65
|
});
|
|
@@ -77,18 +69,18 @@ async function resetKeychain() {
|
|
|
77
69
|
* @param onPayloadStored - Callback function to execute with the file path
|
|
78
70
|
*/
|
|
79
71
|
async function handleRawPayload(payload, onPayloadStored) {
|
|
80
|
-
const filePath =
|
|
72
|
+
const filePath = path.resolve(os.tmpdir(), `${randomUUID()}.pem`);
|
|
81
73
|
try {
|
|
82
74
|
if (Buffer.isBuffer(payload)) {
|
|
83
|
-
await
|
|
75
|
+
await fs.writeFile(filePath, payload);
|
|
84
76
|
}
|
|
85
77
|
else {
|
|
86
|
-
await
|
|
78
|
+
await fs.writeFile(filePath, payload, 'utf8');
|
|
87
79
|
}
|
|
88
80
|
await onPayloadStored(filePath);
|
|
89
81
|
}
|
|
90
82
|
finally {
|
|
91
|
-
await
|
|
83
|
+
await rimraf(filePath);
|
|
92
84
|
}
|
|
93
85
|
}
|
|
94
86
|
//# 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":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAC,MAAM,EAAC,MAAM,QAAQ,CAAC;AAK9B;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAe,IAAqB,EAAE,OAAoB,EAAE;IAClG,MAAM,EAAC,GAAG,GAAG,KAAK,EAAC,GAAG,IAAI,CAAC;IAC3B,MAAM,UAAU,GAAG,KAAK,EAAE,QAAgB,EAAE,EAAE,CAC5C,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;QAC1B,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,C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AC,OAAO,CAAC,EAAE,CAAC;YAC7B,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACxC,CAAC;aAAM,CAAC;YACN,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAChD,CAAC;QACD,MAAM,eAAe,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC;YAAS,CAAC;QACT,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launch.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/launch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"launch.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/launch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEzC;;;;;;;;;;;;;GAaG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,GAAE,MAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAQlG"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.launchApp = launchApp;
|
|
4
|
-
const asyncbox_1 = require("asyncbox");
|
|
1
|
+
import { retryInterval } from 'asyncbox';
|
|
5
2
|
/**
|
|
6
3
|
* Execute the particular application package on Simulator.
|
|
7
4
|
* It is required that Simulator is in _booted_ state and
|
|
@@ -16,8 +13,8 @@ const asyncbox_1 = require("asyncbox");
|
|
|
16
13
|
* returns non-zero return code.
|
|
17
14
|
* @throws {Error} If the `udid` instance property is unset
|
|
18
15
|
*/
|
|
19
|
-
async function launchApp(bundleId, tries = 5) {
|
|
20
|
-
const result = await
|
|
16
|
+
export async function launchApp(bundleId, tries = 5) {
|
|
17
|
+
const result = await retryInterval(tries, 1000, async () => {
|
|
21
18
|
const { stdout } = await this.exec('launch', {
|
|
22
19
|
args: [this.requireUdid('launch'), bundleId],
|
|
23
20
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launch.js","sourceRoot":"","sources":["../../../lib/subcommands/launch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"launch.js","sourceRoot":"","sources":["../../../lib/subcommands/launch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AAIvC;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAe,QAAgB,EAAE,QAAgB,CAAC;IAC/E,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,EAAE;QACzD,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YACzC,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;SAC7C,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC;IAC7B,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,IAAI,EAAE,CAAC;AACtB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Simctl } from '../simctl';
|
|
2
|
-
import type { DeviceInfo } from '../types';
|
|
1
|
+
import type { Simctl } from '../simctl.js';
|
|
2
|
+
import type { DeviceInfo } from '../types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Parse the list of existing Simulator devices to represent
|
|
5
5
|
* it as convenient mapping.
|