node-simctl 8.0.8 → 8.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 +12 -0
- package/build/index.d.ts +2 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js.map +1 -1
- package/build/lib/helpers.d.ts +17 -9
- package/build/lib/helpers.d.ts.map +1 -1
- package/build/lib/helpers.js +50 -4
- package/build/lib/helpers.js.map +1 -1
- package/build/lib/logger.d.ts +2 -3
- package/build/lib/logger.d.ts.map +1 -1
- package/build/lib/logger.js +3 -5
- package/build/lib/logger.js.map +1 -1
- package/build/lib/simctl.d.ts +82 -188
- package/build/lib/simctl.d.ts.map +1 -1
- package/build/lib/simctl.js +98 -150
- package/build/lib/simctl.js.map +1 -1
- package/build/lib/subcommands/addmedia.d.ts +14 -16
- package/build/lib/subcommands/addmedia.d.ts.map +1 -1
- package/build/lib/subcommands/addmedia.js +5 -7
- package/build/lib/subcommands/addmedia.js.map +1 -1
- package/build/lib/subcommands/appinfo.d.ts +13 -45
- package/build/lib/subcommands/appinfo.d.ts.map +1 -1
- package/build/lib/subcommands/appinfo.js +31 -42
- package/build/lib/subcommands/appinfo.js.map +1 -1
- package/build/lib/subcommands/boot.d.ts +9 -12
- package/build/lib/subcommands/boot.d.ts.map +1 -1
- package/build/lib/subcommands/boot.js +5 -40
- package/build/lib/subcommands/boot.js.map +1 -1
- package/build/lib/subcommands/bootstatus.d.ts +16 -56
- package/build/lib/subcommands/bootstatus.d.ts.map +1 -1
- package/build/lib/subcommands/bootstatus.js +8 -22
- package/build/lib/subcommands/bootstatus.js.map +1 -1
- package/build/lib/subcommands/create.d.ts +15 -34
- package/build/lib/subcommands/create.d.ts.map +1 -1
- package/build/lib/subcommands/create.js +23 -66
- package/build/lib/subcommands/create.js.map +1 -1
- package/build/lib/subcommands/delete.d.ts +9 -12
- package/build/lib/subcommands/delete.d.ts.map +1 -1
- package/build/lib/subcommands/delete.js +3 -5
- package/build/lib/subcommands/delete.js.map +1 -1
- package/build/lib/subcommands/erase.d.ts +12 -15
- package/build/lib/subcommands/erase.d.ts.map +1 -1
- package/build/lib/subcommands/erase.js +4 -6
- package/build/lib/subcommands/erase.js.map +1 -1
- package/build/lib/subcommands/get_app_container.d.ts +19 -22
- package/build/lib/subcommands/get_app_container.d.ts.map +1 -1
- package/build/lib/subcommands/get_app_container.js +6 -8
- package/build/lib/subcommands/get_app_container.js.map +1 -1
- package/build/lib/subcommands/getenv.d.ts +11 -14
- package/build/lib/subcommands/getenv.d.ts.map +1 -1
- package/build/lib/subcommands/getenv.js +5 -7
- package/build/lib/subcommands/getenv.js.map +1 -1
- package/build/lib/subcommands/install.d.ts +12 -15
- package/build/lib/subcommands/install.d.ts.map +1 -1
- package/build/lib/subcommands/install.js +4 -6
- package/build/lib/subcommands/install.js.map +1 -1
- package/build/lib/subcommands/io.d.ts +12 -15
- package/build/lib/subcommands/io.d.ts.map +1 -1
- package/build/lib/subcommands/io.js +4 -6
- package/build/lib/subcommands/io.js.map +1 -1
- package/build/lib/subcommands/keychain.d.ts +37 -55
- package/build/lib/subcommands/keychain.d.ts.map +1 -1
- package/build/lib/subcommands/keychain.js +16 -25
- package/build/lib/subcommands/keychain.js.map +1 -1
- package/build/lib/subcommands/launch.d.ts +16 -19
- package/build/lib/subcommands/launch.d.ts.map +1 -1
- package/build/lib/subcommands/launch.js +9 -11
- package/build/lib/subcommands/launch.js.map +1 -1
- package/build/lib/subcommands/list.d.ts +94 -125
- package/build/lib/subcommands/list.d.ts.map +1 -1
- package/build/lib/subcommands/list.js +34 -92
- package/build/lib/subcommands/list.js.map +1 -1
- package/build/lib/subcommands/location.d.ts +18 -22
- package/build/lib/subcommands/location.d.ts.map +1 -1
- package/build/lib/subcommands/location.js +11 -13
- package/build/lib/subcommands/location.js.map +1 -1
- package/build/lib/subcommands/openurl.d.ts +15 -17
- package/build/lib/subcommands/openurl.d.ts.map +1 -1
- package/build/lib/subcommands/openurl.js +5 -7
- package/build/lib/subcommands/openurl.js.map +1 -1
- package/build/lib/subcommands/pbcopy.d.ts +14 -17
- package/build/lib/subcommands/pbcopy.d.ts.map +1 -1
- package/build/lib/subcommands/pbcopy.js +5 -7
- package/build/lib/subcommands/pbcopy.js.map +1 -1
- package/build/lib/subcommands/pbpaste.d.ts +14 -17
- package/build/lib/subcommands/pbpaste.d.ts.map +1 -1
- package/build/lib/subcommands/pbpaste.js +5 -7
- package/build/lib/subcommands/pbpaste.js.map +1 -1
- package/build/lib/subcommands/privacy.d.ts +52 -57
- package/build/lib/subcommands/privacy.d.ts.map +1 -1
- package/build/lib/subcommands/privacy.js +15 -17
- package/build/lib/subcommands/privacy.js.map +1 -1
- package/build/lib/subcommands/push.d.ts +22 -25
- package/build/lib/subcommands/push.d.ts.map +1 -1
- package/build/lib/subcommands/push.js +5 -7
- package/build/lib/subcommands/push.js.map +1 -1
- package/build/lib/subcommands/shutdown.d.ts +9 -12
- package/build/lib/subcommands/shutdown.d.ts.map +1 -1
- package/build/lib/subcommands/shutdown.js +5 -40
- package/build/lib/subcommands/shutdown.js.map +1 -1
- package/build/lib/subcommands/spawn.d.ts +24 -27
- package/build/lib/subcommands/spawn.d.ts.map +1 -1
- package/build/lib/subcommands/spawn.js +12 -14
- package/build/lib/subcommands/spawn.js.map +1 -1
- package/build/lib/subcommands/terminate.d.ts +12 -15
- package/build/lib/subcommands/terminate.d.ts.map +1 -1
- package/build/lib/subcommands/terminate.js +4 -6
- package/build/lib/subcommands/terminate.js.map +1 -1
- package/build/lib/subcommands/ui.d.ts +97 -105
- package/build/lib/subcommands/ui.d.ts.map +1 -1
- package/build/lib/subcommands/ui.js +24 -26
- package/build/lib/subcommands/ui.js.map +1 -1
- package/build/lib/subcommands/uninstall.d.ts +13 -16
- package/build/lib/subcommands/uninstall.d.ts.map +1 -1
- package/build/lib/subcommands/uninstall.js +4 -6
- package/build/lib/subcommands/uninstall.js.map +1 -1
- package/build/lib/types.d.ts +231 -0
- package/build/lib/types.d.ts.map +1 -0
- package/build/lib/types.js +3 -0
- package/build/lib/types.js.map +1 -0
- package/index.ts +13 -0
- package/lib/helpers.ts +81 -0
- package/lib/{logger.js → logger.ts} +2 -5
- package/lib/simctl.ts +221 -0
- package/lib/subcommands/{addmedia.js → addmedia.ts} +6 -8
- package/lib/subcommands/appinfo.ts +39 -0
- package/lib/subcommands/{boot.js → boot.ts} +5 -10
- package/lib/subcommands/bootstatus.ts +108 -0
- package/lib/subcommands/{create.js → create.ts} +29 -35
- package/lib/subcommands/{delete.js → delete.ts} +3 -5
- package/lib/subcommands/{erase.js → erase.ts} +4 -7
- package/lib/subcommands/{get_app_container.js → get_app_container.ts} +10 -8
- package/lib/subcommands/{getenv.js → getenv.ts} +5 -7
- package/lib/subcommands/{install.js → install.ts} +4 -6
- package/lib/subcommands/{io.js → io.ts} +4 -7
- package/lib/subcommands/{keychain.js → keychain.ts} +30 -32
- package/lib/subcommands/{launch.js → launch.ts} +9 -12
- package/lib/subcommands/{list.js → list.ts} +67 -60
- package/lib/subcommands/{location.js → location.ts} +15 -14
- package/lib/subcommands/{openurl.js → openurl.ts} +6 -7
- package/lib/subcommands/{pbcopy.js → pbcopy.ts} +11 -8
- package/lib/subcommands/{pbpaste.js → pbpaste.ts} +5 -7
- package/lib/subcommands/{privacy.js → privacy.ts} +13 -17
- package/lib/subcommands/{push.js → push.ts} +5 -8
- package/lib/subcommands/{shutdown.js → shutdown.ts} +5 -8
- package/lib/subcommands/{spawn.js → spawn.ts} +21 -17
- package/lib/subcommands/{terminate.js → terminate.ts} +4 -6
- package/lib/subcommands/{ui.js → ui.ts} +19 -28
- package/lib/subcommands/{uninstall.js → uninstall.ts} +4 -6
- package/lib/types.ts +243 -0
- package/package.json +3 -3
- package/index.js +0 -4
- package/lib/helpers.js +0 -37
- package/lib/simctl.js +0 -299
- package/lib/subcommands/appinfo.js +0 -51
- package/lib/subcommands/bootstatus.js +0 -119
|
@@ -3,32 +3,30 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.launchApp = launchApp;
|
|
6
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
7
8
|
const asyncbox_1 = require("asyncbox");
|
|
8
|
-
const commands = {};
|
|
9
9
|
/**
|
|
10
10
|
* Execute the particular application package on Simulator.
|
|
11
11
|
* It is required that Simulator is in _booted_ state and
|
|
12
12
|
* the application with given bundle identifier is already installed.
|
|
13
13
|
*
|
|
14
|
-
* @
|
|
15
|
-
* @param {string} bundleId - Bundle identifier of the application,
|
|
14
|
+
* @param bundleId - Bundle identifier of the application,
|
|
16
15
|
* which is going to be removed.
|
|
17
|
-
* @param
|
|
16
|
+
* @param tries - The maximum number of retries before
|
|
18
17
|
* throwing an exception.
|
|
19
|
-
* @return
|
|
18
|
+
* @return the actual command output
|
|
20
19
|
* @throws {Error} If the corresponding simctl subcommand command
|
|
21
20
|
* returns non-zero return code.
|
|
22
21
|
* @throws {Error} If the `udid` instance property is unset
|
|
23
22
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return await (0, asyncbox_1.retryInterval)(tries, 1000, async () => {
|
|
23
|
+
async function launchApp(bundleId, tries = 5) {
|
|
24
|
+
const result = await (0, asyncbox_1.retryInterval)(tries, 1000, async () => {
|
|
27
25
|
const { stdout } = await this.exec('launch', {
|
|
28
26
|
args: [this.requireUdid('launch'), bundleId],
|
|
29
27
|
});
|
|
30
|
-
return lodash_1.default.trim(stdout);
|
|
28
|
+
return lodash_1.default.trim(stdout) || '';
|
|
31
29
|
});
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
return result || '';
|
|
31
|
+
}
|
|
34
32
|
//# sourceMappingURL=launch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launch.js","sourceRoot":"","sources":["../../../lib/subcommands/launch.
|
|
1
|
+
{"version":3,"file":"launch.js","sourceRoot":"","sources":["../../../lib/subcommands/launch.ts"],"names":[],"mappings":";;;;;AAkBA,8BAQC;AA1BD,oDAAuB;AACvB,uCAAyC;AAGzC;;;;;;;;;;;;;GAaG;AACI,KAAK,UAAU,SAAS,CAAgB,QAAgB,EAAE,QAAgB,CAAC;IAChF,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAa,EAAC,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,gBAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAC9B,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,IAAI,EAAE,CAAC;AACtB,CAAC"}
|
|
@@ -1,126 +1,95 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
* {
|
|
96
|
-
* "devicetypes" : [
|
|
97
|
-
* {
|
|
98
|
-
* "name" : "iPhone 4s",
|
|
99
|
-
* "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-4s"
|
|
100
|
-
* },
|
|
101
|
-
* ...
|
|
102
|
-
* ],
|
|
103
|
-
* "runtimes" : [
|
|
104
|
-
* {
|
|
105
|
-
* "version" : '13.0',
|
|
106
|
-
* "bundlePath" : '/Applications/Xcode11beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime',
|
|
107
|
-
* "isAvailable" : true,
|
|
108
|
-
* "name" : 'iOS 13.0',
|
|
109
|
-
* "identifier" : 'com.apple.CoreSimulator.SimRuntime.iOS-13-0',
|
|
110
|
-
* "buildversion" : '17A5534d'
|
|
111
|
-
* },
|
|
112
|
-
* ...
|
|
113
|
-
* },
|
|
114
|
-
* "devices" :
|
|
115
|
-
* {
|
|
116
|
-
* 'com.apple.CoreSimulator.SimRuntime.iOS-13-0': [ [Object], [Object] ] },
|
|
117
|
-
* ...
|
|
118
|
-
* },
|
|
119
|
-
* "pairs" : {} }
|
|
120
|
-
*
|
|
121
|
-
* }
|
|
122
|
-
* @throws {Error} If the corresponding simctl command fails
|
|
123
|
-
*/
|
|
124
|
-
function list(this: import("../simctl").default): Promise<any>;
|
|
125
|
-
}
|
|
1
|
+
import type { Simctl } from '../simctl';
|
|
2
|
+
import type { DeviceInfo } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Parse the list of existing Simulator devices to represent
|
|
5
|
+
* it as convenient mapping.
|
|
6
|
+
*
|
|
7
|
+
* @param platform - The platform name, for example 'watchOS'.
|
|
8
|
+
* @return The resulting mapping. Each key is platform version,
|
|
9
|
+
* for example '10.3' and the corresponding value is an
|
|
10
|
+
* array of the matching DeviceInfo instances.
|
|
11
|
+
* @throws {Error} If the corresponding simctl subcommand command
|
|
12
|
+
* returns non-zero return code.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getDevicesByParsing(this: Simctl, platform?: string | null): Promise<Record<string, DeviceInfo[]>>;
|
|
15
|
+
/**
|
|
16
|
+
* Parse the list of existing Simulator devices to represent
|
|
17
|
+
* it as convenient mapping for the particular platform version.
|
|
18
|
+
*
|
|
19
|
+
* @param forSdk - The sdk version,
|
|
20
|
+
* for which the devices list should be parsed,
|
|
21
|
+
* for example '10.3'.
|
|
22
|
+
* @param platform - The platform name, for example 'watchOS'.
|
|
23
|
+
* @return If _forSdk_ is set then the list
|
|
24
|
+
* of devices for the particular platform version.
|
|
25
|
+
* Otherwise the same result as for getDevicesByParsing
|
|
26
|
+
* function.
|
|
27
|
+
* @throws {Error} If the corresponding simctl subcommand command
|
|
28
|
+
* returns non-zero return code or if no matching
|
|
29
|
+
* platform version is found in the system.
|
|
30
|
+
*/
|
|
31
|
+
export declare function getDevices(this: Simctl, forSdk: string, platform?: string | null): Promise<DeviceInfo[]>;
|
|
32
|
+
export declare function getDevices(this: Simctl, forSdk?: undefined | null, platform?: string | null): Promise<Record<string, DeviceInfo[]>>;
|
|
33
|
+
/**
|
|
34
|
+
* Get the runtime for the particular platform version using --json flag
|
|
35
|
+
*
|
|
36
|
+
* @param platformVersion - The platform version name,
|
|
37
|
+
* for example '10.3'.
|
|
38
|
+
* @param platform - The platform name, for example 'watchOS'.
|
|
39
|
+
* @return The corresponding runtime name for the given
|
|
40
|
+
* platform version.
|
|
41
|
+
*/
|
|
42
|
+
export declare function getRuntimeForPlatformVersionViaJson(this: Simctl, platformVersion: string, platform?: string): Promise<string>;
|
|
43
|
+
/**
|
|
44
|
+
* Get the runtime for the particular platform version.
|
|
45
|
+
*
|
|
46
|
+
* @param platformVersion - The platform version name,
|
|
47
|
+
* for example '10.3'.
|
|
48
|
+
* @param platform - The platform name, for example 'watchOS'.
|
|
49
|
+
* @return The corresponding runtime name for the given
|
|
50
|
+
* platform version.
|
|
51
|
+
*/
|
|
52
|
+
export declare function getRuntimeForPlatformVersion(this: Simctl, platformVersion: string, platform?: string): Promise<string>;
|
|
53
|
+
/**
|
|
54
|
+
* Get the list of device types available in the current Xcode installation
|
|
55
|
+
*
|
|
56
|
+
* @return List of the types of devices available
|
|
57
|
+
* @throws {Error} If the corresponding simctl command fails
|
|
58
|
+
*/
|
|
59
|
+
export declare function getDeviceTypes(this: Simctl): Promise<string[]>;
|
|
60
|
+
/**
|
|
61
|
+
* Get the full list of runtimes, devicetypes, devices and pairs as Object
|
|
62
|
+
*
|
|
63
|
+
* @return Object containing device types, runtimes devices and pairs.
|
|
64
|
+
* The resulting JSON will be like:
|
|
65
|
+
* {
|
|
66
|
+
* "devicetypes" : [
|
|
67
|
+
* {
|
|
68
|
+
* "name" : "iPhone 4s",
|
|
69
|
+
* "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-4s"
|
|
70
|
+
* },
|
|
71
|
+
* ...
|
|
72
|
+
* ],
|
|
73
|
+
* "runtimes" : [
|
|
74
|
+
* {
|
|
75
|
+
* "version" : '13.0',
|
|
76
|
+
* "bundlePath" : '/Applications/Xcode11beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime',
|
|
77
|
+
* "isAvailable" : true,
|
|
78
|
+
* "name" : 'iOS 13.0',
|
|
79
|
+
* "identifier" : 'com.apple.CoreSimulator.SimRuntime.iOS-13-0',
|
|
80
|
+
* "buildversion" : '17A5534d'
|
|
81
|
+
* },
|
|
82
|
+
* ...
|
|
83
|
+
* },
|
|
84
|
+
* "devices" :
|
|
85
|
+
* {
|
|
86
|
+
* 'com.apple.CoreSimulator.SimRuntime.iOS-13-0': [ [Object], [Object] ] },
|
|
87
|
+
* ...
|
|
88
|
+
* },
|
|
89
|
+
* "pairs" : {} }
|
|
90
|
+
*
|
|
91
|
+
* }
|
|
92
|
+
* @throws {Error} If the corresponding simctl command fails
|
|
93
|
+
*/
|
|
94
|
+
export declare function list(this: Simctl): Promise<any>;
|
|
126
95
|
//# sourceMappingURL=list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/list.
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/list.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GACvB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC,CA2DvC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GACvB,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;AACzB,wBAAsB,UAAU,CAC9B,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,EACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GACvB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;AA0EzC;;;;;;;;GAQG;AACH,wBAAsB,mCAAmC,CACvD,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,EACvB,QAAQ,GAAE,MAAc,GACvB,OAAO,CAAC,MAAM,CAAC,CAWjB;AAED;;;;;;;;GAQG;AACH,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,EACvB,QAAQ,GAAE,MAAc,GACvB,OAAO,CAAC,MAAM,CAAC,CAmBjB;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAqBrE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAsB,IAAI,CAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAStD"}
|
|
@@ -1,65 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
4
|
};
|
|
38
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getDevicesByParsing = getDevicesByParsing;
|
|
7
|
+
exports.getDevices = getDevices;
|
|
8
|
+
exports.getRuntimeForPlatformVersionViaJson = getRuntimeForPlatformVersionViaJson;
|
|
9
|
+
exports.getRuntimeForPlatformVersion = getRuntimeForPlatformVersion;
|
|
10
|
+
exports.getDeviceTypes = getDeviceTypes;
|
|
11
|
+
exports.list = list;
|
|
39
12
|
const lodash_1 = __importDefault(require("lodash"));
|
|
40
13
|
const helpers_1 = require("../helpers");
|
|
41
|
-
const logger_1 =
|
|
42
|
-
const commands = {};
|
|
43
|
-
/**
|
|
44
|
-
* @typedef {Object} DeviceInfo
|
|
45
|
-
* @property {string} name - The device name.
|
|
46
|
-
* @property {string} udid - The device UDID.
|
|
47
|
-
* @property {string} state - The current Simulator state, for example 'booted' or 'shutdown'.
|
|
48
|
-
* @property {string} sdk - The SDK version, for example '10.3'.
|
|
49
|
-
*/
|
|
14
|
+
const logger_1 = require("../logger");
|
|
50
15
|
/**
|
|
51
16
|
* Parse the list of existing Simulator devices to represent
|
|
52
17
|
* it as convenient mapping.
|
|
53
18
|
*
|
|
54
|
-
* @
|
|
55
|
-
* @
|
|
56
|
-
* @return {Promise<Record<string, any>>} The resulting mapping. Each key is platform version,
|
|
19
|
+
* @param platform - The platform name, for example 'watchOS'.
|
|
20
|
+
* @return The resulting mapping. Each key is platform version,
|
|
57
21
|
* for example '10.3' and the corresponding value is an
|
|
58
|
-
* array of the matching
|
|
22
|
+
* array of the matching DeviceInfo instances.
|
|
59
23
|
* @throws {Error} If the corresponding simctl subcommand command
|
|
60
24
|
* returns non-zero return code.
|
|
61
25
|
*/
|
|
62
|
-
|
|
26
|
+
async function getDevicesByParsing(platform) {
|
|
63
27
|
const { stdout } = await this.exec('list', {
|
|
64
28
|
args: ['devices'],
|
|
65
29
|
});
|
|
@@ -116,25 +80,8 @@ commands.getDevicesByParsing = async function getDevicesByParsing(platform) {
|
|
|
116
80
|
}
|
|
117
81
|
}
|
|
118
82
|
return devices;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
* Parse the list of existing Simulator devices to represent
|
|
122
|
-
* it as convenient mapping for the particular platform version.
|
|
123
|
-
*
|
|
124
|
-
* @this {import('../simctl').Simctl}
|
|
125
|
-
* @param {string?} [forSdk] - The sdk version,
|
|
126
|
-
* for which the devices list should be parsed,
|
|
127
|
-
* for example '10.3'.
|
|
128
|
-
* @param {string?} [platform] - The platform name, for example 'watchOS'.
|
|
129
|
-
* @return {Promise<Object|DeviceInfo[]>} If _forSdk_ is set then the list
|
|
130
|
-
* of devices for the particular platform version.
|
|
131
|
-
* Otherwise the same result as for {@link getDevicesByParsing}
|
|
132
|
-
* function.
|
|
133
|
-
* @throws {Error} If the corresponding simctl subcommand command
|
|
134
|
-
* returns non-zero return code or if no matching
|
|
135
|
-
* platform version is found in the system.
|
|
136
|
-
*/
|
|
137
|
-
commands.getDevices = async function getDevices(forSdk, platform) {
|
|
83
|
+
}
|
|
84
|
+
async function getDevices(forSdk, platform) {
|
|
138
85
|
let devices = {};
|
|
139
86
|
try {
|
|
140
87
|
const { stdout } = await this.exec('list', {
|
|
@@ -159,9 +106,9 @@ commands.getDevices = async function getDevices(forSdk, platform) {
|
|
|
159
106
|
const versionMatchRe = lodash_1.default.isEmpty(platform) || !platform
|
|
160
107
|
? new RegExp(`^([^\\s-]+)[\\s-](\\S+)`, 'i')
|
|
161
108
|
: new RegExp(`^${lodash_1.default.escapeRegExp(platform)}[\\s-](\\S+)`, 'i');
|
|
162
|
-
for (
|
|
109
|
+
for (const [sdkNameRaw, entries] of lodash_1.default.toPairs(JSON.parse(stdout).devices)) {
|
|
163
110
|
// there could be a longer name, so remove it
|
|
164
|
-
sdkName =
|
|
111
|
+
const sdkName = sdkNameRaw.replace(helpers_1.SIM_RUNTIME_NAME, '');
|
|
165
112
|
const versionMatch = versionMatchRe.exec(sdkName);
|
|
166
113
|
if (!versionMatch) {
|
|
167
114
|
continue;
|
|
@@ -181,8 +128,8 @@ commands.getDevices = async function getDevices(forSdk, platform) {
|
|
|
181
128
|
}
|
|
182
129
|
}
|
|
183
130
|
catch (err) {
|
|
184
|
-
logger_1.
|
|
185
|
-
logger_1.
|
|
131
|
+
logger_1.log.debug(logger_1.LOG_PREFIX, `Unable to get JSON device list: ${err.stack}`);
|
|
132
|
+
logger_1.log.debug(logger_1.LOG_PREFIX, 'Falling back to manual parsing');
|
|
186
133
|
devices = await this.getDevicesByParsing(platform);
|
|
187
134
|
}
|
|
188
135
|
if (!forSdk) {
|
|
@@ -198,18 +145,17 @@ commands.getDevices = async function getDevices(forSdk, platform) {
|
|
|
198
145
|
? ` Only the following Simulator SDK versions are available on your system: ${availableSDKs.join(', ')}`
|
|
199
146
|
: ` No Simulator SDK versions are available on your system. Please install some via Xcode preferences.`;
|
|
200
147
|
throw new Error(errMsg);
|
|
201
|
-
}
|
|
148
|
+
}
|
|
202
149
|
/**
|
|
203
150
|
* Get the runtime for the particular platform version using --json flag
|
|
204
151
|
*
|
|
205
|
-
* @
|
|
206
|
-
* @param {string} platformVersion - The platform version name,
|
|
152
|
+
* @param platformVersion - The platform version name,
|
|
207
153
|
* for example '10.3'.
|
|
208
|
-
* @param
|
|
209
|
-
* @return
|
|
154
|
+
* @param platform - The platform name, for example 'watchOS'.
|
|
155
|
+
* @return The corresponding runtime name for the given
|
|
210
156
|
* platform version.
|
|
211
157
|
*/
|
|
212
|
-
|
|
158
|
+
async function getRuntimeForPlatformVersionViaJson(platformVersion, platform = 'iOS') {
|
|
213
159
|
const { stdout } = await this.exec('list', {
|
|
214
160
|
args: ['runtimes', '--json'],
|
|
215
161
|
});
|
|
@@ -220,18 +166,17 @@ commands.getRuntimeForPlatformVersionViaJson = async function getRuntimeForPlatf
|
|
|
220
166
|
}
|
|
221
167
|
}
|
|
222
168
|
throw new Error(`Could not use --json flag to parse platform version`);
|
|
223
|
-
}
|
|
169
|
+
}
|
|
224
170
|
/**
|
|
225
171
|
* Get the runtime for the particular platform version.
|
|
226
172
|
*
|
|
227
|
-
* @
|
|
228
|
-
* @param {string} platformVersion - The platform version name,
|
|
173
|
+
* @param platformVersion - The platform version name,
|
|
229
174
|
* for example '10.3'.
|
|
230
|
-
* @param
|
|
231
|
-
* @return
|
|
175
|
+
* @param platform - The platform name, for example 'watchOS'.
|
|
176
|
+
* @return The corresponding runtime name for the given
|
|
232
177
|
* platform version.
|
|
233
178
|
*/
|
|
234
|
-
|
|
179
|
+
async function getRuntimeForPlatformVersion(platformVersion, platform = 'iOS') {
|
|
235
180
|
// Try with parsing
|
|
236
181
|
try {
|
|
237
182
|
const { stdout } = await this.exec('list', {
|
|
@@ -249,15 +194,14 @@ commands.getRuntimeForPlatformVersion = async function getRuntimeForPlatformVers
|
|
|
249
194
|
catch { }
|
|
250
195
|
// if nothing was found, pass platform version back
|
|
251
196
|
return platformVersion;
|
|
252
|
-
}
|
|
197
|
+
}
|
|
253
198
|
/**
|
|
254
199
|
* Get the list of device types available in the current Xcode installation
|
|
255
200
|
*
|
|
256
|
-
* @
|
|
257
|
-
* @return {Promise<string[]>} List of the types of devices available
|
|
201
|
+
* @return List of the types of devices available
|
|
258
202
|
* @throws {Error} If the corresponding simctl command fails
|
|
259
203
|
*/
|
|
260
|
-
|
|
204
|
+
async function getDeviceTypes() {
|
|
261
205
|
const { stdout } = await this.exec('list', {
|
|
262
206
|
args: ['devicetypes', '-j'],
|
|
263
207
|
});
|
|
@@ -279,12 +223,11 @@ commands.getDeviceTypes = async function getDeviceTypes() {
|
|
|
279
223
|
catch (err) {
|
|
280
224
|
throw new Error(`Unable to get list of device types: ${err.message}`);
|
|
281
225
|
}
|
|
282
|
-
}
|
|
226
|
+
}
|
|
283
227
|
/**
|
|
284
228
|
* Get the full list of runtimes, devicetypes, devices and pairs as Object
|
|
285
229
|
*
|
|
286
|
-
* @
|
|
287
|
-
* @return {Promise<Object>} Object containing device types, runtimes devices and pairs.
|
|
230
|
+
* @return Object containing device types, runtimes devices and pairs.
|
|
288
231
|
* The resulting JSON will be like:
|
|
289
232
|
* {
|
|
290
233
|
* "devicetypes" : [
|
|
@@ -315,7 +258,7 @@ commands.getDeviceTypes = async function getDeviceTypes() {
|
|
|
315
258
|
* }
|
|
316
259
|
* @throws {Error} If the corresponding simctl command fails
|
|
317
260
|
*/
|
|
318
|
-
|
|
261
|
+
async function list() {
|
|
319
262
|
const { stdout } = await this.exec('list', {
|
|
320
263
|
args: ['-j'],
|
|
321
264
|
});
|
|
@@ -325,6 +268,5 @@ commands.list = async function list() {
|
|
|
325
268
|
catch (e) {
|
|
326
269
|
throw new Error(`Unable to parse simctl list: ${e.message}`);
|
|
327
270
|
}
|
|
328
|
-
}
|
|
329
|
-
exports.default = commands;
|
|
271
|
+
}
|
|
330
272
|
//# sourceMappingURL=list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../lib/subcommands/list.
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../lib/subcommands/list.ts"],"names":[],"mappings":";;;;;AAiBA,kDA8DC;AA4BD,gCAuEC;AAWD,kFAeC;AAWD,oEAuBC;AAQD,wCAqBC;AAoCD,oBASC;AAxTD,oDAAuB;AACvB,wCAAgE;AAChE,sCAA4C;AAI5C;;;;;;;;;;GAUG;AACI,KAAK,UAAU,mBAAmB,CAEvC,QAAwB;IAExB,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;QACvC,IAAI,EAAE,CAAC,SAAS,CAAC;KAClB,CAAC,CAAC;IAEH,+BAA+B;IAC/B,gBAAgB;IAChB,kEAAkE;IAClE,UAAU;IACV,gBAAgB;IAChB,kEAAkE;IAClE,UAAU;IACV,yDAAyD;IACzD,iEAAiE;IACjE,MAAM,eAAe,GAAG,gBAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ;QACtD,CAAC,CAAC,IAAI,MAAM,CAAC,oDAAoD,EAAE,KAAK,CAAC;QACzE,CAAC,CAAC,IAAI,MAAM,CAAC,aAAa,gBAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;IACjG,MAAM,OAAO,GAAsB,EAAE,CAAC;IACtC,IAAI,KAA6B,CAAC;IAClC,qCAAqC;IACrC,OAAO,CAAC,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;QAC9C,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IACD,IAAI,gBAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACnD,CAAC;IAED,MAAM,MAAM,GAAG,2CAA2C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Simctl}
|
|
20
|
-
*/
|
|
21
|
-
function clearLocation(this: import("../simctl").default): Promise<void>;
|
|
22
|
-
}
|
|
1
|
+
import type { Simctl } from '../simctl';
|
|
2
|
+
/**
|
|
3
|
+
* Set the Simulator location to a specific latitude and longitude.
|
|
4
|
+
* This functionality is only available since Xcode 14.
|
|
5
|
+
*
|
|
6
|
+
* @param latitude Location latitude value
|
|
7
|
+
* @param longitude Location longitude value
|
|
8
|
+
* @throws {Error} If the corresponding simctl subcommand command
|
|
9
|
+
* returns non-zero return code.
|
|
10
|
+
* @throws {TypeError} If any of the arguments is not a valid value.
|
|
11
|
+
*/
|
|
12
|
+
export declare function setLocation(this: Simctl, latitude: string | number, longitude: string | number): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Stop any running scenario and clear any simulated location.
|
|
15
|
+
*
|
|
16
|
+
* @since Xcode 14.
|
|
17
|
+
*/
|
|
18
|
+
export declare function clearLocation(this: Simctl): Promise<void>;
|
|
23
19
|
//# sourceMappingURL=location.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/location.
|
|
1
|
+
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/location.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAiBxC;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GAAG,MAAM,EACzB,SAAS,EAAE,MAAM,GAAG,MAAM,GACzB,OAAO,CAAC,IAAI,CAAC,CAMf;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIhE"}
|