node-simctl 7.3.5 → 7.3.7

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.
Files changed (137) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/build/lib/simctl.d.ts +56 -4
  3. package/build/lib/simctl.d.ts.map +1 -1
  4. package/build/lib/simctl.js +77 -9
  5. package/build/lib/simctl.js.map +1 -1
  6. package/build/lib/subcommands/addmedia.d.ts +2 -1
  7. package/build/lib/subcommands/addmedia.d.ts.map +1 -1
  8. package/build/lib/subcommands/addmedia.js +1 -0
  9. package/build/lib/subcommands/addmedia.js.map +1 -1
  10. package/build/lib/subcommands/appinfo.d.ts +2 -1
  11. package/build/lib/subcommands/appinfo.d.ts.map +1 -1
  12. package/build/lib/subcommands/appinfo.js +1 -0
  13. package/build/lib/subcommands/appinfo.js.map +1 -1
  14. package/build/lib/subcommands/boot.d.ts +2 -1
  15. package/build/lib/subcommands/boot.d.ts.map +1 -1
  16. package/build/lib/subcommands/boot.js +1 -0
  17. package/build/lib/subcommands/boot.js.map +1 -1
  18. package/build/lib/subcommands/bootstatus.d.ts +2 -1
  19. package/build/lib/subcommands/bootstatus.d.ts.map +1 -1
  20. package/build/lib/subcommands/bootstatus.js +1 -0
  21. package/build/lib/subcommands/bootstatus.js.map +1 -1
  22. package/build/lib/subcommands/create.d.ts +2 -1
  23. package/build/lib/subcommands/create.d.ts.map +1 -1
  24. package/build/lib/subcommands/create.js +1 -0
  25. package/build/lib/subcommands/create.js.map +1 -1
  26. package/build/lib/subcommands/delete.d.ts +2 -1
  27. package/build/lib/subcommands/delete.d.ts.map +1 -1
  28. package/build/lib/subcommands/delete.js +1 -0
  29. package/build/lib/subcommands/delete.js.map +1 -1
  30. package/build/lib/subcommands/erase.d.ts +2 -1
  31. package/build/lib/subcommands/erase.d.ts.map +1 -1
  32. package/build/lib/subcommands/erase.js +1 -0
  33. package/build/lib/subcommands/erase.js.map +1 -1
  34. package/build/lib/subcommands/get_app_container.d.ts +2 -1
  35. package/build/lib/subcommands/get_app_container.d.ts.map +1 -1
  36. package/build/lib/subcommands/get_app_container.js +1 -0
  37. package/build/lib/subcommands/get_app_container.js.map +1 -1
  38. package/build/lib/subcommands/getenv.d.ts +2 -1
  39. package/build/lib/subcommands/getenv.d.ts.map +1 -1
  40. package/build/lib/subcommands/getenv.js +1 -0
  41. package/build/lib/subcommands/getenv.js.map +1 -1
  42. package/build/lib/subcommands/install.d.ts +2 -1
  43. package/build/lib/subcommands/install.d.ts.map +1 -1
  44. package/build/lib/subcommands/install.js +1 -0
  45. package/build/lib/subcommands/install.js.map +1 -1
  46. package/build/lib/subcommands/io.d.ts +2 -1
  47. package/build/lib/subcommands/io.d.ts.map +1 -1
  48. package/build/lib/subcommands/io.js +1 -0
  49. package/build/lib/subcommands/io.js.map +1 -1
  50. package/build/lib/subcommands/keychain.d.ts +6 -3
  51. package/build/lib/subcommands/keychain.d.ts.map +1 -1
  52. package/build/lib/subcommands/keychain.js +9 -1
  53. package/build/lib/subcommands/keychain.js.map +1 -1
  54. package/build/lib/subcommands/launch.d.ts +2 -1
  55. package/build/lib/subcommands/launch.d.ts.map +1 -1
  56. package/build/lib/subcommands/launch.js +1 -0
  57. package/build/lib/subcommands/launch.js.map +1 -1
  58. package/build/lib/subcommands/list.d.ts +12 -6
  59. package/build/lib/subcommands/list.d.ts.map +1 -1
  60. package/build/lib/subcommands/list.js +6 -1
  61. package/build/lib/subcommands/list.js.map +1 -1
  62. package/build/lib/subcommands/location.d.ts +6 -3
  63. package/build/lib/subcommands/location.d.ts.map +1 -1
  64. package/build/lib/subcommands/location.js +4 -1
  65. package/build/lib/subcommands/location.js.map +1 -1
  66. package/build/lib/subcommands/openurl.d.ts +2 -1
  67. package/build/lib/subcommands/openurl.d.ts.map +1 -1
  68. package/build/lib/subcommands/openurl.js +1 -0
  69. package/build/lib/subcommands/openurl.js.map +1 -1
  70. package/build/lib/subcommands/pbcopy.d.ts +4 -3
  71. package/build/lib/subcommands/pbcopy.d.ts.map +1 -1
  72. package/build/lib/subcommands/pbcopy.js +9 -6
  73. package/build/lib/subcommands/pbcopy.js.map +1 -1
  74. package/build/lib/subcommands/pbpaste.d.ts +2 -1
  75. package/build/lib/subcommands/pbpaste.d.ts.map +1 -1
  76. package/build/lib/subcommands/pbpaste.js +1 -0
  77. package/build/lib/subcommands/pbpaste.js.map +1 -1
  78. package/build/lib/subcommands/privacy.d.ts +6 -3
  79. package/build/lib/subcommands/privacy.d.ts.map +1 -1
  80. package/build/lib/subcommands/privacy.js +3 -0
  81. package/build/lib/subcommands/privacy.js.map +1 -1
  82. package/build/lib/subcommands/push.d.ts +2 -1
  83. package/build/lib/subcommands/push.d.ts.map +1 -1
  84. package/build/lib/subcommands/push.js +1 -0
  85. package/build/lib/subcommands/push.js.map +1 -1
  86. package/build/lib/subcommands/shutdown.d.ts +2 -1
  87. package/build/lib/subcommands/shutdown.d.ts.map +1 -1
  88. package/build/lib/subcommands/shutdown.js +1 -0
  89. package/build/lib/subcommands/shutdown.js.map +1 -1
  90. package/build/lib/subcommands/spawn.d.ts +4 -2
  91. package/build/lib/subcommands/spawn.d.ts.map +1 -1
  92. package/build/lib/subcommands/spawn.js +2 -0
  93. package/build/lib/subcommands/spawn.js.map +1 -1
  94. package/build/lib/subcommands/terminate.d.ts +2 -1
  95. package/build/lib/subcommands/terminate.d.ts.map +1 -1
  96. package/build/lib/subcommands/terminate.js +1 -0
  97. package/build/lib/subcommands/terminate.js.map +1 -1
  98. package/build/lib/subcommands/ui.d.ts +4 -2
  99. package/build/lib/subcommands/ui.d.ts.map +1 -1
  100. package/build/lib/subcommands/ui.js +2 -0
  101. package/build/lib/subcommands/ui.js.map +1 -1
  102. package/build/lib/subcommands/uninstall.d.ts +2 -1
  103. package/build/lib/subcommands/uninstall.d.ts.map +1 -1
  104. package/build/lib/subcommands/uninstall.js +1 -0
  105. package/build/lib/subcommands/uninstall.js.map +1 -1
  106. package/lib/simctl.js +101 -10
  107. package/lib/subcommands/addmedia.js +1 -0
  108. package/lib/subcommands/appinfo.js +1 -0
  109. package/lib/subcommands/boot.js +1 -0
  110. package/lib/subcommands/bootstatus.js +1 -0
  111. package/lib/subcommands/create.js +1 -0
  112. package/lib/subcommands/delete.js +1 -0
  113. package/lib/subcommands/erase.js +1 -0
  114. package/lib/subcommands/get_app_container.js +1 -0
  115. package/lib/subcommands/getenv.js +1 -0
  116. package/lib/subcommands/install.js +1 -0
  117. package/lib/subcommands/io.js +1 -0
  118. package/lib/subcommands/keychain.js +9 -1
  119. package/lib/subcommands/launch.js +1 -0
  120. package/lib/subcommands/list.js +6 -1
  121. package/lib/subcommands/location.js +4 -1
  122. package/lib/subcommands/openurl.js +1 -0
  123. package/lib/subcommands/pbcopy.js +9 -6
  124. package/lib/subcommands/pbpaste.js +1 -0
  125. package/lib/subcommands/privacy.js +3 -0
  126. package/lib/subcommands/push.js +1 -0
  127. package/lib/subcommands/shutdown.js +1 -0
  128. package/lib/subcommands/spawn.js +2 -0
  129. package/lib/subcommands/terminate.js +1 -0
  130. package/lib/subcommands/ui.js +2 -0
  131. package/lib/subcommands/uninstall.js +1 -0
  132. package/package.json +1 -1
  133. package/build/lib/subcommands/index.d.ts +0 -3
  134. package/build/lib/subcommands/index.d.ts.map +0 -1
  135. package/build/lib/subcommands/index.js +0 -34
  136. package/build/lib/subcommands/index.js.map +0 -1
  137. package/lib/subcommands/index.js +0 -56
