node-simctl 7.3.4 → 7.3.6
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 +15 -0
- package/build/lib/simctl.d.ts +46 -1
- package/build/lib/simctl.d.ts.map +1 -1
- package/build/lib/simctl.js +69 -5
- package/build/lib/simctl.js.map +1 -1
- package/build/lib/subcommands/addmedia.d.ts +2 -1
- package/build/lib/subcommands/addmedia.d.ts.map +1 -1
- package/build/lib/subcommands/addmedia.js +3 -0
- package/build/lib/subcommands/addmedia.js.map +1 -1
- package/build/lib/subcommands/appinfo.d.ts +2 -1
- package/build/lib/subcommands/appinfo.d.ts.map +1 -1
- package/build/lib/subcommands/appinfo.js +3 -0
- package/build/lib/subcommands/appinfo.js.map +1 -1
- package/build/lib/subcommands/boot.d.ts +2 -1
- package/build/lib/subcommands/boot.d.ts.map +1 -1
- package/build/lib/subcommands/boot.js +1 -0
- package/build/lib/subcommands/boot.js.map +1 -1
- package/build/lib/subcommands/bootstatus.d.ts +2 -1
- package/build/lib/subcommands/bootstatus.d.ts.map +1 -1
- package/build/lib/subcommands/bootstatus.js +3 -0
- package/build/lib/subcommands/bootstatus.js.map +1 -1
- package/build/lib/subcommands/create.d.ts +2 -1
- package/build/lib/subcommands/create.d.ts.map +1 -1
- package/build/lib/subcommands/create.js +3 -0
- package/build/lib/subcommands/create.js.map +1 -1
- package/build/lib/subcommands/delete.d.ts +2 -1
- package/build/lib/subcommands/delete.d.ts.map +1 -1
- package/build/lib/subcommands/delete.js +1 -0
- package/build/lib/subcommands/delete.js.map +1 -1
- package/build/lib/subcommands/erase.d.ts +2 -1
- package/build/lib/subcommands/erase.d.ts.map +1 -1
- package/build/lib/subcommands/erase.js +1 -0
- package/build/lib/subcommands/erase.js.map +1 -1
- package/build/lib/subcommands/get_app_container.d.ts +2 -1
- package/build/lib/subcommands/get_app_container.d.ts.map +1 -1
- package/build/lib/subcommands/get_app_container.js +2 -0
- package/build/lib/subcommands/get_app_container.js.map +1 -1
- package/build/lib/subcommands/getenv.d.ts +2 -1
- package/build/lib/subcommands/getenv.d.ts.map +1 -1
- package/build/lib/subcommands/getenv.js +3 -0
- package/build/lib/subcommands/getenv.js.map +1 -1
- package/build/lib/subcommands/install.d.ts +2 -1
- package/build/lib/subcommands/install.d.ts.map +1 -1
- package/build/lib/subcommands/install.js +1 -0
- package/build/lib/subcommands/install.js.map +1 -1
- package/build/lib/subcommands/io.d.ts +2 -1
- package/build/lib/subcommands/io.d.ts.map +1 -1
- package/build/lib/subcommands/io.js +1 -0
- package/build/lib/subcommands/io.js.map +1 -1
- package/build/lib/subcommands/keychain.d.ts +6 -3
- package/build/lib/subcommands/keychain.d.ts.map +1 -1
- package/build/lib/subcommands/keychain.js +9 -1
- package/build/lib/subcommands/keychain.js.map +1 -1
- package/build/lib/subcommands/launch.d.ts +2 -1
- package/build/lib/subcommands/launch.d.ts.map +1 -1
- package/build/lib/subcommands/launch.js +3 -0
- package/build/lib/subcommands/launch.js.map +1 -1
- package/build/lib/subcommands/list.d.ts +12 -6
- package/build/lib/subcommands/list.d.ts.map +1 -1
- package/build/lib/subcommands/list.js +18 -1
- package/build/lib/subcommands/list.js.map +1 -1
- package/build/lib/subcommands/location.d.ts +6 -3
- package/build/lib/subcommands/location.d.ts.map +1 -1
- package/build/lib/subcommands/location.js +4 -1
- package/build/lib/subcommands/location.js.map +1 -1
- package/build/lib/subcommands/openurl.d.ts +2 -1
- package/build/lib/subcommands/openurl.d.ts.map +1 -1
- package/build/lib/subcommands/openurl.js +3 -0
- package/build/lib/subcommands/openurl.js.map +1 -1
- package/build/lib/subcommands/pbcopy.d.ts +4 -3
- package/build/lib/subcommands/pbcopy.d.ts.map +1 -1
- package/build/lib/subcommands/pbcopy.js +11 -6
- package/build/lib/subcommands/pbcopy.js.map +1 -1
- package/build/lib/subcommands/pbpaste.d.ts +2 -1
- package/build/lib/subcommands/pbpaste.d.ts.map +1 -1
- package/build/lib/subcommands/pbpaste.js +3 -0
- package/build/lib/subcommands/pbpaste.js.map +1 -1
- package/build/lib/subcommands/privacy.d.ts +6 -3
- package/build/lib/subcommands/privacy.d.ts.map +1 -1
- package/build/lib/subcommands/privacy.js +3 -0
- package/build/lib/subcommands/privacy.js.map +1 -1
- package/build/lib/subcommands/push.d.ts +2 -1
- package/build/lib/subcommands/push.d.ts.map +1 -1
- package/build/lib/subcommands/push.js +1 -0
- package/build/lib/subcommands/push.js.map +1 -1
- package/build/lib/subcommands/shutdown.d.ts +2 -1
- package/build/lib/subcommands/shutdown.d.ts.map +1 -1
- package/build/lib/subcommands/shutdown.js +1 -0
- package/build/lib/subcommands/shutdown.js.map +1 -1
- package/build/lib/subcommands/spawn.d.ts +4 -2
- package/build/lib/subcommands/spawn.d.ts.map +1 -1
- package/build/lib/subcommands/spawn.js +6 -0
- package/build/lib/subcommands/spawn.js.map +1 -1
- package/build/lib/subcommands/terminate.d.ts +2 -1
- package/build/lib/subcommands/terminate.d.ts.map +1 -1
- package/build/lib/subcommands/terminate.js +1 -0
- package/build/lib/subcommands/terminate.js.map +1 -1
- package/build/lib/subcommands/ui.d.ts +4 -2
- package/build/lib/subcommands/ui.d.ts.map +1 -1
- package/build/lib/subcommands/ui.js +4 -0
- package/build/lib/subcommands/ui.js.map +1 -1
- package/build/lib/subcommands/uninstall.d.ts +2 -1
- package/build/lib/subcommands/uninstall.d.ts.map +1 -1
- package/build/lib/subcommands/uninstall.js +1 -0
- package/build/lib/subcommands/uninstall.js.map +1 -1
- package/lib/simctl.js +92 -5
- package/lib/subcommands/addmedia.js +3 -0
- package/lib/subcommands/appinfo.js +3 -0
- package/lib/subcommands/boot.js +1 -0
- package/lib/subcommands/bootstatus.js +3 -0
- package/lib/subcommands/create.js +3 -0
- package/lib/subcommands/delete.js +1 -0
- package/lib/subcommands/erase.js +1 -0
- package/lib/subcommands/get_app_container.js +2 -0
- package/lib/subcommands/getenv.js +3 -0
- package/lib/subcommands/install.js +1 -0
- package/lib/subcommands/io.js +1 -0
- package/lib/subcommands/keychain.js +9 -1
- package/lib/subcommands/launch.js +3 -0
- package/lib/subcommands/list.js +18 -1
- package/lib/subcommands/location.js +4 -1
- package/lib/subcommands/openurl.js +3 -0
- package/lib/subcommands/pbcopy.js +11 -6
- package/lib/subcommands/pbpaste.js +3 -0
- package/lib/subcommands/privacy.js +3 -0
- package/lib/subcommands/push.js +1 -0
- package/lib/subcommands/shutdown.js +1 -0
- package/lib/subcommands/spawn.js +6 -0
- package/lib/subcommands/terminate.js +1 -0
- package/lib/subcommands/ui.js +4 -0
- package/lib/subcommands/uninstall.js +1 -0
- package/package.json +3 -3
- package/build/lib/subcommands/index.d.ts +0 -3
- package/build/lib/subcommands/index.d.ts.map +0 -1
- package/build/lib/subcommands/index.js +0 -34
- package/build/lib/subcommands/index.js.map +0 -1
- package/lib/subcommands/index.js +0 -56
|
@@ -5,6 +5,7 @@ declare namespace commands {
|
|
|
5
5
|
* It is required that Simulator is in _booted_ state.
|
|
6
6
|
*
|
|
7
7
|
* @since Xcode 8.1 SDK
|
|
8
|
+
* @this {import('../simctl').Simctl}
|
|
8
9
|
* @param {string} [encoding='utf8'] - The encoding of the returned pasteboard content.
|
|
9
10
|
* UTF-8 by default.
|
|
10
11
|
* @return {Promise<string>} Current content of Simulator pasteboard or an empty string.
|
|
@@ -12,6 +13,6 @@ declare namespace commands {
|
|
|
12
13
|
* returns non-zero return code.
|
|
13
14
|
* @throws {Error} If the `udid` instance property is unset
|
|
14
15
|
*/
|
|
15
|
-
function getPasteboard(encoding?: string | undefined): Promise<string>;
|
|
16
|
+
function getPasteboard(this: import("../simctl").default, encoding?: string | undefined): Promise<string>;
|
|
16
17
|
}
|
|
17
18
|
//# sourceMappingURL=pbpaste.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pbpaste.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/pbpaste.js"],"names":[],"mappings":";;IAEA
|
|
1
|
+
{"version":3,"file":"pbpaste.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/pbpaste.js"],"names":[],"mappings":";;IAEA;;;;;;;;;;;;OAYG;IACH,0GAQC"}
|
|
@@ -6,6 +6,7 @@ const commands = {};
|
|
|
6
6
|
* It is required that Simulator is in _booted_ state.
|
|
7
7
|
*
|
|
8
8
|
* @since Xcode 8.1 SDK
|
|
9
|
+
* @this {import('../simctl').Simctl}
|
|
9
10
|
* @param {string} [encoding='utf8'] - The encoding of the returned pasteboard content.
|
|
10
11
|
* UTF-8 by default.
|
|
11
12
|
* @return {Promise<string>} Current content of Simulator pasteboard or an empty string.
|
|
@@ -14,6 +15,8 @@ const commands = {};
|
|
|
14
15
|
* @throws {Error} If the `udid` instance property is unset
|
|
15
16
|
*/
|
|
16
17
|
commands.getPasteboard = async function getPasteboard(encoding = 'utf8') {
|
|
18
|
+
/** @type {import('teen_process').TeenProcessExecResult} */
|
|
19
|
+
// @ts-ignore The returned type is ok
|
|
17
20
|
const { stdout } = await this.exec('pbpaste', {
|
|
18
21
|
args: [this.requireUdid('pbpaste')],
|
|
19
22
|
encoding,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pbpaste.js","sourceRoot":"","sources":["../../../lib/subcommands/pbpaste.js"],"names":[],"mappings":";;AAAA,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB
|
|
1
|
+
{"version":3,"file":"pbpaste.js","sourceRoot":"","sources":["../../../lib/subcommands/pbpaste.js"],"names":[],"mappings":";;AAAA,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB;;;;;;;;;;;;GAYG;AACH,QAAQ,CAAC,aAAa,GAAG,KAAK,UAAU,aAAa,CAAE,QAAQ,GAAG,MAAM;IACtE,2DAA2D;IAC3D,qCAAqC;IACrC,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;QAC1C,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QACnC,QAAQ;KACT,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
|
|
@@ -4,6 +4,7 @@ declare namespace commands {
|
|
|
4
4
|
* Grants the given permission on the app with the given bundle identifier
|
|
5
5
|
*
|
|
6
6
|
* @since Xcode 11.4 SDK
|
|
7
|
+
* @this {import('../simctl').Simctl}
|
|
7
8
|
* @param {string} bundleId the identifier of the application whose
|
|
8
9
|
* privacy settings are going to be changed
|
|
9
10
|
* @param {string} perm one of possible permission values:
|
|
@@ -24,12 +25,13 @@ declare namespace commands {
|
|
|
24
25
|
* or there was an error while granting the permission
|
|
25
26
|
* @throws {Error} If the `udid` instance property is unset
|
|
26
27
|
*/
|
|
27
|
-
function grantPermission(bundleId: string, perm: string): Promise<void>;
|
|
28
|
+
function grantPermission(this: import("../simctl").default, bundleId: string, perm: string): Promise<void>;
|
|
28
29
|
/**
|
|
29
30
|
* Revokes the given permission on the app with the given bundle identifier
|
|
30
31
|
* after it has been granted
|
|
31
32
|
*
|
|
32
33
|
* @since Xcode 11.4 SDK
|
|
34
|
+
* @this {import('../simctl').Simctl}
|
|
33
35
|
* @param {string} bundleId the identifier of the application whose
|
|
34
36
|
* privacy settings are going to be changed
|
|
35
37
|
* @param {string} perm one of possible permission values (see `grantPermission`)
|
|
@@ -37,12 +39,13 @@ declare namespace commands {
|
|
|
37
39
|
* or there was an error while revoking the permission
|
|
38
40
|
* @throws {Error} If the `udid` instance property is unset
|
|
39
41
|
*/
|
|
40
|
-
function revokePermission(bundleId: string, perm: string): Promise<void>;
|
|
42
|
+
function revokePermission(this: import("../simctl").default, bundleId: string, perm: string): Promise<void>;
|
|
41
43
|
/**
|
|
42
44
|
* Resets the given permission on the app with the given bundle identifier
|
|
43
45
|
* to its default state
|
|
44
46
|
*
|
|
45
47
|
* @since Xcode 11.4 SDK
|
|
48
|
+
* @this {import('../simctl').Simctl}
|
|
46
49
|
* @param {string} bundleId the identifier of the application whose
|
|
47
50
|
* privacy settings are going to be changed
|
|
48
51
|
* @param {string} perm one of possible permission values (see `grantPermission`)
|
|
@@ -50,6 +53,6 @@ declare namespace commands {
|
|
|
50
53
|
* or there was an error while resetting the permission
|
|
51
54
|
* @throws {Error} If the `udid` instance property is unset
|
|
52
55
|
*/
|
|
53
|
-
function resetPermission(bundleId: string, perm: string): Promise<void>;
|
|
56
|
+
function resetPermission(this: import("../simctl").default, bundleId: string, perm: string): Promise<void>;
|
|
54
57
|
}
|
|
55
58
|
//# sourceMappingURL=privacy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"privacy.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/privacy.js"],"names":[],"mappings":";;IAEA
|
|
1
|
+
{"version":3,"file":"privacy.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/privacy.js"],"names":[],"mappings":";;IAEA;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,2GAIC;IAED;;;;;;;;;;;;OAYG;IACH,4GAIC;IAED;;;;;;;;;;;;OAYG;IACH,2GAIC"}
|
|
@@ -5,6 +5,7 @@ const commands = {};
|
|
|
5
5
|
* Grants the given permission on the app with the given bundle identifier
|
|
6
6
|
*
|
|
7
7
|
* @since Xcode 11.4 SDK
|
|
8
|
+
* @this {import('../simctl').Simctl}
|
|
8
9
|
* @param {string} bundleId the identifier of the application whose
|
|
9
10
|
* privacy settings are going to be changed
|
|
10
11
|
* @param {string} perm one of possible permission values:
|
|
@@ -35,6 +36,7 @@ commands.grantPermission = async function grantPermission(bundleId, perm) {
|
|
|
35
36
|
* after it has been granted
|
|
36
37
|
*
|
|
37
38
|
* @since Xcode 11.4 SDK
|
|
39
|
+
* @this {import('../simctl').Simctl}
|
|
38
40
|
* @param {string} bundleId the identifier of the application whose
|
|
39
41
|
* privacy settings are going to be changed
|
|
40
42
|
* @param {string} perm one of possible permission values (see `grantPermission`)
|
|
@@ -52,6 +54,7 @@ commands.revokePermission = async function revokePermission(bundleId, perm) {
|
|
|
52
54
|
* to its default state
|
|
53
55
|
*
|
|
54
56
|
* @since Xcode 11.4 SDK
|
|
57
|
+
* @this {import('../simctl').Simctl}
|
|
55
58
|
* @param {string} bundleId the identifier of the application whose
|
|
56
59
|
* privacy settings are going to be changed
|
|
57
60
|
* @param {string} perm one of possible permission values (see `grantPermission`)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"privacy.js","sourceRoot":"","sources":["../../../lib/subcommands/privacy.js"],"names":[],"mappings":";;AAAA,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB
|
|
1
|
+
{"version":3,"file":"privacy.js","sourceRoot":"","sources":["../../../lib/subcommands/privacy.js"],"names":[],"mappings":";;AAAA,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,QAAQ,CAAC,eAAe,GAAG,KAAK,UAAU,eAAe,CAAE,QAAQ,EAAE,IAAI;IACvE,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;QACzB,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC;KACnE,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,QAAQ,CAAC,gBAAgB,GAAG,KAAK,UAAU,gBAAgB,CAAE,QAAQ,EAAE,IAAI;IACzE,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;QACzB,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,CAAC;KACrE,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,QAAQ,CAAC,eAAe,GAAG,KAAK,UAAU,eAAe,CAAE,QAAQ,EAAE,IAAI;IACvE,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;QACzB,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC;KACnE,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
|
|
@@ -4,6 +4,7 @@ declare namespace commands {
|
|
|
4
4
|
* Send a simulated push notification
|
|
5
5
|
*
|
|
6
6
|
* @since Xcode 11.4 SDK
|
|
7
|
+
* @this {import('../simctl').Simctl}
|
|
7
8
|
* @param {Object} payload - The object that describes Apple push notification content.
|
|
8
9
|
* It must contain a top-level "Simulator Target Bundle" key with a string value matching
|
|
9
10
|
* the target application‘s bundle identifier and "aps" key with valid Apple Push Notification values.
|
|
@@ -20,6 +21,6 @@ declare namespace commands {
|
|
|
20
21
|
* or there was an error while pushing the notification
|
|
21
22
|
* @throws {Error} If the `udid` instance property is unset
|
|
22
23
|
*/
|
|
23
|
-
function pushNotification(payload: any): Promise<void>;
|
|
24
|
+
function pushNotification(this: import("../simctl").default, payload: any): Promise<void>;
|
|
24
25
|
}
|
|
25
26
|
//# sourceMappingURL=push.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/push.js"],"names":[],"mappings":";;IAQA
|
|
1
|
+
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/push.js"],"names":[],"mappings":";;IAQA;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,0FAUC"}
|
|
@@ -13,6 +13,7 @@ const commands = {};
|
|
|
13
13
|
* Send a simulated push notification
|
|
14
14
|
*
|
|
15
15
|
* @since Xcode 11.4 SDK
|
|
16
|
+
* @this {import('../simctl').Simctl}
|
|
16
17
|
* @param {Object} payload - The object that describes Apple push notification content.
|
|
17
18
|
* It must contain a top-level "Simulator Target Bundle" key with a string value matching
|
|
18
19
|
* the target application‘s bundle identifier and "aps" key with valid Apple Push Notification values.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../../lib/subcommands/push.js"],"names":[],"mappings":";;;;;AAAA,mCAAgC;AAChC,+BAAoC;AACpC,gDAAwB;AACxB,4CAAoB;AACpB,2DAA6B;AAE7B,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB
|
|
1
|
+
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../../lib/subcommands/push.js"],"names":[],"mappings":";;;;;AAAA,mCAAgC;AAChC,+BAAoC;AACpC,gDAAwB;AACxB,4CAAoB;AACpB,2DAA6B;AAE7B,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,QAAQ,CAAC,gBAAgB,GAAG,KAAK,UAAU,gBAAgB,CAAE,OAAO;IAClE,MAAM,OAAO,GAAG,cAAI,CAAC,OAAO,CAAC,YAAE,CAAC,MAAM,EAAE,EAAE,GAAG,IAAA,SAAM,GAAE,OAAO,CAAC,CAAC;IAC9D,IAAI;QACF,MAAM,kBAAE,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC;QAC7D,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACtB,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;SAC1C,CAAC,CAAC;KACJ;YAAS;QACR,MAAM,IAAA,eAAM,EAAC,OAAO,CAAC,CAAC;KACvB;AACH,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
|
|
@@ -3,10 +3,11 @@ declare namespace commands {
|
|
|
3
3
|
/**
|
|
4
4
|
* Shutdown the given Simulator if it is running.
|
|
5
5
|
*
|
|
6
|
+
* @this {import('../simctl').Simctl}
|
|
6
7
|
* @throws {Error} If the corresponding simctl subcommand command
|
|
7
8
|
* returns non-zero return code.
|
|
8
9
|
* @throws {Error} If the `udid` instance property is unset
|
|
9
10
|
*/
|
|
10
|
-
function shutdownDevice(): Promise<void>;
|
|
11
|
+
function shutdownDevice(this: import("../simctl").default): Promise<void>;
|
|
11
12
|
}
|
|
12
13
|
//# sourceMappingURL=shutdown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shutdown.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/shutdown.js"],"names":[],"mappings":";;IAKA
|
|
1
|
+
{"version":3,"file":"shutdown.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/shutdown.js"],"names":[],"mappings":";;IAKA;;;;;;;OAOG;IACH,0EAWC"}
|
|
@@ -32,6 +32,7 @@ const commands = {};
|
|
|
32
32
|
/**
|
|
33
33
|
* Shutdown the given Simulator if it is running.
|
|
34
34
|
*
|
|
35
|
+
* @this {import('../simctl').Simctl}
|
|
35
36
|
* @throws {Error} If the corresponding simctl subcommand command
|
|
36
37
|
* returns non-zero return code.
|
|
37
38
|
* @throws {Error} If the `udid` instance property is unset
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shutdown.js","sourceRoot":"","sources":["../../../lib/subcommands/shutdown.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAuB;AACvB,oDAA4C;AAE5C,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB
|
|
1
|
+
{"version":3,"file":"shutdown.js","sourceRoot":"","sources":["../../../lib/subcommands/shutdown.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAuB;AACvB,oDAA4C;AAE5C,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB;;;;;;;GAOG;AACH,QAAQ,CAAC,cAAc,GAAG,KAAK,UAAU,cAAc;IACrD,IAAI;QACF,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YAC1B,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;SACrC,CAAC,CAAC;KACJ;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,gBAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,yBAAyB,CAAC,EAAE;YACrD,MAAM,CAAC,CAAC;SACT;QACD,gBAAG,CAAC,KAAK,CAAC,mBAAU,EAAE,mDAAmD,CAAC,CAAC;KAC5E;AACH,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
|
|
@@ -4,6 +4,7 @@ declare namespace commands {
|
|
|
4
4
|
* Spawn the particular process on Simulator.
|
|
5
5
|
* It is required that Simulator is in _booted_ state.
|
|
6
6
|
*
|
|
7
|
+
* @this {import('../simctl').Simctl}
|
|
7
8
|
* @param {string|string[]} args - Spawn arguments
|
|
8
9
|
* @param {object} [env={}] - Additional environment variables mapping.
|
|
9
10
|
* @return {Promise<import('teen_process').TeenProcessExecResult>} Command execution result.
|
|
@@ -11,16 +12,17 @@ declare namespace commands {
|
|
|
11
12
|
* returns non-zero return code.
|
|
12
13
|
* @throws {Error} If the `udid` instance property is unset
|
|
13
14
|
*/
|
|
14
|
-
function spawnProcess(args: string | string[], env?: any): Promise<import("teen_process").TeenProcessExecResult<any>>;
|
|
15
|
+
function spawnProcess(this: import("../simctl").default, args: string | string[], env?: any): Promise<import("teen_process").TeenProcessExecResult<any>>;
|
|
15
16
|
/**
|
|
16
17
|
* Prepare SubProcess instance for a new process, which is going to be spawned
|
|
17
18
|
* on Simulator.
|
|
18
19
|
*
|
|
20
|
+
* @this {import('../simctl').Simctl}
|
|
19
21
|
* @param {string|string[]} args - Spawn arguments
|
|
20
22
|
* @param {object} [env={}] - Additional environment variables mapping.
|
|
21
23
|
* @return {Promise<import('teen_process').SubProcess>} The instance of the process to be spawned.
|
|
22
24
|
* @throws {Error} If the `udid` instance property is unset
|
|
23
25
|
*/
|
|
24
|
-
function spawnSubProcess(args: string | string[], env?: any): Promise<import("teen_process").SubProcess>;
|
|
26
|
+
function spawnSubProcess(this: import("../simctl").default, args: string | string[], env?: any): Promise<import("teen_process").SubProcess>;
|
|
25
27
|
}
|
|
26
28
|
//# sourceMappingURL=spawn.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/spawn.js"],"names":[],"mappings":";;IAKA
|
|
1
|
+
{"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/spawn.js"],"names":[],"mappings":";;IAKA;;;;;;;;;;;OAWG;IACH,yJAWC;IAED;;;;;;;;;OASG;IACH,4IAYC"}
|
|
@@ -9,6 +9,7 @@ const commands = {};
|
|
|
9
9
|
* Spawn the particular process on Simulator.
|
|
10
10
|
* It is required that Simulator is in _booted_ state.
|
|
11
11
|
*
|
|
12
|
+
* @this {import('../simctl').Simctl}
|
|
12
13
|
* @param {string|string[]} args - Spawn arguments
|
|
13
14
|
* @param {object} [env={}] - Additional environment variables mapping.
|
|
14
15
|
* @return {Promise<import('teen_process').TeenProcessExecResult>} Command execution result.
|
|
@@ -20,6 +21,8 @@ commands.spawnProcess = async function spawnProcess(args, env = {}) {
|
|
|
20
21
|
if (lodash_1.default.isEmpty(args)) {
|
|
21
22
|
throw new Error('Spawn arguments are required');
|
|
22
23
|
}
|
|
24
|
+
/** @type {import('teen_process').TeenProcessExecResult} */
|
|
25
|
+
// @ts-ignore The returned type is ok
|
|
23
26
|
return await this.exec('spawn', {
|
|
24
27
|
args: [this.requireUdid('spawn'), ...(lodash_1.default.isArray(args) ? args : [args])],
|
|
25
28
|
env,
|
|
@@ -29,6 +32,7 @@ commands.spawnProcess = async function spawnProcess(args, env = {}) {
|
|
|
29
32
|
* Prepare SubProcess instance for a new process, which is going to be spawned
|
|
30
33
|
* on Simulator.
|
|
31
34
|
*
|
|
35
|
+
* @this {import('../simctl').Simctl}
|
|
32
36
|
* @param {string|string[]} args - Spawn arguments
|
|
33
37
|
* @param {object} [env={}] - Additional environment variables mapping.
|
|
34
38
|
* @return {Promise<import('teen_process').SubProcess>} The instance of the process to be spawned.
|
|
@@ -38,6 +42,8 @@ commands.spawnSubProcess = async function spawnSubProcess(args, env = {}) {
|
|
|
38
42
|
if (lodash_1.default.isEmpty(args)) {
|
|
39
43
|
throw new Error('Spawn arguments are required');
|
|
40
44
|
}
|
|
45
|
+
/** @type {import('teen_process').TeenProcessExecResult} */
|
|
46
|
+
// @ts-ignore The returned type is ok
|
|
41
47
|
return await this.exec('spawn', {
|
|
42
48
|
args: [this.requireUdid('spawn'), ...(lodash_1.default.isArray(args) ? args : [args])],
|
|
43
49
|
env,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawn.js","sourceRoot":"","sources":["../../../lib/subcommands/spawn.js"],"names":[],"mappings":";;;;;AAAA,oDAAuB;AAGvB,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB
|
|
1
|
+
{"version":3,"file":"spawn.js","sourceRoot":"","sources":["../../../lib/subcommands/spawn.js"],"names":[],"mappings":";;;;;AAAA,oDAAuB;AAGvB,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB;;;;;;;;;;;GAWG;AACH,QAAQ,CAAC,YAAY,GAAG,KAAK,UAAU,YAAY,CAAE,IAAI,EAAE,GAAG,GAAG,EAAE;IACjE,IAAI,gBAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACnB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;KACjD;IAED,2DAA2D;IAC3D,qCAAqC;IACrC,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;QAC9B,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,gBAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QACvE,GAAG;KACJ,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;;;;;;;GASG;AACH,QAAQ,CAAC,eAAe,GAAG,KAAK,UAAU,eAAe,CAAE,IAAI,EAAE,GAAG,GAAG,EAAE;IACvE,IAAI,gBAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACnB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;KACjD;IAED,2DAA2D;IAC3D,qCAAqC;IACrC,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;QAC9B,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,gBAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QACvE,GAAG;QACH,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
|
|
@@ -4,12 +4,13 @@ declare namespace commands {
|
|
|
4
4
|
* Terminate the given running application on Simulator.
|
|
5
5
|
* It is required that Simulator is in _booted_ state.
|
|
6
6
|
*
|
|
7
|
+
* @this {import('../simctl').Simctl}
|
|
7
8
|
* @param {string} bundleId - Bundle identifier of the application,
|
|
8
9
|
* which is going to be terminated.
|
|
9
10
|
* @throws {Error} If the corresponding simctl subcommand command
|
|
10
11
|
* returns non-zero return code.
|
|
11
12
|
* @throws {Error} If the `udid` instance property is unset
|
|
12
13
|
*/
|
|
13
|
-
function terminateApp(bundleId: string): Promise<void>;
|
|
14
|
+
function terminateApp(this: import("../simctl").default, bundleId: string): Promise<void>;
|
|
14
15
|
}
|
|
15
16
|
//# sourceMappingURL=terminate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminate.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/terminate.js"],"names":[],"mappings":";;IAEA
|
|
1
|
+
{"version":3,"file":"terminate.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/terminate.js"],"names":[],"mappings":";;IAEA;;;;;;;;;;OAUG;IACH,0FAIC"}
|
|
@@ -5,6 +5,7 @@ const commands = {};
|
|
|
5
5
|
* Terminate the given running application on Simulator.
|
|
6
6
|
* It is required that Simulator is in _booted_ state.
|
|
7
7
|
*
|
|
8
|
+
* @this {import('../simctl').Simctl}
|
|
8
9
|
* @param {string} bundleId - Bundle identifier of the application,
|
|
9
10
|
* which is going to be terminated.
|
|
10
11
|
* @throws {Error} If the corresponding simctl subcommand command
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminate.js","sourceRoot":"","sources":["../../../lib/subcommands/terminate.js"],"names":[],"mappings":";;AAAA,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB
|
|
1
|
+
{"version":3,"file":"terminate.js","sourceRoot":"","sources":["../../../lib/subcommands/terminate.js"],"names":[],"mappings":";;AAAA,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB;;;;;;;;;;GAUG;AACH,QAAQ,CAAC,YAAY,GAAG,KAAK,UAAU,YAAY,CAAE,QAAQ;IAC3D,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;QAC3B,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC;KAChD,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
|
|
@@ -4,21 +4,23 @@ declare namespace commands {
|
|
|
4
4
|
* Retrieves the current UI appearance value from the given simulator
|
|
5
5
|
*
|
|
6
6
|
* @since Xcode 11.4 SDK
|
|
7
|
+
* @this {import('../simctl').Simctl}
|
|
7
8
|
* @return {Promise<string>} the appearance value, for example 'light' or 'dark'
|
|
8
9
|
* @throws {Error} if the current SDK version does not support the command
|
|
9
10
|
* or there was an error while getting the value
|
|
10
11
|
* @throws {Error} If the `udid` instance property is unset
|
|
11
12
|
*/
|
|
12
|
-
function getAppearance(): Promise<string>;
|
|
13
|
+
function getAppearance(this: import("../simctl").default): Promise<string>;
|
|
13
14
|
/**
|
|
14
15
|
* Sets the UI appearance to the given style
|
|
15
16
|
*
|
|
16
17
|
* @since Xcode 11.4 SDK
|
|
18
|
+
* @this {import('../simctl').Simctl}
|
|
17
19
|
* @param {string} appearance valid appearance value, for example 'light' or 'dark'
|
|
18
20
|
* @throws {Error} if the current SDK version does not support the command
|
|
19
21
|
* or there was an error while getting the value
|
|
20
22
|
* @throws {Error} If the `udid` instance property is unset
|
|
21
23
|
*/
|
|
22
|
-
function setAppearance(appearance: string): Promise<void>;
|
|
24
|
+
function setAppearance(this: import("../simctl").default, appearance: string): Promise<void>;
|
|
23
25
|
}
|
|
24
26
|
//# sourceMappingURL=ui.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/ui.js"],"names":[],"mappings":";;IAKA
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/ui.js"],"names":[],"mappings":";;IAKA;;;;;;;;;OASG;IACH,2EAOC;IAED;;;;;;;;;OASG;IACH,6FAIC"}
|
|
@@ -9,12 +9,15 @@ const commands = {};
|
|
|
9
9
|
* Retrieves the current UI appearance value from the given simulator
|
|
10
10
|
*
|
|
11
11
|
* @since Xcode 11.4 SDK
|
|
12
|
+
* @this {import('../simctl').Simctl}
|
|
12
13
|
* @return {Promise<string>} the appearance value, for example 'light' or 'dark'
|
|
13
14
|
* @throws {Error} if the current SDK version does not support the command
|
|
14
15
|
* or there was an error while getting the value
|
|
15
16
|
* @throws {Error} If the `udid` instance property is unset
|
|
16
17
|
*/
|
|
17
18
|
commands.getAppearance = async function getAppearance() {
|
|
19
|
+
/** @type {import('teen_process').TeenProcessExecResult} */
|
|
20
|
+
// @ts-ignore We know the returned type is ok
|
|
18
21
|
const { stdout } = await this.exec('ui', {
|
|
19
22
|
args: [this.requireUdid('ui'), 'appearance'],
|
|
20
23
|
});
|
|
@@ -24,6 +27,7 @@ commands.getAppearance = async function getAppearance() {
|
|
|
24
27
|
* Sets the UI appearance to the given style
|
|
25
28
|
*
|
|
26
29
|
* @since Xcode 11.4 SDK
|
|
30
|
+
* @this {import('../simctl').Simctl}
|
|
27
31
|
* @param {string} appearance valid appearance value, for example 'light' or 'dark'
|
|
28
32
|
* @throws {Error} if the current SDK version does not support the command
|
|
29
33
|
* or there was an error while getting the value
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../../lib/subcommands/ui.js"],"names":[],"mappings":";;;;;AAAA,oDAAuB;AAGvB,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../../lib/subcommands/ui.js"],"names":[],"mappings":";;;;;AAAA,oDAAuB;AAGvB,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB;;;;;;;;;GASG;AACH,QAAQ,CAAC,aAAa,GAAG,KAAK,UAAU,aAAa;IACnD,2DAA2D;IAC3D,6CAA6C;IAC7C,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;QACrC,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC;KAC7C,CAAC,CAAC;IACH,OAAO,gBAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC,CAAC;AAEF;;;;;;;;;GASG;AACH,QAAQ,CAAC,aAAa,GAAG,KAAK,UAAU,aAAa,CAAE,UAAU;IAC/D,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;QACpB,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,UAAU,CAAC;KACzD,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
|
|
@@ -5,12 +5,13 @@ declare namespace commands {
|
|
|
5
5
|
* It is required that Simulator is in _booted_ state and
|
|
6
6
|
* the application with given bundle identifier is already installed.
|
|
7
7
|
*
|
|
8
|
+
* @this {import('../simctl').Simctl}
|
|
8
9
|
* @param {string} bundleId - Bundle identifier of the application,
|
|
9
10
|
* which is going to be removed.
|
|
10
11
|
* @throws {Error} If the corresponding simctl subcommand command
|
|
11
12
|
* returns non-zero return code.
|
|
12
13
|
* @throws {Error} If the `udid` instance property is unset
|
|
13
14
|
*/
|
|
14
|
-
function removeApp(bundleId: string): Promise<void>;
|
|
15
|
+
function removeApp(this: import("../simctl").default, bundleId: string): Promise<void>;
|
|
15
16
|
}
|
|
16
17
|
//# sourceMappingURL=uninstall.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/uninstall.js"],"names":[],"mappings":";;IAEA
|
|
1
|
+
{"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/uninstall.js"],"names":[],"mappings":";;IAEA;;;;;;;;;;;OAWG;IACH,uFAIC"}
|
|
@@ -6,6 +6,7 @@ const commands = {};
|
|
|
6
6
|
* It is required that Simulator is in _booted_ state and
|
|
7
7
|
* the application with given bundle identifier is already installed.
|
|
8
8
|
*
|
|
9
|
+
* @this {import('../simctl').Simctl}
|
|
9
10
|
* @param {string} bundleId - Bundle identifier of the application,
|
|
10
11
|
* which is going to be removed.
|
|
11
12
|
* @throws {Error} If the corresponding simctl subcommand command
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uninstall.js","sourceRoot":"","sources":["../../../lib/subcommands/uninstall.js"],"names":[],"mappings":";;AAAA,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB
|
|
1
|
+
{"version":3,"file":"uninstall.js","sourceRoot":"","sources":["../../../lib/subcommands/uninstall.js"],"names":[],"mappings":";;AAAA,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB;;;;;;;;;;;GAWG;AACH,QAAQ,CAAC,SAAS,GAAG,KAAK,UAAU,SAAS,CAAE,QAAQ;IACrD,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;QAC3B,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC;KAChD,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
|
package/lib/simctl.js
CHANGED
|
@@ -1,11 +1,35 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
|
-
import subcommands from './subcommands/index.js';
|
|
3
2
|
import which from 'which';
|
|
4
3
|
import log, { LOG_PREFIX } from './logger';
|
|
5
4
|
import {
|
|
6
5
|
DEFAULT_EXEC_TIMEOUT, getXcrunBinary,
|
|
7
6
|
} from './helpers';
|
|
8
7
|
import { exec as tpExec, SubProcess } from 'teen_process';
|
|
8
|
+
import addmediaCommands from './subcommands/addmedia';
|
|
9
|
+
import appinfoCommands from './subcommands/appinfo';
|
|
10
|
+
import bootCommands from './subcommands/boot';
|
|
11
|
+
import bootstatusCommands from './subcommands/bootstatus';
|
|
12
|
+
import createCommands from './subcommands/create';
|
|
13
|
+
import deleteCommands from './subcommands/delete';
|
|
14
|
+
import eraseCommands from './subcommands/erase';
|
|
15
|
+
import getappcontainerCommands from './subcommands/get_app_container';
|
|
16
|
+
import installCommands from './subcommands/install';
|
|
17
|
+
import ioCommands from './subcommands/io';
|
|
18
|
+
import keychainCommands from './subcommands/keychain';
|
|
19
|
+
import launchCommands from './subcommands/launch';
|
|
20
|
+
import listCommands from './subcommands/list';
|
|
21
|
+
import openurlCommands from './subcommands/openurl';
|
|
22
|
+
import pbcopyCommands from './subcommands/pbcopy';
|
|
23
|
+
import pbpasteCommands from './subcommands/pbpaste';
|
|
24
|
+
import privacyCommands from './subcommands/privacy';
|
|
25
|
+
import pushCommands from './subcommands/push';
|
|
26
|
+
import envCommands from './subcommands/getenv';
|
|
27
|
+
import shutdownCommands from './subcommands/shutdown';
|
|
28
|
+
import spawnCommands from './subcommands/spawn';
|
|
29
|
+
import terminateCommands from './subcommands/terminate';
|
|
30
|
+
import uiCommands from './subcommands/ui';
|
|
31
|
+
import uninstallCommands from './subcommands/uninstall';
|
|
32
|
+
import locationCommands from './subcommands/location';
|
|
9
33
|
|
|
10
34
|
const SIMCTL_ENV_PREFIX = 'SIMCTL_CHILD_';
|
|
11
35
|
const DEFAULT_OPTS = {
|
|
@@ -99,6 +123,10 @@ class Simctl {
|
|
|
99
123
|
return this._devicesSetPath;
|
|
100
124
|
}
|
|
101
125
|
|
|
126
|
+
/**
|
|
127
|
+
* @param {string?} [commandName=null]
|
|
128
|
+
* @returns {string}
|
|
129
|
+
*/
|
|
102
130
|
requireUdid (commandName = null) {
|
|
103
131
|
if (!this.udid) {
|
|
104
132
|
throw new Error(`udid is required to be set for ` +
|
|
@@ -107,6 +135,9 @@ class Simctl {
|
|
|
107
135
|
return this.udid;
|
|
108
136
|
}
|
|
109
137
|
|
|
138
|
+
/**
|
|
139
|
+
* @returns {Promise<string>}
|
|
140
|
+
*/
|
|
110
141
|
async requireXcrun () {
|
|
111
142
|
const xcrunBinary = getXcrunBinary();
|
|
112
143
|
|
|
@@ -188,12 +219,68 @@ class Simctl {
|
|
|
188
219
|
throw e;
|
|
189
220
|
}
|
|
190
221
|
}
|
|
191
|
-
}
|
|
192
222
|
|
|
223
|
+
addMedia = addmediaCommands.addMedia;
|
|
224
|
+
|
|
225
|
+
appInfo = appinfoCommands.appInfo;
|
|
226
|
+
|
|
227
|
+
bootDevice = bootCommands.bootDevice;
|
|
228
|
+
|
|
229
|
+
startBootMonitor = bootstatusCommands.startBootMonitor;
|
|
230
|
+
|
|
231
|
+
createDevice = createCommands.createDevice;
|
|
232
|
+
|
|
233
|
+
deleteDevice = deleteCommands.deleteDevice;
|
|
234
|
+
|
|
235
|
+
eraseDevice = eraseCommands.eraseDevice;
|
|
236
|
+
|
|
237
|
+
getAppContainer = getappcontainerCommands.getAppContainer;
|
|
238
|
+
|
|
239
|
+
getEnv = envCommands.getEnv;
|
|
240
|
+
|
|
241
|
+
installApp = installCommands.installApp;
|
|
242
|
+
|
|
243
|
+
getScreenshot = ioCommands.getScreenshot;
|
|
244
|
+
|
|
245
|
+
addRootCertificate = keychainCommands.addRootCertificate;
|
|
246
|
+
addCertificate = keychainCommands.addCertificate;
|
|
247
|
+
resetKeychain = keychainCommands.resetKeychain;
|
|
248
|
+
|
|
249
|
+
launchApp = launchCommands.launchApp;
|
|
250
|
+
|
|
251
|
+
getDevicesByParsing = listCommands.getDevicesByParsing;
|
|
252
|
+
getDevices = listCommands.getDevices;
|
|
253
|
+
getRuntimeForPlatformVersionViaJson = listCommands.getRuntimeForPlatformVersionViaJson;
|
|
254
|
+
getRuntimeForPlatformVersion = listCommands.getRuntimeForPlatformVersion;
|
|
255
|
+
getDeviceTypes = listCommands.getDeviceTypes;
|
|
256
|
+
list = listCommands.list;
|
|
257
|
+
|
|
258
|
+
setLocation = locationCommands.setLocation;
|
|
259
|
+
clearLocation = locationCommands.clearLocation;
|
|
260
|
+
|
|
261
|
+
openUrl = openurlCommands.openUrl;
|
|
262
|
+
|
|
263
|
+
setPasteboard = pbcopyCommands.setPasteboard;
|
|
264
|
+
|
|
265
|
+
getPasteboard = pbpasteCommands.getPasteboard;
|
|
266
|
+
|
|
267
|
+
grantPermission = privacyCommands.grantPermission;
|
|
268
|
+
revokePermission = privacyCommands.revokePermission;
|
|
269
|
+
resetPermission = privacyCommands.resetPermission;
|
|
270
|
+
|
|
271
|
+
pushNotification = pushCommands.pushNotification;
|
|
272
|
+
|
|
273
|
+
shutdownDevice = shutdownCommands.shutdownDevice;
|
|
274
|
+
|
|
275
|
+
spawnProcess = spawnCommands.spawnProcess;
|
|
276
|
+
spawnSubProcess = spawnCommands.spawnSubProcess;
|
|
277
|
+
|
|
278
|
+
terminateApp = terminateCommands.terminateApp;
|
|
279
|
+
|
|
280
|
+
getAppearance = uiCommands.getAppearance;
|
|
281
|
+
setAppearance = uiCommands.setAppearance;
|
|
193
282
|
|
|
194
|
-
|
|
195
|
-
for (const [fnName, fn] of _.toPairs(subcommands)) {
|
|
196
|
-
Simctl.prototype[fnName] = fn;
|
|
283
|
+
removeApp = uninstallCommands.removeApp;
|
|
197
284
|
}
|
|
198
285
|
|
|
199
286
|
export default Simctl;
|
|
@@ -4,6 +4,7 @@ const commands = {};
|
|
|
4
4
|
* Add the particular media file to Simulator's library.
|
|
5
5
|
* It is required that Simulator is in _booted_ state.
|
|
6
6
|
*
|
|
7
|
+
* @this {import('../simctl').Simctl}
|
|
7
8
|
* @param {string} filePath - Full path to a media file on the local
|
|
8
9
|
* file system.
|
|
9
10
|
* @return {Promise<import('teen_process').TeenProcessExecResult>} Command execution result.
|
|
@@ -12,6 +13,8 @@ const commands = {};
|
|
|
12
13
|
* @throws {Error} If the `udid` instance property is unset
|
|
13
14
|
*/
|
|
14
15
|
commands.addMedia = async function addMedia (filePath) {
|
|
16
|
+
/** @type {import('teen_process').TeenProcessExecResult} */
|
|
17
|
+
// @ts-ignore The returned type is ok
|
|
15
18
|
return await this.exec('addmedia', {
|
|
16
19
|
args: [this.requireUdid('addmedia'), filePath],
|
|
17
20
|
});
|
|
@@ -7,6 +7,7 @@ const commands = {};
|
|
|
7
7
|
* Simulator server should be in 'booted' state for this call to work properly.
|
|
8
8
|
* The tool is only available since Xcode SDK 8.1
|
|
9
9
|
*
|
|
10
|
+
* @this {import('../simctl').Simctl}
|
|
10
11
|
* @param {string} bundleId - The bundle identifier of the target application.
|
|
11
12
|
* @return {Promise<string>} The information about installed application.
|
|
12
13
|
*
|
|
@@ -41,6 +42,8 @@ const commands = {};
|
|
|
41
42
|
* @throws {Error} If the `udid` instance property is unset
|
|
42
43
|
*/
|
|
43
44
|
commands.appInfo = async function appInfo (bundleId) {
|
|
45
|
+
/** @type {import('teen_process').TeenProcessExecResult} */
|
|
46
|
+
// @ts-ignore The returned type is ok
|
|
44
47
|
const {stdout} = await this.exec('appinfo', {
|
|
45
48
|
args: [this.requireUdid('appinfo'), bundleId],
|
|
46
49
|
});
|
package/lib/subcommands/boot.js
CHANGED
|
@@ -7,6 +7,7 @@ const commands = {};
|
|
|
7
7
|
/**
|
|
8
8
|
* Boot the particular Simulator if it is not running.
|
|
9
9
|
*
|
|
10
|
+
* @this {import('../simctl').Simctl}
|
|
10
11
|
* @throws {Error} If the corresponding simctl subcommand command
|
|
11
12
|
* returns non-zero return code.
|
|
12
13
|
* @throws {Error} If the `udid` instance property is unset
|
|
@@ -22,6 +22,7 @@ const commands = {};
|
|
|
22
22
|
* until Simulator booting is completed.
|
|
23
23
|
* The method is only available since Xcode8.
|
|
24
24
|
*
|
|
25
|
+
* @this {import('../simctl').Simctl}
|
|
25
26
|
* @param {BootMonitorOptions} [opts={}] - Monitoring options.
|
|
26
27
|
* @returns {Promise<import('teen_process').SubProcess>} The instance of the corresponding monitoring process.
|
|
27
28
|
* @throws {Error} If the Simulator fails to finish booting within the given timeout and onFinished
|
|
@@ -47,6 +48,8 @@ commands.startBootMonitor = async function startBootMonitor (opts = {}) {
|
|
|
47
48
|
if (shouldPreboot) {
|
|
48
49
|
args.push('-b');
|
|
49
50
|
}
|
|
51
|
+
/** @type {import('teen_process').SubProcess} */
|
|
52
|
+
// @ts-ignore The returned type is ok
|
|
50
53
|
const bootMonitor = await this.exec('bootstatus', {
|
|
51
54
|
args,
|
|
52
55
|
asynchronous: true,
|
|
@@ -20,6 +20,7 @@ const commands = {};
|
|
|
20
20
|
* Create Simulator device with given name for the particular
|
|
21
21
|
* platform type and version.
|
|
22
22
|
*
|
|
23
|
+
* @this {import('../simctl').Simctl}
|
|
23
24
|
* @param {string} name - The device name to be created.
|
|
24
25
|
* @param {string} deviceTypeId - Device type, for example 'iPhone 6'.
|
|
25
26
|
* @param {string} platformVersion - Platform version, for example '10.3'.
|
|
@@ -75,6 +76,8 @@ commands.createDevice = async function createDevice (name, deviceTypeId, platfor
|
|
|
75
76
|
log.debug(LOG_PREFIX,
|
|
76
77
|
`Creating simulator with name '${name}', device type id '${deviceTypeId}' and runtime id '${runtimeId}'`);
|
|
77
78
|
try {
|
|
79
|
+
/** @type {import('teen_process').TeenProcessExecResult} */
|
|
80
|
+
// @ts-ignore The returned type is ok
|
|
78
81
|
const {stdout} = await this.exec('create', {
|
|
79
82
|
args: [name, deviceTypeId, runtimeId]
|
|
80
83
|
});
|
|
@@ -3,6 +3,7 @@ const commands = {};
|
|
|
3
3
|
/**
|
|
4
4
|
* Delete the particular Simulator from available devices list.
|
|
5
5
|
*
|
|
6
|
+
* @this {import('../simctl').Simctl}
|
|
6
7
|
* @throws {Error} If the corresponding simctl subcommand command
|
|
7
8
|
* returns non-zero return code.
|
|
8
9
|
* @throws {Error} If the `udid` instance property is unset
|