node-simctl 8.2.9 → 9.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/build/lib/helpers.d.ts.map +1 -1
  3. package/build/lib/helpers.js +13 -50
  4. package/build/lib/helpers.js.map +1 -1
  5. package/build/lib/index.d.ts +2 -2
  6. package/build/lib/index.d.ts.map +1 -1
  7. package/build/lib/index.js +3 -6
  8. package/build/lib/index.js.map +1 -1
  9. package/build/lib/logger.d.ts +1 -1
  10. package/build/lib/logger.d.ts.map +1 -1
  11. package/build/lib/logger.js +3 -9
  12. package/build/lib/logger.js.map +1 -1
  13. package/build/lib/simctl.d.ts +26 -26
  14. package/build/lib/simctl.d.ts.map +1 -1
  15. package/build/lib/simctl.js +44 -88
  16. package/build/lib/simctl.js.map +1 -1
  17. package/build/lib/subcommands/addmedia.d.ts +1 -1
  18. package/build/lib/subcommands/addmedia.d.ts.map +1 -1
  19. package/build/lib/subcommands/addmedia.js +1 -4
  20. package/build/lib/subcommands/addmedia.js.map +1 -1
  21. package/build/lib/subcommands/appinfo.d.ts +2 -2
  22. package/build/lib/subcommands/appinfo.d.ts.map +1 -1
  23. package/build/lib/subcommands/appinfo.js +7 -11
  24. package/build/lib/subcommands/appinfo.js.map +1 -1
  25. package/build/lib/subcommands/boot.d.ts +1 -1
  26. package/build/lib/subcommands/boot.d.ts.map +1 -1
  27. package/build/lib/subcommands/boot.js +3 -6
  28. package/build/lib/subcommands/boot.js.map +1 -1
  29. package/build/lib/subcommands/bootstatus.d.ts +2 -2
  30. package/build/lib/subcommands/bootstatus.d.ts.map +1 -1
  31. package/build/lib/subcommands/bootstatus.js +6 -9
  32. package/build/lib/subcommands/bootstatus.js.map +1 -1
  33. package/build/lib/subcommands/create.d.ts +2 -2
  34. package/build/lib/subcommands/create.d.ts.map +1 -1
  35. package/build/lib/subcommands/create.js +9 -12
  36. package/build/lib/subcommands/create.js.map +1 -1
  37. package/build/lib/subcommands/delete.d.ts +1 -1
  38. package/build/lib/subcommands/delete.d.ts.map +1 -1
  39. package/build/lib/subcommands/delete.js +1 -4
  40. package/build/lib/subcommands/delete.js.map +1 -1
  41. package/build/lib/subcommands/erase.d.ts +1 -1
  42. package/build/lib/subcommands/erase.d.ts.map +1 -1
  43. package/build/lib/subcommands/erase.js +3 -6
  44. package/build/lib/subcommands/erase.js.map +1 -1
  45. package/build/lib/subcommands/get_app_container.d.ts +1 -1
  46. package/build/lib/subcommands/get_app_container.d.ts.map +1 -1
  47. package/build/lib/subcommands/get_app_container.js +1 -4
  48. package/build/lib/subcommands/get_app_container.js.map +1 -1
  49. package/build/lib/subcommands/getenv.d.ts +1 -1
  50. package/build/lib/subcommands/getenv.d.ts.map +1 -1
  51. package/build/lib/subcommands/getenv.js +1 -4
  52. package/build/lib/subcommands/getenv.js.map +1 -1
  53. package/build/lib/subcommands/install.d.ts +1 -1
  54. package/build/lib/subcommands/install.d.ts.map +1 -1
  55. package/build/lib/subcommands/install.js +1 -4
  56. package/build/lib/subcommands/install.js.map +1 -1
  57. package/build/lib/subcommands/io.d.ts +1 -1
  58. package/build/lib/subcommands/io.d.ts.map +1 -1
  59. package/build/lib/subcommands/io.js +9 -15
  60. package/build/lib/subcommands/io.js.map +1 -1
  61. package/build/lib/subcommands/keychain.d.ts +2 -2
  62. package/build/lib/subcommands/keychain.d.ts.map +1 -1
  63. package/build/lib/subcommands/keychain.js +12 -20
  64. package/build/lib/subcommands/keychain.js.map +1 -1
  65. package/build/lib/subcommands/launch.d.ts +1 -1
  66. package/build/lib/subcommands/launch.d.ts.map +1 -1
  67. package/build/lib/subcommands/launch.js +3 -6
  68. package/build/lib/subcommands/launch.js.map +1 -1
  69. package/build/lib/subcommands/list.d.ts +2 -2
  70. package/build/lib/subcommands/list.d.ts.map +1 -1
  71. package/build/lib/subcommands/list.js +12 -20
  72. package/build/lib/subcommands/list.js.map +1 -1
  73. package/build/lib/subcommands/location.d.ts +1 -1
  74. package/build/lib/subcommands/location.d.ts.map +1 -1
  75. package/build/lib/subcommands/location.js +2 -6
  76. package/build/lib/subcommands/location.js.map +1 -1
  77. package/build/lib/subcommands/openurl.d.ts +1 -1
  78. package/build/lib/subcommands/openurl.d.ts.map +1 -1
  79. package/build/lib/subcommands/openurl.js +1 -4
  80. package/build/lib/subcommands/openurl.js.map +1 -1
  81. package/build/lib/subcommands/pbcopy.d.ts +1 -1
  82. package/build/lib/subcommands/pbcopy.d.ts.map +1 -1
  83. package/build/lib/subcommands/pbcopy.js +1 -4
  84. package/build/lib/subcommands/pbcopy.js.map +1 -1
  85. package/build/lib/subcommands/pbpaste.d.ts +1 -1
  86. package/build/lib/subcommands/pbpaste.d.ts.map +1 -1
  87. package/build/lib/subcommands/pbpaste.js +1 -4
  88. package/build/lib/subcommands/pbpaste.js.map +1 -1
  89. package/build/lib/subcommands/privacy.d.ts +1 -1
  90. package/build/lib/subcommands/privacy.d.ts.map +1 -1
  91. package/build/lib/subcommands/privacy.js +3 -8
  92. package/build/lib/subcommands/privacy.js.map +1 -1
  93. package/build/lib/subcommands/push.d.ts +1 -1
  94. package/build/lib/subcommands/push.d.ts.map +1 -1
  95. package/build/lib/subcommands/push.js +9 -15
  96. package/build/lib/subcommands/push.js.map +1 -1
  97. package/build/lib/subcommands/shutdown.d.ts +1 -1
  98. package/build/lib/subcommands/shutdown.d.ts.map +1 -1
  99. package/build/lib/subcommands/shutdown.js +3 -6
  100. package/build/lib/subcommands/shutdown.js.map +1 -1
  101. package/build/lib/subcommands/spawn.d.ts +1 -1
  102. package/build/lib/subcommands/spawn.d.ts.map +1 -1
  103. package/build/lib/subcommands/spawn.js +2 -6
  104. package/build/lib/subcommands/spawn.js.map +1 -1
  105. package/build/lib/subcommands/terminate.d.ts +1 -1
  106. package/build/lib/subcommands/terminate.d.ts.map +1 -1
  107. package/build/lib/subcommands/terminate.js +1 -4
  108. package/build/lib/subcommands/terminate.js.map +1 -1
  109. package/build/lib/subcommands/ui.d.ts +1 -1
  110. package/build/lib/subcommands/ui.d.ts.map +1 -1
  111. package/build/lib/subcommands/ui.js +6 -14
  112. package/build/lib/subcommands/ui.js.map +1 -1
  113. package/build/lib/subcommands/uninstall.d.ts +1 -1
  114. package/build/lib/subcommands/uninstall.d.ts.map +1 -1
  115. package/build/lib/subcommands/uninstall.js +1 -4
  116. package/build/lib/subcommands/uninstall.js.map +1 -1
  117. package/build/lib/types.d.ts.map +1 -1
  118. package/build/lib/types.js +1 -2
  119. package/lib/helpers.ts +5 -5
  120. package/lib/index.ts +2 -2
  121. package/lib/logger.ts +1 -1
  122. package/lib/simctl.ts +38 -47
  123. package/lib/subcommands/addmedia.ts +3 -5
  124. package/lib/subcommands/appinfo.ts +7 -13
  125. package/lib/subcommands/boot.ts +2 -2
  126. package/lib/subcommands/bootstatus.ts +6 -15
  127. package/lib/subcommands/create.ts +6 -7
  128. package/lib/subcommands/delete.ts +1 -1
  129. package/lib/subcommands/erase.ts +2 -1
  130. package/lib/subcommands/get_app_container.ts +1 -1
  131. package/lib/subcommands/getenv.ts +1 -1
  132. package/lib/subcommands/install.ts +1 -1
  133. package/lib/subcommands/io.ts +6 -4
  134. package/lib/subcommands/keychain.ts +8 -14
  135. package/lib/subcommands/launch.ts +3 -6
  136. package/lib/subcommands/list.ts +6 -13
  137. package/lib/subcommands/location.ts +2 -6
  138. package/lib/subcommands/openurl.ts +2 -1
  139. package/lib/subcommands/pbcopy.ts +3 -6
  140. package/lib/subcommands/pbpaste.ts +2 -5
  141. package/lib/subcommands/privacy.ts +2 -6
  142. package/lib/subcommands/push.ts +6 -4
  143. package/lib/subcommands/shutdown.ts +2 -2
  144. package/lib/subcommands/spawn.ts +2 -1
  145. package/lib/subcommands/terminate.ts +1 -1
  146. package/lib/subcommands/ui.ts +1 -1
  147. package/lib/subcommands/uninstall.ts +1 -1
  148. package/lib/types.ts +1 -3
  149. package/package.json +37 -39