@@ -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;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,wEAIC;IAED;;;;;;;;;;;OAWG;IACH,yEAIC;IAED;;;;;;;;;;;OAWG;IACH,wEAIC"}
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;;;;;;;;;;;;;;;;;;;;;;;GAuBG;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;;;;;;;;;;;GAWG;AACH,QAAQ,CAAC,gBAAgB,GAAG,KAAK,UAAU,gBAAgB,CAAE,QAAQ,EAAE,IAAI;IACzE,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;QACzB,IAAI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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;;;;;;;;;;;;;;;;;;;OAmBG;IACH,uDAUC"}
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":[],"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,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;;;;;;OAMG;IACH,yCAWC"}
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;;;;;;GAMG;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"}
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;;;;;;;;;;OAUG;IACH,sHASC;IAED;;;;;;;;OAQG;IACH,yGAUC"}
1
+ {"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/spawn.js"],"names":[],"mappings":";;IAKA;;;;;;;;;;;OAWG;IACH,yJASC;IAED;;;;;;;;;OASG;IACH,4IAUC"}
@@ -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.
@@ -29,6 +30,7 @@ commands.spawnProcess = async function spawnProcess(args, env = {}) {
29
30
  * Prepare SubProcess instance for a new process, which is going to be spawned
30
31
  * on Simulator.
31
32
  *
33
+ * @this {import('../simctl').Simctl}
32
34
  * @param {string|string[]} args - Spawn arguments
33
35
  * @param {object} [env={}] - Additional environment variables mapping.
34
36
  * @return {Promise<import('teen_process').SubProcess>} The instance of the process to be spawned.
@@ -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;;;;;;;;;;GAUG;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,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;;;;;;;;GAQG;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,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;QAC9B,IAAI,EAAE,CAAC,IAAI,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AE,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;;;;;;;;;OASG;IACH,uDAIC"}
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;;;;;;;;;GASG;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"}
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;;;;;;;;OAQG;IACH,0CAKC;IAED;;;;;;;;OAQG;IACH,0DAIC"}
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/ui.js"],"names":[],"mappings":";;IAKA;;;;;;;;;OASG;IACH,2EAKC;IAED;;;;;;;;;OASG;IACH,6FAIC"}
@@ -9,6 +9,7 @@ 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
@@ -24,6 +25,7 @@ commands.getAppearance = async function getAppearance() {
24
25
  * Sets the UI appearance to the given style
25
26
  *
26
27
  * @since Xcode 11.4 SDK
28
+ * @this {import('../simctl').Simctl}
27
29
  * @param {string} appearance valid appearance value, for example 'light' or 'dark'
28
30
  * @throws {Error} if the current SDK version does not support the command
29
31
  * 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;;;;;;;;GAQG;AACH,QAAQ,CAAC,aAAa,GAAG,KAAK,UAAU,aAAa;IACnD,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;;;;;;;;GAQG;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"}
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,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;;;;;;;;;;OAUG;IACH,oDAIC"}
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;;;;;;;;;;GAUG;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"}
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 = {
@@ -21,6 +45,10 @@ const DEFAULT_OPTS = {
21
45
  * @property {string?} path Full path to the xcrun script
22
46
  */
23
47
 
48
+ /**
49
+ * @typedef {{asynchronous: true}} TAsyncOpts
50
+ */
51
+
24
52
  /**
25
53
  * @typedef {Object} ExecOpts
26
54
  * @property {string[]} [args=[]] - The list of additional subcommand arguments.
@@ -37,7 +65,6 @@ const DEFAULT_OPTS = {
37
65
  * executing xcrun. See https://github.com/appium/appium/issues/18966 for more details.
38
66
  */
39
67
 
40
-
41
68
  /**
42
69
  * @typedef {Object} SimctlOpts
43
70
  * @property {XCRun} [xcrun] - The xcrun properties. Currently only one property
@@ -99,6 +126,10 @@ class Simctl {
99
126
  return this._devicesSetPath;
100
127
  }
101
128
 
129
+ /**
130
+ * @param {string?} [commandName=null]
131
+ * @returns {string}
132
+ */
102
133
  requireUdid (commandName = null) {
103
134
  if (!this.udid) {
104
135
  throw new Error(`udid is required to be set for ` +
@@ -107,6 +138,9 @@ class Simctl {
107
138
  return this.udid;
108
139
  }
109
140
 
141
+ /**
142
+ * @returns {Promise<string>}
143
+ */
110
144
  async requireXcrun () {
111
145
  const xcrunBinary = getXcrunBinary();
112
146
 
@@ -124,15 +158,16 @@ class Simctl {
124
158
  /**
125
159
  * Execute the particular simctl command.
126
160
  *
161
+ * @template {ExecOpts} TExecOpts
127
162
  * @param {string} subcommand - One of available simctl subcommands.
128
163
  * Execute `xcrun simctl` in Terminal to see the full list of available subcommands.
129
- * @param {ExecOpts} [opts={}]
130
- * @return {Promise<import('teen_process').TeenProcessExecResult|import('teen_process').SubProcess>}
164
+ * @param {TExecOpts} [opts]
165
+ * @return {Promise<TExecOpts extends TAsyncOpts ? import('teen_process').SubProcess : import('teen_process').TeenProcessExecResult>}
131
166
  * Either the result of teen process's `exec` or
132
167
  * `SubProcess` instance depending of `opts.asynchronous` value.
133
168
  * @throws {Error} If the simctl subcommand command returns non-zero return code.
134
169
  */
135
- async exec (subcommand, opts = {}) {
170
+ async exec (subcommand, opts) {
136
171
  let {
137
172
  args = [],
138
173
  env = {},
@@ -140,7 +175,7 @@ class Simctl {
140
175
  encoding,
141
176
  logErrors = true,
142
177
  architectures,
143
- } = opts;
178
+ } = opts ?? {};
144
179
  // run a particular simctl command
145
180
  args = [
146
181
  'simctl',
@@ -188,12 +223,68 @@ class Simctl {
188
223
  throw e;
189
224
  }
190
225
  }
191
- }
192
226
 
227
+ addMedia = addmediaCommands.addMedia;
228
+
229
+ appInfo = appinfoCommands.appInfo;
230
+
231
+ bootDevice = bootCommands.bootDevice;
232
+
233
+ startBootMonitor = bootstatusCommands.startBootMonitor;
234
+
235
+ createDevice = createCommands.createDevice;
236
+
237
+ deleteDevice = deleteCommands.deleteDevice;
238
+
239
+ eraseDevice = eraseCommands.eraseDevice;
240
+
241
+ getAppContainer = getappcontainerCommands.getAppContainer;
242
+
243
+ getEnv = envCommands.getEnv;
244
+
245
+ installApp = installCommands.installApp;
246
+
247
+ getScreenshot = ioCommands.getScreenshot;
248
+
249
+ addRootCertificate = keychainCommands.addRootCertificate;
250
+ addCertificate = keychainCommands.addCertificate;
251
+ resetKeychain = keychainCommands.resetKeychain;
252
+
253
+ launchApp = launchCommands.launchApp;
254
+
255
+ getDevicesByParsing = listCommands.getDevicesByParsing;
256
+ getDevices = listCommands.getDevices;
257
+ getRuntimeForPlatformVersionViaJson = listCommands.getRuntimeForPlatformVersionViaJson;
258
+ getRuntimeForPlatformVersion = listCommands.getRuntimeForPlatformVersion;
259
+ getDeviceTypes = listCommands.getDeviceTypes;
260
+ list = listCommands.list;
261
+
262
+ setLocation = locationCommands.setLocation;
263
+ clearLocation = locationCommands.clearLocation;
264
+
265
+ openUrl = openurlCommands.openUrl;
266
+
267
+ setPasteboard = pbcopyCommands.setPasteboard;
268
+
269
+ getPasteboard = pbpasteCommands.getPasteboard;
270
+
271
+ grantPermission = privacyCommands.grantPermission;
272
+ revokePermission = privacyCommands.revokePermission;
273
+ resetPermission = privacyCommands.resetPermission;
274
+
275
+ pushNotification = pushCommands.pushNotification;
276
+
277
+ shutdownDevice = shutdownCommands.shutdownDevice;
278
+
279
+ spawnProcess = spawnCommands.spawnProcess;
280
+ spawnSubProcess = spawnCommands.spawnSubProcess;
281
+
282
+ terminateApp = terminateCommands.terminateApp;
283
+
284
+ getAppearance = uiCommands.getAppearance;
285
+ setAppearance = uiCommands.setAppearance;
193
286
 
194
- // add all the subcommands to the Simctl prototype
195
- for (const [fnName, fn] of _.toPairs(subcommands)) {
196
- Simctl.prototype[fnName] = fn;
287
+ removeApp = uninstallCommands.removeApp;
197
288
  }
198
289
 
199
290
  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.
@@ -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
  *
@@ -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
@@ -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'.
@@ -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
@@ -6,6 +6,7 @@ const commands = {};
6
6
  * Reset the content and settings of the particular Simulator.
7
7
  * It is required that Simulator is in _shutdown_ state.
8
8
  *
9
+ * @this {import('../simctl').Simctl}
9
10
  * @param {number} [timeout=10000] - The maximum number of milliseconds to wait
10
11
  * unit device reset is completed.
11
12
  * @throws {Error} If the corresponding simctl subcommand command
@@ -7,6 +7,7 @@ const commands = {};
7
7
  * like 'com.apple.springboard'.
8
8
  * It is required that Simulator is in _booted_ state.
9
9
  *
10
+ * @this {import('../simctl').Simctl}
10
11
  * @param {string} bundleId - Bundle identifier of an application.
11
12
  * @param {string?} [containerType=null] - Which container type to return. Possible values
12
13
  * are 'app', 'data', 'groups', '<A specific App Group container>'.
@@ -3,6 +3,7 @@ const commands = {};
3
3
  /**
4
4
  * Retrieves the value of a Simulator environment variable
5
5
  *
6
+ * @this {import('../simctl').Simctl}
6
7
  * @param {string} varName - The name of the variable to be retrieved
7
8
  * @returns {Promise<string|null>} The value of the variable or null if the given variable
8
9
  * is not present in the Simulator environment
@@ -4,6 +4,7 @@ const commands = {};
4
4
  * Install the particular application package on Simulator.
5
5
  * It is required that Simulator is in _booted_ state.
6
6
  *
7
+ * @this {import('../simctl').Simctl}
7
8
  * @param {string} appPath - Full path to .app package, which is
8
9
  * going to be installed.
9
10
  * @throws {Error} If the corresponding simctl subcommand command
@@ -10,6 +10,7 @@ const commands = {};
10
10
  * Gets base64 screenshot for device
11
11
  * It is required that Simulator is in _booted_ state.
12
12
  *
13
+ * @this {import('../simctl').Simctl}
13
14
  * @since Xcode SDK 8.1
14
15
  * @return {Promise<string>} Base64-encoded Simulator screenshot.
15
16
  * @throws {Error} If the corresponding simctl subcommand command