node-simctl 8.0.8 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/build/index.d.ts +2 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js.map +1 -1
- package/build/lib/helpers.d.ts +17 -9
- package/build/lib/helpers.d.ts.map +1 -1
- package/build/lib/helpers.js +50 -4
- package/build/lib/helpers.js.map +1 -1
- package/build/lib/logger.d.ts +2 -3
- package/build/lib/logger.d.ts.map +1 -1
- package/build/lib/logger.js +3 -5
- package/build/lib/logger.js.map +1 -1
- package/build/lib/simctl.d.ts +82 -188
- package/build/lib/simctl.d.ts.map +1 -1
- package/build/lib/simctl.js +98 -150
- package/build/lib/simctl.js.map +1 -1
- package/build/lib/subcommands/addmedia.d.ts +14 -16
- package/build/lib/subcommands/addmedia.d.ts.map +1 -1
- package/build/lib/subcommands/addmedia.js +5 -7
- package/build/lib/subcommands/addmedia.js.map +1 -1
- package/build/lib/subcommands/appinfo.d.ts +13 -45
- package/build/lib/subcommands/appinfo.d.ts.map +1 -1
- package/build/lib/subcommands/appinfo.js +31 -42
- package/build/lib/subcommands/appinfo.js.map +1 -1
- package/build/lib/subcommands/boot.d.ts +9 -12
- package/build/lib/subcommands/boot.d.ts.map +1 -1
- package/build/lib/subcommands/boot.js +5 -40
- package/build/lib/subcommands/boot.js.map +1 -1
- package/build/lib/subcommands/bootstatus.d.ts +16 -56
- package/build/lib/subcommands/bootstatus.d.ts.map +1 -1
- package/build/lib/subcommands/bootstatus.js +8 -22
- package/build/lib/subcommands/bootstatus.js.map +1 -1
- package/build/lib/subcommands/create.d.ts +15 -34
- package/build/lib/subcommands/create.d.ts.map +1 -1
- package/build/lib/subcommands/create.js +23 -66
- package/build/lib/subcommands/create.js.map +1 -1
- package/build/lib/subcommands/delete.d.ts +9 -12
- package/build/lib/subcommands/delete.d.ts.map +1 -1
- package/build/lib/subcommands/delete.js +3 -5
- package/build/lib/subcommands/delete.js.map +1 -1
- package/build/lib/subcommands/erase.d.ts +12 -15
- package/build/lib/subcommands/erase.d.ts.map +1 -1
- package/build/lib/subcommands/erase.js +4 -6
- package/build/lib/subcommands/erase.js.map +1 -1
- package/build/lib/subcommands/get_app_container.d.ts +19 -22
- package/build/lib/subcommands/get_app_container.d.ts.map +1 -1
- package/build/lib/subcommands/get_app_container.js +6 -8
- package/build/lib/subcommands/get_app_container.js.map +1 -1
- package/build/lib/subcommands/getenv.d.ts +11 -14
- package/build/lib/subcommands/getenv.d.ts.map +1 -1
- package/build/lib/subcommands/getenv.js +5 -7
- package/build/lib/subcommands/getenv.js.map +1 -1
- package/build/lib/subcommands/install.d.ts +12 -15
- package/build/lib/subcommands/install.d.ts.map +1 -1
- package/build/lib/subcommands/install.js +4 -6
- package/build/lib/subcommands/install.js.map +1 -1
- package/build/lib/subcommands/io.d.ts +12 -15
- package/build/lib/subcommands/io.d.ts.map +1 -1
- package/build/lib/subcommands/io.js +4 -6
- package/build/lib/subcommands/io.js.map +1 -1
- package/build/lib/subcommands/keychain.d.ts +37 -55
- package/build/lib/subcommands/keychain.d.ts.map +1 -1
- package/build/lib/subcommands/keychain.js +16 -25
- package/build/lib/subcommands/keychain.js.map +1 -1
- package/build/lib/subcommands/launch.d.ts +16 -19
- package/build/lib/subcommands/launch.d.ts.map +1 -1
- package/build/lib/subcommands/launch.js +9 -11
- package/build/lib/subcommands/launch.js.map +1 -1
- package/build/lib/subcommands/list.d.ts +94 -125
- package/build/lib/subcommands/list.d.ts.map +1 -1
- package/build/lib/subcommands/list.js +34 -92
- package/build/lib/subcommands/list.js.map +1 -1
- package/build/lib/subcommands/location.d.ts +18 -22
- package/build/lib/subcommands/location.d.ts.map +1 -1
- package/build/lib/subcommands/location.js +11 -13
- package/build/lib/subcommands/location.js.map +1 -1
- package/build/lib/subcommands/openurl.d.ts +15 -17
- package/build/lib/subcommands/openurl.d.ts.map +1 -1
- package/build/lib/subcommands/openurl.js +5 -7
- package/build/lib/subcommands/openurl.js.map +1 -1
- package/build/lib/subcommands/pbcopy.d.ts +14 -17
- package/build/lib/subcommands/pbcopy.d.ts.map +1 -1
- package/build/lib/subcommands/pbcopy.js +5 -7
- package/build/lib/subcommands/pbcopy.js.map +1 -1
- package/build/lib/subcommands/pbpaste.d.ts +14 -17
- package/build/lib/subcommands/pbpaste.d.ts.map +1 -1
- package/build/lib/subcommands/pbpaste.js +5 -7
- package/build/lib/subcommands/pbpaste.js.map +1 -1
- package/build/lib/subcommands/privacy.d.ts +52 -57
- package/build/lib/subcommands/privacy.d.ts.map +1 -1
- package/build/lib/subcommands/privacy.js +15 -17
- package/build/lib/subcommands/privacy.js.map +1 -1
- package/build/lib/subcommands/push.d.ts +22 -25
- package/build/lib/subcommands/push.d.ts.map +1 -1
- package/build/lib/subcommands/push.js +5 -7
- package/build/lib/subcommands/push.js.map +1 -1
- package/build/lib/subcommands/shutdown.d.ts +9 -12
- package/build/lib/subcommands/shutdown.d.ts.map +1 -1
- package/build/lib/subcommands/shutdown.js +5 -40
- package/build/lib/subcommands/shutdown.js.map +1 -1
- package/build/lib/subcommands/spawn.d.ts +24 -27
- package/build/lib/subcommands/spawn.d.ts.map +1 -1
- package/build/lib/subcommands/spawn.js +12 -14
- package/build/lib/subcommands/spawn.js.map +1 -1
- package/build/lib/subcommands/terminate.d.ts +12 -15
- package/build/lib/subcommands/terminate.d.ts.map +1 -1
- package/build/lib/subcommands/terminate.js +4 -6
- package/build/lib/subcommands/terminate.js.map +1 -1
- package/build/lib/subcommands/ui.d.ts +97 -105
- package/build/lib/subcommands/ui.d.ts.map +1 -1
- package/build/lib/subcommands/ui.js +24 -26
- package/build/lib/subcommands/ui.js.map +1 -1
- package/build/lib/subcommands/uninstall.d.ts +13 -16
- package/build/lib/subcommands/uninstall.d.ts.map +1 -1
- package/build/lib/subcommands/uninstall.js +4 -6
- package/build/lib/subcommands/uninstall.js.map +1 -1
- package/build/lib/types.d.ts +231 -0
- package/build/lib/types.d.ts.map +1 -0
- package/build/lib/types.js +3 -0
- package/build/lib/types.js.map +1 -0
- package/index.ts +13 -0
- package/lib/helpers.ts +81 -0
- package/lib/{logger.js → logger.ts} +2 -5
- package/lib/simctl.ts +221 -0
- package/lib/subcommands/{addmedia.js → addmedia.ts} +6 -8
- package/lib/subcommands/appinfo.ts +39 -0
- package/lib/subcommands/{boot.js → boot.ts} +5 -10
- package/lib/subcommands/bootstatus.ts +108 -0
- package/lib/subcommands/{create.js → create.ts} +29 -35
- package/lib/subcommands/{delete.js → delete.ts} +3 -5
- package/lib/subcommands/{erase.js → erase.ts} +4 -7
- package/lib/subcommands/{get_app_container.js → get_app_container.ts} +10 -8
- package/lib/subcommands/{getenv.js → getenv.ts} +5 -7
- package/lib/subcommands/{install.js → install.ts} +4 -6
- package/lib/subcommands/{io.js → io.ts} +4 -7
- package/lib/subcommands/{keychain.js → keychain.ts} +30 -32
- package/lib/subcommands/{launch.js → launch.ts} +9 -12
- package/lib/subcommands/{list.js → list.ts} +67 -60
- package/lib/subcommands/{location.js → location.ts} +15 -14
- package/lib/subcommands/{openurl.js → openurl.ts} +6 -7
- package/lib/subcommands/{pbcopy.js → pbcopy.ts} +11 -8
- package/lib/subcommands/{pbpaste.js → pbpaste.ts} +5 -7
- package/lib/subcommands/{privacy.js → privacy.ts} +13 -17
- package/lib/subcommands/{push.js → push.ts} +5 -8
- package/lib/subcommands/{shutdown.js → shutdown.ts} +5 -8
- package/lib/subcommands/{spawn.js → spawn.ts} +21 -17
- package/lib/subcommands/{terminate.js → terminate.ts} +4 -6
- package/lib/subcommands/{ui.js → ui.ts} +19 -28
- package/lib/subcommands/{uninstall.js → uninstall.ts} +4 -6
- package/lib/types.ts +243 -0
- package/package.json +3 -3
- package/index.js +0 -4
- package/lib/helpers.js +0 -37
- package/lib/simctl.js +0 -299
- package/lib/subcommands/appinfo.js +0 -51
- package/lib/subcommands/bootstatus.js +0 -119
package/build/lib/simctl.js
CHANGED
|
@@ -39,105 +39,47 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.Simctl = void 0;
|
|
40
40
|
const lodash_1 = __importDefault(require("lodash"));
|
|
41
41
|
const which_1 = __importDefault(require("which"));
|
|
42
|
-
const logger_1 =
|
|
42
|
+
const logger_1 = require("./logger");
|
|
43
43
|
const helpers_1 = require("./helpers");
|
|
44
44
|
const teen_process_1 = require("teen_process");
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
const
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
const
|
|
45
|
+
const addmediaCommands = __importStar(require("./subcommands/addmedia"));
|
|
46
|
+
const appinfoCommands = __importStar(require("./subcommands/appinfo"));
|
|
47
|
+
const bootCommands = __importStar(require("./subcommands/boot"));
|
|
48
|
+
const bootstatusCommands = __importStar(require("./subcommands/bootstatus"));
|
|
49
|
+
const createCommands = __importStar(require("./subcommands/create"));
|
|
50
|
+
const deleteCommands = __importStar(require("./subcommands/delete"));
|
|
51
|
+
const eraseCommands = __importStar(require("./subcommands/erase"));
|
|
52
|
+
const getappcontainerCommands = __importStar(require("./subcommands/get_app_container"));
|
|
53
|
+
const installCommands = __importStar(require("./subcommands/install"));
|
|
54
|
+
const ioCommands = __importStar(require("./subcommands/io"));
|
|
55
|
+
const keychainCommands = __importStar(require("./subcommands/keychain"));
|
|
56
|
+
const launchCommands = __importStar(require("./subcommands/launch"));
|
|
57
|
+
const listCommands = __importStar(require("./subcommands/list"));
|
|
58
|
+
const openurlCommands = __importStar(require("./subcommands/openurl"));
|
|
59
|
+
const pbcopyCommands = __importStar(require("./subcommands/pbcopy"));
|
|
60
|
+
const pbpasteCommands = __importStar(require("./subcommands/pbpaste"));
|
|
61
|
+
const privacyCommands = __importStar(require("./subcommands/privacy"));
|
|
62
|
+
const pushCommands = __importStar(require("./subcommands/push"));
|
|
63
|
+
const envCommands = __importStar(require("./subcommands/getenv"));
|
|
64
|
+
const shutdownCommands = __importStar(require("./subcommands/shutdown"));
|
|
65
|
+
const spawnCommands = __importStar(require("./subcommands/spawn"));
|
|
66
|
+
const terminateCommands = __importStar(require("./subcommands/terminate"));
|
|
67
|
+
const uiCommands = __importStar(require("./subcommands/ui"));
|
|
68
|
+
const uninstallCommands = __importStar(require("./subcommands/uninstall"));
|
|
69
|
+
const locationCommands = __importStar(require("./subcommands/location"));
|
|
70
70
|
const SIMCTL_ENV_PREFIX = 'SIMCTL_CHILD_';
|
|
71
|
-
const DEFAULT_OPTS = {
|
|
72
|
-
xcrun: {
|
|
73
|
-
path: null,
|
|
74
|
-
},
|
|
75
|
-
execTimeout: helpers_1.DEFAULT_EXEC_TIMEOUT,
|
|
76
|
-
logErrors: true,
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* @typedef {Object} XCRun
|
|
80
|
-
* @property {string?} path Full path to the xcrun script
|
|
81
|
-
*/
|
|
82
|
-
/**
|
|
83
|
-
* @typedef {{asynchronous: true}} TAsyncOpts
|
|
84
|
-
*/
|
|
85
|
-
/**
|
|
86
|
-
* @typedef {Object} ExecOpts
|
|
87
|
-
* @property {string[]} [args=[]] - The list of additional subcommand arguments.
|
|
88
|
-
* It's empty by default.
|
|
89
|
-
* @property {Record<string, any>} [env={}] - Environment variables mapping. All these variables
|
|
90
|
-
* will be passed Simulator and used in the executing function.
|
|
91
|
-
* @property {boolean} [logErrors=true] - Set it to _false_ to throw execution errors
|
|
92
|
-
* immediately without logging any additional information.
|
|
93
|
-
* @property {boolean} [asynchronous=false] - Whether to execute the given command
|
|
94
|
-
* 'synchronously' or 'asynchronously'. Affects the returned result of the function.
|
|
95
|
-
* @property {string} [encoding] - Explicitly sets streams encoding for the executed
|
|
96
|
-
* command input and outputs.
|
|
97
|
-
* @property {string|string[]} [architectures] - One or more architecture names to be enforced while
|
|
98
|
-
* executing xcrun. See https://github.com/appium/appium/issues/18966 for more details.
|
|
99
|
-
* @property {number} [timeout] - The maximum number of milliseconds
|
|
100
|
-
* to wait for single synchronous xcrun command. If not provided explicitly, then
|
|
101
|
-
* the value of execTimeout property is used by default.
|
|
102
|
-
*/
|
|
103
|
-
/**
|
|
104
|
-
* @typedef {Object} SimctlOpts
|
|
105
|
-
* @property {XCRun} [xcrun] - The xcrun properties. Currently only one property
|
|
106
|
-
* is supported, which is `path` and it by default contains `null`, which enforces
|
|
107
|
-
* the instance to automatically detect the full path to `xcrun` tool and to throw
|
|
108
|
-
* an exception if it cannot be detected. If the path is set upon instance creation
|
|
109
|
-
* then it is going to be used by `exec` and no autodetection will happen.
|
|
110
|
-
* @property {number} [execTimeout=600000] - The default maximum number of milliseconds
|
|
111
|
-
* to wait for single synchronous xcrun command.
|
|
112
|
-
* @property {boolean} [logErrors=true] - Whether to wire xcrun error messages
|
|
113
|
-
* into debug log before throwing them.
|
|
114
|
-
* @property {string?} [udid] - The unique identifier of the current device, which is
|
|
115
|
-
* going to be implicitly passed to all methods, which require it. It can either be set
|
|
116
|
-
* upon instance creation if it is already known in advance or later when/if needed via the
|
|
117
|
-
* corresponding instance setter.
|
|
118
|
-
* @property {string?} [devicesSetPath] - Full path to the set of devices that you want to manage.
|
|
119
|
-
* By default this path usually equals to ~/Library/Developer/CoreSimulator/Devices
|
|
120
|
-
*/
|
|
121
71
|
class Simctl {
|
|
122
|
-
/** @type {XCRun} */
|
|
123
72
|
xcrun;
|
|
124
|
-
/** @type {number} */
|
|
125
73
|
execTimeout;
|
|
126
|
-
/** @type {boolean} */
|
|
127
74
|
logErrors;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
*/
|
|
75
|
+
_udid;
|
|
76
|
+
_devicesSetPath;
|
|
131
77
|
constructor(opts = {}) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
/** @type {string?} */
|
|
138
|
-
this._udid = lodash_1.default.isNil(opts.udid) ? null : opts.udid;
|
|
139
|
-
/** @type {string?} */
|
|
140
|
-
this._devicesSetPath = lodash_1.default.isNil(opts.devicesSetPath) ? null : opts.devicesSetPath;
|
|
78
|
+
this.xcrun = lodash_1.default.cloneDeep(opts.xcrun ?? { path: null });
|
|
79
|
+
this.execTimeout = opts.execTimeout ?? helpers_1.DEFAULT_EXEC_TIMEOUT;
|
|
80
|
+
this.logErrors = opts.logErrors ?? true;
|
|
81
|
+
this._udid = opts.udid ?? null;
|
|
82
|
+
this._devicesSetPath = opts.devicesSetPath ?? null;
|
|
141
83
|
}
|
|
142
84
|
set udid(value) {
|
|
143
85
|
this._udid = value;
|
|
@@ -152,8 +94,9 @@ class Simctl {
|
|
|
152
94
|
return this._devicesSetPath;
|
|
153
95
|
}
|
|
154
96
|
/**
|
|
155
|
-
* @param
|
|
156
|
-
* @returns
|
|
97
|
+
* @param commandName - Optional command name for error message
|
|
98
|
+
* @returns The UDID string
|
|
99
|
+
* @throws {Error} If UDID is not set
|
|
157
100
|
*/
|
|
158
101
|
requireUdid(commandName = null) {
|
|
159
102
|
if (!this.udid) {
|
|
@@ -163,7 +106,7 @@ class Simctl {
|
|
|
163
106
|
return this.udid;
|
|
164
107
|
}
|
|
165
108
|
/**
|
|
166
|
-
* @returns
|
|
109
|
+
* @returns Promise resolving to the xcrun binary path
|
|
167
110
|
*/
|
|
168
111
|
async requireXcrun() {
|
|
169
112
|
const xcrunBinary = (0, helpers_1.getXcrunBinary)();
|
|
@@ -176,32 +119,33 @@ class Simctl {
|
|
|
176
119
|
`Are Xcode developers tools installed?`);
|
|
177
120
|
}
|
|
178
121
|
}
|
|
179
|
-
|
|
122
|
+
if (!this.xcrun.path) {
|
|
123
|
+
throw new Error(`${xcrunBinary} tool path is not set`);
|
|
124
|
+
}
|
|
125
|
+
return this.xcrun.path;
|
|
180
126
|
}
|
|
181
127
|
/**
|
|
182
128
|
* Execute the particular simctl command.
|
|
183
129
|
*
|
|
184
|
-
* @
|
|
185
|
-
* @param {string} subcommand - One of available simctl subcommands.
|
|
130
|
+
* @param subcommand - One of available simctl subcommands.
|
|
186
131
|
* Execute `xcrun simctl` in Terminal to see the full list of available subcommands.
|
|
187
|
-
* @param
|
|
188
|
-
* @return
|
|
189
|
-
* Either the result of teen process's `exec` or
|
|
132
|
+
* @param opts - Execution options
|
|
133
|
+
* @return Either the result of teen process's `exec` or
|
|
190
134
|
* `SubProcess` instance depending of `opts.asynchronous` value.
|
|
191
135
|
* @throws {Error} If the simctl subcommand command returns non-zero return code.
|
|
192
136
|
*/
|
|
193
137
|
async exec(subcommand, opts) {
|
|
194
|
-
|
|
138
|
+
const { args: initialArgs = [], env: initialEnv = {}, asynchronous = false, encoding, logErrors = true, architectures, timeout, } = opts ?? {};
|
|
195
139
|
// run a particular simctl command
|
|
196
|
-
args = [
|
|
140
|
+
const args = [
|
|
197
141
|
'simctl',
|
|
198
142
|
...(this.devicesSetPath ? ['--set', this.devicesSetPath] : []),
|
|
199
143
|
subcommand,
|
|
200
|
-
...
|
|
144
|
+
...initialArgs
|
|
201
145
|
];
|
|
202
146
|
// Prefix all passed in environment variables with 'SIMCTL_CHILD_', simctl
|
|
203
147
|
// will then pass these to the child (spawned) process.
|
|
204
|
-
env = lodash_1.default.defaults(lodash_1.default.mapKeys(
|
|
148
|
+
const env = lodash_1.default.defaults(lodash_1.default.mapKeys(initialEnv, (value, key) => lodash_1.default.startsWith(key, SIMCTL_ENV_PREFIX) ? key : `${SIMCTL_ENV_PREFIX}${key}`), process.env);
|
|
205
149
|
const execOpts = {
|
|
206
150
|
env,
|
|
207
151
|
encoding,
|
|
@@ -211,13 +155,16 @@ class Simctl {
|
|
|
211
155
|
}
|
|
212
156
|
const xcrun = await this.requireXcrun();
|
|
213
157
|
try {
|
|
214
|
-
let execArgs
|
|
158
|
+
let execArgs;
|
|
215
159
|
if (architectures?.length) {
|
|
216
160
|
const archArgs = lodash_1.default.flatMap((lodash_1.default.isArray(architectures) ? architectures : [architectures]).map((arch) => ['-arch', arch]));
|
|
217
161
|
execArgs = ['arch', [...archArgs, xcrun, ...args], execOpts];
|
|
218
162
|
}
|
|
219
|
-
|
|
220
|
-
|
|
163
|
+
else {
|
|
164
|
+
execArgs = [xcrun, args, execOpts];
|
|
165
|
+
}
|
|
166
|
+
// We know what we are doing here - the type system can't handle the dynamic nature
|
|
167
|
+
return (asynchronous ? new teen_process_1.SubProcess(...execArgs) : await (0, teen_process_1.exec)(...execArgs));
|
|
221
168
|
}
|
|
222
169
|
catch (e) {
|
|
223
170
|
if (!this.logErrors || !logErrors) {
|
|
@@ -226,56 +173,57 @@ class Simctl {
|
|
|
226
173
|
}
|
|
227
174
|
else if (e.stderr) {
|
|
228
175
|
const msg = `Error running '${subcommand}': ${e.stderr.trim()}`;
|
|
229
|
-
logger_1.
|
|
176
|
+
logger_1.log.debug(logger_1.LOG_PREFIX, msg);
|
|
230
177
|
e.message = msg;
|
|
231
178
|
}
|
|
232
179
|
else {
|
|
233
|
-
logger_1.
|
|
180
|
+
logger_1.log.debug(logger_1.LOG_PREFIX, e.message);
|
|
234
181
|
}
|
|
235
182
|
throw e;
|
|
236
183
|
}
|
|
237
184
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
185
|
+
// Extension methods
|
|
186
|
+
addMedia = addmediaCommands.addMedia;
|
|
187
|
+
appInfo = appinfoCommands.appInfo;
|
|
188
|
+
bootDevice = bootCommands.bootDevice;
|
|
189
|
+
startBootMonitor = bootstatusCommands.startBootMonitor;
|
|
190
|
+
createDevice = createCommands.createDevice;
|
|
191
|
+
deleteDevice = deleteCommands.deleteDevice;
|
|
192
|
+
eraseDevice = eraseCommands.eraseDevice;
|
|
193
|
+
getAppContainer = getappcontainerCommands.getAppContainer;
|
|
194
|
+
getEnv = envCommands.getEnv;
|
|
195
|
+
installApp = installCommands.installApp;
|
|
196
|
+
getScreenshot = ioCommands.getScreenshot;
|
|
197
|
+
addRootCertificate = keychainCommands.addRootCertificate;
|
|
198
|
+
addCertificate = keychainCommands.addCertificate;
|
|
199
|
+
resetKeychain = keychainCommands.resetKeychain;
|
|
200
|
+
launchApp = launchCommands.launchApp;
|
|
201
|
+
getDevicesByParsing = listCommands.getDevicesByParsing;
|
|
202
|
+
getDevices = listCommands.getDevices;
|
|
203
|
+
getRuntimeForPlatformVersionViaJson = listCommands.getRuntimeForPlatformVersionViaJson;
|
|
204
|
+
getRuntimeForPlatformVersion = listCommands.getRuntimeForPlatformVersion;
|
|
205
|
+
getDeviceTypes = listCommands.getDeviceTypes;
|
|
206
|
+
list = listCommands.list;
|
|
207
|
+
setLocation = locationCommands.setLocation;
|
|
208
|
+
clearLocation = locationCommands.clearLocation;
|
|
209
|
+
openUrl = openurlCommands.openUrl;
|
|
210
|
+
setPasteboard = pbcopyCommands.setPasteboard;
|
|
211
|
+
getPasteboard = pbpasteCommands.getPasteboard;
|
|
212
|
+
grantPermission = privacyCommands.grantPermission;
|
|
213
|
+
revokePermission = privacyCommands.revokePermission;
|
|
214
|
+
resetPermission = privacyCommands.resetPermission;
|
|
215
|
+
pushNotification = pushCommands.pushNotification;
|
|
216
|
+
shutdownDevice = shutdownCommands.shutdownDevice;
|
|
217
|
+
spawnProcess = spawnCommands.spawnProcess;
|
|
218
|
+
spawnSubProcess = spawnCommands.spawnSubProcess;
|
|
219
|
+
terminateApp = terminateCommands.terminateApp;
|
|
220
|
+
getAppearance = uiCommands.getAppearance;
|
|
221
|
+
setAppearance = uiCommands.setAppearance;
|
|
222
|
+
getIncreaseContrast = uiCommands.getIncreaseContrast;
|
|
223
|
+
setIncreaseContrast = uiCommands.setIncreaseContrast;
|
|
224
|
+
getContentSize = uiCommands.getContentSize;
|
|
225
|
+
setContentSize = uiCommands.setContentSize;
|
|
226
|
+
removeApp = uninstallCommands.removeApp;
|
|
279
227
|
}
|
|
280
228
|
exports.Simctl = Simctl;
|
|
281
229
|
exports.default = Simctl;
|
package/build/lib/simctl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simctl.js","sourceRoot":"","sources":["../../lib/simctl.
|
|
1
|
+
{"version":3,"file":"simctl.js","sourceRoot":"","sources":["../../lib/simctl.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAuB;AACvB,kDAA0B;AAC1B,qCAA2C;AAC3C,uCAEmB;AACnB,+CAA0D;AAC1D,yEAA2D;AAC3D,uEAAyD;AACzD,iEAAmD;AACnD,6EAA+D;AAC/D,qEAAuD;AACvD,qEAAuD;AACvD,mEAAqD;AACrD,yFAA2E;AAC3E,uEAAyD;AACzD,6DAA+C;AAC/C,yEAA2D;AAC3D,qEAAuD;AACvD,iEAAmD;AACnD,uEAAyD;AACzD,qEAAuD;AACvD,uEAAyD;AACzD,uEAAyD;AACzD,iEAAmD;AACnD,kEAAoD;AACpD,yEAA2D;AAC3D,mEAAqD;AACrD,2EAA6D;AAC7D,6DAA+C;AAC/C,2EAA6D;AAC7D,yEAA2D;AA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15
|
-
function addMedia(this: import("../simctl").default, filePath: string): Promise<import("teen_process").TeenProcessExecResult<any>>;
|
|
16
|
-
}
|
|
1
|
+
import type { Simctl } from '../simctl';
|
|
2
|
+
import type { TeenProcessExecResult } from 'teen_process';
|
|
3
|
+
/**
|
|
4
|
+
* Add the particular media file to Simulator's library.
|
|
5
|
+
* It is required that Simulator is in _booted_ state.
|
|
6
|
+
*
|
|
7
|
+
* @param filePath - Full path to a media file on the local
|
|
8
|
+
* file system.
|
|
9
|
+
* @return Command execution result.
|
|
10
|
+
* @throws {Error} If the corresponding simctl subcommand command
|
|
11
|
+
* returns non-zero return code.
|
|
12
|
+
* @throws {Error} If the `udid` instance property is unset
|
|
13
|
+
*/
|
|
14
|
+
export declare function addMedia(this: Simctl, filePath: string): Promise<TeenProcessExecResult<string>>;
|
|
17
15
|
//# sourceMappingURL=addmedia.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addmedia.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/addmedia.
|
|
1
|
+
{"version":3,"file":"addmedia.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/addmedia.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE1D;;;;;;;;;;GAUG;AACH,wBAAsB,QAAQ,CAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAItG"}
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
exports.addMedia = addMedia;
|
|
4
4
|
/**
|
|
5
5
|
* Add the particular media file to Simulator's library.
|
|
6
6
|
* It is required that Simulator is in _booted_ state.
|
|
7
7
|
*
|
|
8
|
-
* @
|
|
9
|
-
* @param {string} filePath - Full path to a media file on the local
|
|
8
|
+
* @param filePath - Full path to a media file on the local
|
|
10
9
|
* file system.
|
|
11
|
-
* @return
|
|
10
|
+
* @return Command execution result.
|
|
12
11
|
* @throws {Error} If the corresponding simctl subcommand command
|
|
13
12
|
* returns non-zero return code.
|
|
14
13
|
* @throws {Error} If the `udid` instance property is unset
|
|
15
14
|
*/
|
|
16
|
-
|
|
15
|
+
async function addMedia(filePath) {
|
|
17
16
|
return await this.exec('addmedia', {
|
|
18
17
|
args: [this.requireUdid('addmedia'), filePath],
|
|
19
18
|
});
|
|
20
|
-
}
|
|
21
|
-
exports.default = commands;
|
|
19
|
+
}
|
|
22
20
|
//# sourceMappingURL=addmedia.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addmedia.js","sourceRoot":"","sources":["../../../lib/subcommands/addmedia.
|
|
1
|
+
{"version":3,"file":"addmedia.js","sourceRoot":"","sources":["../../../lib/subcommands/addmedia.ts"],"names":[],"mappings":";;AAcA,4BAIC;AAfD;;;;;;;;;;GAUG;AACI,KAAK,UAAU,QAAQ,CAAgB,QAAgB;IAC5D,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;QACjC,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC;KAC/C,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,46 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
* Example output for non-existing application container:
|
|
15
|
-
* <pre>
|
|
16
|
-
* {
|
|
17
|
-
* CFBundleIdentifier = "com.apple.MobileSafari";
|
|
18
|
-
* GroupContainers = {
|
|
19
|
-
* };
|
|
20
|
-
* SBAppTags = (
|
|
21
|
-
* );
|
|
22
|
-
* }
|
|
23
|
-
* </pre>
|
|
24
|
-
*
|
|
25
|
-
* Example output for an existing system application container:
|
|
26
|
-
* <pre>
|
|
27
|
-
* {
|
|
28
|
-
* ApplicationType = Hidden;
|
|
29
|
-
* Bundle = "file:///Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/CoreServices/SpringBoard.app";
|
|
30
|
-
* CFBundleDisplayName = SpringBoard;
|
|
31
|
-
* CFBundleExecutable = SpringBoard;
|
|
32
|
-
* CFBundleIdentifier = "com.apple.springboard";
|
|
33
|
-
* CFBundleName = SpringBoard;
|
|
34
|
-
* CFBundleVersion = 50;
|
|
35
|
-
* GroupContainers = {
|
|
36
|
-
* };
|
|
37
|
-
* Path = "/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/CoreServices/SpringBoard.app";
|
|
38
|
-
* SBAppTags = (
|
|
39
|
-
* );
|
|
40
|
-
* }
|
|
41
|
-
* </pre>
|
|
42
|
-
* @throws {Error} If the `udid` instance property is unset
|
|
43
|
-
*/
|
|
44
|
-
function appInfo(this: import("../simctl").default, bundleId: string): Promise<string>;
|
|
45
|
-
}
|
|
1
|
+
import type { Simctl } from '../simctl';
|
|
2
|
+
import type { AppInfo } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Get information about an app installed on the simulator
|
|
5
|
+
*
|
|
6
|
+
* @param bundleId - Bundle identifier of the application
|
|
7
|
+
* @return App info object
|
|
8
|
+
* @throws {Error} If the app is not found
|
|
9
|
+
* @throws {Error} If the corresponding simctl subcommand command
|
|
10
|
+
* returns non-zero return code.
|
|
11
|
+
* @throws {Error} If the `udid` instance property is unset
|
|
12
|
+
*/
|
|
13
|
+
export declare function appInfo(this: Simctl, bundleId: string): Promise<AppInfo>;
|
|
46
14
|
//# sourceMappingURL=appinfo.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appinfo.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/appinfo.
|
|
1
|
+
{"version":3,"file":"appinfo.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/appinfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAIxC;;;;;;;;;GASG;AACH,wBAAsB,OAAO,CAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAuB/E"}
|
|
@@ -1,52 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
exports.appInfo = appInfo;
|
|
7
|
+
const helpers_1 = require("../helpers");
|
|
8
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
4
9
|
/**
|
|
5
|
-
*
|
|
6
|
-
* about applications installed on Simulator, including
|
|
7
|
-
* system applications ({@link getAppContainer} does not "see" such apps).
|
|
8
|
-
* Simulator server should be in 'booted' state for this call to work properly.
|
|
9
|
-
* The tool is only available since Xcode SDK 8.1
|
|
10
|
-
*
|
|
11
|
-
* @this {import('../simctl').Simctl}
|
|
12
|
-
* @param {string} bundleId - The bundle identifier of the target application.
|
|
13
|
-
* @return {Promise<string>} The information about installed application.
|
|
10
|
+
* Get information about an app installed on the simulator
|
|
14
11
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* {
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* };
|
|
21
|
-
* SBAppTags = (
|
|
22
|
-
* );
|
|
23
|
-
* }
|
|
24
|
-
* </pre>
|
|
25
|
-
*
|
|
26
|
-
* Example output for an existing system application container:
|
|
27
|
-
* <pre>
|
|
28
|
-
* {
|
|
29
|
-
* ApplicationType = Hidden;
|
|
30
|
-
* Bundle = "file:///Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/CoreServices/SpringBoard.app";
|
|
31
|
-
* CFBundleDisplayName = SpringBoard;
|
|
32
|
-
* CFBundleExecutable = SpringBoard;
|
|
33
|
-
* CFBundleIdentifier = "com.apple.springboard";
|
|
34
|
-
* CFBundleName = SpringBoard;
|
|
35
|
-
* CFBundleVersion = 50;
|
|
36
|
-
* GroupContainers = {
|
|
37
|
-
* };
|
|
38
|
-
* Path = "/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/CoreServices/SpringBoard.app";
|
|
39
|
-
* SBAppTags = (
|
|
40
|
-
* );
|
|
41
|
-
* }
|
|
42
|
-
* </pre>
|
|
12
|
+
* @param bundleId - Bundle identifier of the application
|
|
13
|
+
* @return App info object
|
|
14
|
+
* @throws {Error} If the app is not found
|
|
15
|
+
* @throws {Error} If the corresponding simctl subcommand command
|
|
16
|
+
* returns non-zero return code.
|
|
43
17
|
* @throws {Error} If the `udid` instance property is unset
|
|
44
18
|
*/
|
|
45
|
-
|
|
19
|
+
async function appInfo(bundleId) {
|
|
46
20
|
const { stdout } = await this.exec('appinfo', {
|
|
47
21
|
args: [this.requireUdid('appinfo'), bundleId],
|
|
48
22
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
23
|
+
let result;
|
|
24
|
+
try {
|
|
25
|
+
result = JSON.parse(stdout);
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
// If JSON parsing fails, use plutil to convert plist-style output to JSON
|
|
29
|
+
try {
|
|
30
|
+
result = await (0, helpers_1.convertPlistToJson)(stdout);
|
|
31
|
+
}
|
|
32
|
+
catch (err) {
|
|
33
|
+
throw new Error(`Cannot retrieve app info for ${bundleId}: ${err instanceof Error ? err.message : String(err)}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (!lodash_1.default.isPlainObject(result) || !('ApplicationType' in result)) {
|
|
37
|
+
throw new Error(`App with bundle identifier "${bundleId}" not found. Is it installed?`);
|
|
38
|
+
}
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
52
41
|
//# sourceMappingURL=appinfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appinfo.js","sourceRoot":"","sources":["../../../lib/subcommands/appinfo.
|
|
1
|
+
{"version":3,"file":"appinfo.js","sourceRoot":"","sources":["../../../lib/subcommands/appinfo.ts"],"names":[],"mappings":";;;;;AAeA,0BAuBC;AApCD,wCAAgD;AAChD,oDAAuB;AAEvB;;;;;;;;;GASG;AACI,KAAK,UAAU,OAAO,CAAgB,QAAgB;IAC3D,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;QAC1C,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC;KAC9C,CAAC,CAAC;IACH,IAAI,MAAW,CAAC;IAChB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;IAAC,MAAM,CAAC;QACP,0EAA0E;QAC1E,IAAI,CAAC;YACH,MAAM,GAAG,MAAM,IAAA,4BAAkB,EAAC,MAAM,CAAC,CAAC;QAC5C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CACb,gCAAgC,QAAQ,KAAK,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAChG,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAI,CAAC,gBAAC,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,iBAAiB,IAAI,MAAM,CAAC,EAAE,CAAC;QAC/D,MAAM,IAAI,KAAK,CAAC,+BAA+B,QAAQ,+BAA+B,CAAC,CAAC;IAC1F,CAAC;IAED,OAAO,MAAiB,CAAC;AAC3B,CAAC"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
function bootDevice(this: import("../simctl").default): Promise<void>;
|
|
12
|
-
}
|
|
1
|
+
import type { Simctl } from '../simctl';
|
|
2
|
+
/**
|
|
3
|
+
* Boot the particular Simulator if it is not running.
|
|
4
|
+
*
|
|
5
|
+
* @throws {Error} If the corresponding simctl subcommand command
|
|
6
|
+
* returns non-zero return code.
|
|
7
|
+
* @throws {Error} If the `udid` instance property is unset
|
|
8
|
+
*/
|
|
9
|
+
export declare function bootDevice(this: Simctl): Promise<void>;
|
|
13
10
|
//# sourceMappingURL=boot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/boot.
|
|
1
|
+
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/boot.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAW7D"}
|