@@ -1,4 +1,4 @@
1
- import type {Simctl} from '../simctl';
1
+ import type {Simctl} from '../simctl.js';
2
2
 
3
3
  /**
4
4
  * Get the content of Simulator pasteboard.
@@ -12,10 +12,7 @@ import type {Simctl} from '../simctl';
12
12
  * returns non-zero return code.
13
13
  * @throws {Error} If the `udid` instance property is unset
14
14
  */
15
- export async function getPasteboard(
16
- this: Simctl,
17
- encoding: BufferEncoding = 'utf8',
18
- ): Promise<string> {
15
+ export async function getPasteboard(this: Simctl, encoding: BufferEncoding = 'utf8'): Promise<string> {
19
16
  const {stdout} = await this.exec('pbpaste', {
20
17
  args: [this.requireUdid('pbpaste')],
21
18
  encoding,
@@ -1,4 +1,4 @@
1
- import type {Simctl} from '../simctl';
1
+ import type {Simctl} from '../simctl.js';
2
2
 
3
3
  /**
4
4
  * Grants the given permission on the app with the given bundle identifier
@@ -42,11 +42,7 @@ export async function grantPermission(this: Simctl, bundleId: string, perm: stri
42
42
  * or there was an error while revoking the permission
43
43
  * @throws {Error} If the `udid` instance property is unset
44
44
  */
45
- export async function revokePermission(
46
- this: Simctl,
47
- bundleId: string,
48
- perm: string,
49
- ): Promise<void> {
45
+ export async function revokePermission(this: Simctl, bundleId: string, perm: string): Promise<void> {
50
46
  await this.exec('privacy', {
51
47
  args: [this.requireUdid('privacy revoke'), 'revoke', perm, bundleId],
52
48
  });
@@ -1,9 +1,11 @@
1
- import {rimraf} from 'rimraf';
2
1
  import {randomUUID} from 'node:crypto';
3
- import path from 'node:path';
4
- import os from 'node:os';
5
2
  import fs from 'node:fs/promises';
6
- import type {Simctl} from '../simctl';
3
+ import os from 'node:os';
4
+ import path from 'node:path';
5
+
6
+ import {rimraf} from 'rimraf';
7
+
8
+ import type {Simctl} from '../simctl.js';
7
9
 
8
10
  /**
9
11
  * Send a simulated push notification
@@ -1,5 +1,5 @@
1
- import {log, LOG_PREFIX} from '../logger';
2
- import type {Simctl} from '../simctl';
1
+ import {log, LOG_PREFIX} from '../logger.js';
2
+ import type {Simctl} from '../simctl.js';
3
3
 
4
4
  /**
5
5
  * Shutdown the given Simulator if it is running.
@@ -1,6 +1,7 @@
1
- import type {Simctl} from '../simctl';
2
1
  import type {TeenProcessExecResult, SubProcess} from 'teen_process';
3
2
 
3
+ import type {Simctl} from '../simctl.js';
4
+
4
5
  /**
5
6
  * Spawn the particular process on Simulator.
6
7
  * It is required that Simulator is in _booted_ state.
@@ -1,4 +1,4 @@
1
- import type {Simctl} from '../simctl';
1
+ import type {Simctl} from '../simctl.js';
2
2
 
3
3
  /**
4
4
  * Terminate the given running application on Simulator.
@@ -1,4 +1,4 @@
1
- import type {Simctl} from '../simctl';
1
+ import type {Simctl} from '../simctl.js';
2
2
 
3
3
  /**
4
4
  * Retrieves the current UI appearance value from the given simulator
@@ -1,4 +1,4 @@
1
- import type {Simctl} from '../simctl';
1
+ import type {Simctl} from '../simctl.js';
2
2
 
3
3
  /**
4
4
  * Remove the particular application package from Simulator.
package/lib/types.ts CHANGED
@@ -139,9 +139,7 @@ export interface SimCreationOpts {
139
139
  /**
140
140
  * Result type for exec method - either SubProcess for async or TeenProcessExecResult for sync
141
141
  */
142
- export type ExecResult<T extends ExecOpts> = T extends AsyncExecOpts
143
- ? SubProcess
144
- : TeenProcessExecResult<string>;
142
+ export type ExecResult<T extends ExecOpts> = T extends AsyncExecOpts ? SubProcess : TeenProcessExecResult<string>;
145
143
 
146
144
  /**
147
145
  * Boot monitor options
package/package.json CHANGED
@@ -1,26 +1,21 @@
1
1
  {
2
2
  "name": "node-simctl",
3
+ "version": "9.1.0",
3
4
  "description": "Wrapper around Apple's simctl binary",
4
- "tags": [
5
+ "keywords": [
5
6
  "apple",
6
7
  "ios",
7
8
  "simctl"
8
9
  ],
9
- "version": "8.2.9",
10
- "author": "Appium Contributors",
10
+ "bugs": {
11
+ "url": "https://github.com/appium/node-simctl/issues"
12
+ },
11
13
  "license": "Apache-2.0",
14
+ "author": "Appium Contributors",
12
15
  "repository": {
13
16
  "type": "git",
14
17
  "url": "https://github.com/appium/node-simctl.git"
15
18
  },
16
- "bugs": {
17
- "url": "https://github.com/appium/node-simctl/issues"
18
- },
19
- "engines": {
20
- "node": "^20.19.0 || ^22.12.0 || >=24.0.0",
21
- "npm": ">=10"
22
- },
23
- "main": "./build/lib/index.js",
24
19
  "bin": {},
25
20
  "directories": {
26
21
  "lib": "./lib"
@@ -30,52 +25,55 @@
30
25
  "build/lib",
31
26
  "CHANGELOG.md"
32
27
  ],
33
- "dependencies": {
34
- "@appium/logger": "^2.0.0-rc.1",
35
- "asyncbox": "^6.0.1",
36
- "rimraf": "^6.0.1",
37
- "semver": "^7.0.0",
38
- "teen_process": "^4.0.4",
39
- "which": "^6.0.0"
28
+ "type": "module",
29
+ "main": "./build/lib/index.js",
30
+ "types": "./build/lib/index.d.ts",
31
+ "exports": {
32
+ ".": {
33
+ "types": "./build/lib/index.d.ts",
34
+ "import": "./build/lib/index.js"
35
+ },
36
+ "./package.json": "./package.json"
40
37
  },
41
38
  "scripts": {
42
39
  "build": "tsc -b",
43
40
  "clean": "npm run build -- --clean",
44
41
  "rebuild": "npm run clean; npm run build",
45
42
  "dev": "npm run build -- --watch",
46
- "lint": "eslint .",
47
- "lint:fix": "npm run lint -- --fix",
48
- "format": "prettier -w ./lib ./test",
49
- "format:check": "prettier --check ./lib ./test",
43
+ "lint": "oxlint -c oxlint.config.mjs .",
44
+ "lint:fix": "oxlint -c oxlint.config.mjs --fix .",
45
+ "format": "oxfmt -c oxfmt.config.mjs .",
46
+ "format:check": "oxfmt -c oxfmt.config.mjs --check .",
50
47
  "prepare": "npm run build",
51
- "test": "node --test --test-timeout=60000 \"./build/test/unit/**/*.spec.js\"",
52
- "e2e-test": "node --test --test-force-exit --test-concurrency=1 --test-timeout=300000 \"./build/test/e2e/**/*.spec.js\""
48
+ "test": "node --enable-source-maps --test --test-timeout=60000 \"./build/test/unit/**/*.spec.js\"",
49
+ "e2e-test": "node --enable-source-maps --test --test-force-exit --test-concurrency=1 --test-timeout=300000 \"./build/test/e2e/**/*.spec.js\""
53
50
  },
54
- "prettier": {
55
- "bracketSpacing": false,
56
- "printWidth": 100,
57
- "singleQuote": true
51
+ "dependencies": {
52
+ "@appium/logger": "^2.0.0-rc.1",
53
+ "asyncbox": "^6.0.1",
54
+ "rimraf": "^6.0.1",
55
+ "semver": "^7.0.0",
56
+ "teen_process": "^4.0.4",
57
+ "which": "^6.0.0"
58
58
  },
59
59
  "devDependencies": {
60
- "@appium/eslint-config-appium-ts": "^3.0.0",
61
- "@appium/tsconfig": "^1.0.0-rc.1",
60
+ "@appium/oxc-config": "^1.1.0",
61
+ "@appium/semantic-release-config": "^1.1.0",
62
+ "@appium/tsconfig": "^1.2.0",
62
63
  "@appium/types": "^1.0.0-rc.1",
63
- "@semantic-release/changelog": "^6.0.1",
64
- "@semantic-release/git": "^10.0.1",
65
64
  "@types/chai": "^5.2.3",
66
65
  "@types/chai-as-promised": "^8.0.2",
67
66
  "@types/node": "^26.0.0",
68
67
  "@types/semver": "^7.7.1",
69
68
  "@types/sinon": "^22.0.0",
70
69
  "@types/which": "^3.0.4",
71
- "appium-xcode": "^6.0.0",
70
+ "appium-xcode": "^7.0.0",
72
71
  "chai": "^6.0.0",
73
72
  "chai-as-promised": "^8.0.0",
74
- "conventional-changelog-conventionalcommits": "^9.3.1",
75
- "prettier": "^3.0.0",
76
- "semantic-release": "^25.0.2",
77
- "sinon": "^22.0.0",
78
- "typescript": "^6.0.2"
73
+ "sinon": "^22.0.0"
79
74
  },
80
- "types": "./build/lib/index.d.ts"
75
+ "engines": {
76
+ "node": "^20.19.0 || ^22.12.0 || >=24.0.0",
77
+ "npm": ">=10"
78
+ }
81
79
  }