appium-xcuitest-driver 10.8.2 → 10.8.4

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 (71) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/lib/commands/app-management.js +1 -1
  3. package/build/lib/commands/app-management.js.map +1 -1
  4. package/build/lib/commands/file-movement.d.ts.map +1 -1
  5. package/build/lib/commands/file-movement.js +4 -4
  6. package/build/lib/commands/file-movement.js.map +1 -1
  7. package/build/lib/commands/memory.js +1 -1
  8. package/build/lib/commands/memory.js.map +1 -1
  9. package/build/lib/commands/performance.d.ts.map +1 -1
  10. package/build/lib/commands/performance.js +13 -4
  11. package/build/lib/commands/performance.js.map +1 -1
  12. package/build/lib/commands/xctest-record-screen.js +1 -1
  13. package/build/lib/commands/xctest-record-screen.js.map +1 -1
  14. package/build/lib/desired-caps.d.ts +9 -7
  15. package/build/lib/desired-caps.d.ts.map +1 -1
  16. package/build/lib/desired-caps.js +1 -0
  17. package/build/lib/desired-caps.js.map +1 -1
  18. package/build/lib/device/device-connections-factory.d.ts +18 -0
  19. package/build/lib/device/device-connections-factory.d.ts.map +1 -0
  20. package/build/lib/{device-connections-factory.js → device/device-connections-factory.js} +57 -41
  21. package/build/lib/device/device-connections-factory.js.map +1 -0
  22. package/build/lib/device/real-device-management.d.ts +146 -0
  23. package/build/lib/device/real-device-management.d.ts.map +1 -0
  24. package/build/lib/device/real-device-management.js +727 -0
  25. package/build/lib/device/real-device-management.js.map +1 -0
  26. package/build/lib/device/simulator-management.d.ts +65 -0
  27. package/build/lib/device/simulator-management.d.ts.map +1 -0
  28. package/build/lib/{simulator-management.js → device/simulator-management.js} +23 -42
  29. package/build/lib/device/simulator-management.js.map +1 -0
  30. package/build/lib/driver.d.ts +4 -1
  31. package/build/lib/driver.d.ts.map +1 -1
  32. package/build/lib/driver.js +5 -6
  33. package/build/lib/driver.js.map +1 -1
  34. package/lib/commands/app-management.js +1 -1
  35. package/lib/commands/file-movement.js +8 -4
  36. package/lib/commands/memory.js +1 -1
  37. package/lib/commands/performance.js +12 -1
  38. package/lib/commands/xctest-record-screen.js +1 -1
  39. package/lib/desired-caps.js +1 -0
  40. package/lib/{device-connections-factory.js → device/device-connections-factory.ts} +96 -60
  41. package/lib/device/real-device-management.ts +818 -0
  42. package/lib/{simulator-management.js → device/simulator-management.ts} +68 -61
  43. package/lib/driver.js +3 -5
  44. package/npm-shrinkwrap.json +2 -2
  45. package/package.json +1 -1
  46. package/build/lib/device-connections-factory.d.ts +0 -13
  47. package/build/lib/device-connections-factory.d.ts.map +0 -1
  48. package/build/lib/device-connections-factory.js.map +0 -1
  49. package/build/lib/ios-fs-helpers.d.ts +0 -75
  50. package/build/lib/ios-fs-helpers.d.ts.map +0 -1
  51. package/build/lib/ios-fs-helpers.js +0 -370
  52. package/build/lib/ios-fs-helpers.js.map +0 -1
  53. package/build/lib/real-device-management.d.ts +0 -53
  54. package/build/lib/real-device-management.d.ts.map +0 -1
  55. package/build/lib/real-device-management.js +0 -128
  56. package/build/lib/real-device-management.js.map +0 -1
  57. package/build/lib/real-device.d.ts +0 -112
  58. package/build/lib/real-device.d.ts.map +0 -1
  59. package/build/lib/real-device.js +0 -352
  60. package/build/lib/real-device.js.map +0 -1
  61. package/build/lib/simulator-management.d.ts +0 -96
  62. package/build/lib/simulator-management.d.ts.map +0 -1
  63. package/build/lib/simulator-management.js.map +0 -1
  64. package/build/lib/xcrun.d.ts +0 -3
  65. package/build/lib/xcrun.d.ts.map +0 -1
  66. package/build/lib/xcrun.js +0 -17
  67. package/build/lib/xcrun.js.map +0 -1
  68. package/lib/ios-fs-helpers.js +0 -355
  69. package/lib/real-device-management.js +0 -133
  70. package/lib/real-device.js +0 -347
  71. package/lib/xcrun.js +0 -16
@@ -1,25 +1,25 @@
1
- import {getSimulator} from 'appium-ios-simulator';
1
+ import {getSimulator, type Simulator, type LocalizationOptions} from 'appium-ios-simulator';
2
2
  import {Simctl} from 'node-simctl';
3
3
  import {resetTestProcesses} from 'appium-webdriveragent';
4
4
  import _ from 'lodash';
5
5
  import {util, timing} from 'appium/support';
6
- import {UDID_AUTO, normalizePlatformName} from './utils';
7
- import {buildSafariPreferences} from './app-utils';
6
+ import {UDID_AUTO, normalizePlatformName} from '../utils';
7
+ import {buildSafariPreferences} from '../app-utils';
8
+ import type { XCUITestDriver } from '../driver';
8
9
 
9
10
  const APPIUM_SIM_PREFIX = 'appiumTest';
10
11
 
11
12
  /**
12
13
  * Create a new simulator with `appiumTest-` prefix and return the object.
13
14
  *
14
- * @this {import('./driver').XCUITestDriver}
15
- * @returns {Promise<object>} Simulator object associated with the udid passed in.
15
+ * @returns Simulator object associated with the udid passed in.
16
16
  */
17
- export async function createSim() {
17
+ export async function createSim(this: XCUITestDriver): Promise<Simulator> {
18
18
  const {simulatorDevicesSetPath: devicesSetPath, deviceName, platformVersion} = this.opts;
19
19
  const platform = normalizePlatformName(this.opts.platformName);
20
20
  const simctl = new Simctl({devicesSetPath});
21
21
  if (!deviceName) {
22
- let deviceNames = 'none';
22
+ let deviceNames: string | string[] = 'none';
23
23
  try {
24
24
  deviceNames = (await simctl
25
25
  .getDevices(platformVersion, platform))
@@ -47,22 +47,12 @@ export async function createSim() {
47
47
  });
48
48
  }
49
49
 
50
- /**
51
- * @typedef {Object} SimulatorLookupOptions
52
- * @property {string} [deviceName] - The name of the device to lookup
53
- * @property {string} platformVersion - The platform version string
54
- * @property {string} [simulatorDevicesSetPath] - The full path to the simulator devices set
55
- * @property {string} [udid] - Simulator udid
56
- * @property {string} [platformName] The name of the current platform
57
- */
58
-
59
50
  /**
60
51
  * Get an existing simulator matching the provided capabilities.
61
52
  *
62
- * @this {import('./driver').XCUITestDriver}
63
- * @returns {Promise<import('./driver').Simulator|null>} The matched Simulator instance or `null` if no matching device is found.
53
+ * @returns The matched Simulator instance or `null` if no matching device is found.
64
54
  */
65
- export async function getExistingSim() {
55
+ export async function getExistingSim(this: XCUITestDriver): Promise<Simulator | null> {
66
56
  const {
67
57
  platformVersion,
68
58
  deviceName,
@@ -72,7 +62,7 @@ export async function getExistingSim() {
72
62
  } = this.opts;
73
63
 
74
64
  const platform = normalizePlatformName(platformName);
75
- const selectSim = async (/** @type {{ udid: string; platform: string; }} */ dev) =>
65
+ const selectSim = async (dev: { udid: string; platform: string; }): Promise<Simulator> =>
76
66
  await getSimulator(dev.udid, {
77
67
  platform,
78
68
  checkExistence: false,
@@ -82,7 +72,7 @@ export async function getExistingSim() {
82
72
  });
83
73
 
84
74
  const simctl = new Simctl({devicesSetPath});
85
- let devicesMap;
75
+ let devicesMap: Record<string, any[]> | undefined;
86
76
  if (udid && _.toLower(udid) !== UDID_AUTO) {
87
77
  this.log.debug(`Looking for an existing Simulator with UDID '${udid}'`);
88
78
  devicesMap = await simctl.getDevices(null, platform);
@@ -123,21 +113,23 @@ export async function getExistingSim() {
123
113
  }
124
114
 
125
115
  /**
126
- * @this {import('./driver').XCUITestDriver}
116
+ * Shutdown simulator
127
117
  */
128
- export async function shutdownSimulator() {
129
- const device = /** @type {import('./driver').Simulator} */ (this.device);
118
+ export async function shutdownSimulator(this: XCUITestDriver): Promise<void> {
119
+ const device = this.device as Simulator;
130
120
  // stop XCTest processes if running to avoid unexpected side effects
131
121
  await resetTestProcesses(device.udid, true);
132
122
  await device.shutdown();
133
123
  }
134
124
 
135
125
  /**
136
- * @this {import('./driver').XCUITestDriver}
137
- * @property {boolean} [enforceSimulatorShutdown=false]
138
- * @returns {Promise<void>}
126
+ * Run simulator reset
127
+ * @param enforceSimulatorShutdown Whether to enforce simulator shutdown
139
128
  */
140
- export async function runSimulatorReset(enforceSimulatorShutdown = false) {
129
+ export async function runSimulatorReset(
130
+ this: XCUITestDriver,
131
+ enforceSimulatorShutdown: boolean = false
132
+ ): Promise<void> {
141
133
  const {
142
134
  noReset,
143
135
  fullReset,
@@ -152,7 +144,7 @@ export async function runSimulatorReset(enforceSimulatorShutdown = false) {
152
144
  this.log.debug('Reset: noReset is on. Leaving simulator as is');
153
145
  return;
154
146
  }
155
- const device = /** @type {import('./driver').Simulator} */ (this.device);
147
+ const device = this.device as Simulator;
156
148
 
157
149
  if (!this.device) {
158
150
  this.log.debug('Reset: no device available. Skipping');
@@ -194,8 +186,8 @@ export async function runSimulatorReset(enforceSimulatorShutdown = false) {
194
186
  await device.scrubApp(bundleId);
195
187
  }
196
188
  } catch (err) {
197
- this.log.debug(err.stack);
198
- this.log.warn(err.message);
189
+ this.log.debug((err as Error).stack);
190
+ this.log.warn((err as Error).message);
199
191
  this.log.warn(
200
192
  `Reset: could not scrub ${
201
193
  isSafari ? 'Safari browser' : 'application with id "' + this.opts.bundleId + '"'
@@ -205,36 +197,30 @@ export async function runSimulatorReset(enforceSimulatorShutdown = false) {
205
197
  }
206
198
 
207
199
  if (enforceSimulatorShutdown && (await device.isRunning())) {
208
- await shutdownSimulator.bind(this)(device);
200
+ await shutdownSimulator.bind(this)();
209
201
  }
210
202
  }
211
203
  }
212
204
 
213
205
  /**
214
- * @typedef {Object} InstallOptions
215
- *
216
- * @property {boolean} [skipUninstall] Whether to skip app uninstall before installing it
217
- * @property {boolean} [newSimulator=false] Whether the simulator is brand new
218
- */
219
-
220
- /**
221
- * @this {import('./driver').XCUITestDriver}
222
- * @param {string} app The app to the path
223
- * @param {string} [bundleId] The bundle id to ensure it is already installed and uninstall it
224
- * @param {InstallOptions} [opts={}]
206
+ * Install app to simulator
207
+ * @param app The app to the path
208
+ * @param bundleId The bundle id to ensure it is already installed and uninstall it
209
+ * @param opts Install options
225
210
  */
226
211
  export async function installToSimulator(
227
- app,
228
- bundleId,
229
- opts = {},
230
- ) {
212
+ this: XCUITestDriver,
213
+ app: string,
214
+ bundleId?: string,
215
+ opts: SimulatorInstallOptions = {},
216
+ ): Promise<void> {
231
217
  if (!app) {
232
218
  this.log.debug('No app path is given. Nothing to install.');
233
219
  return;
234
220
  }
235
221
 
236
222
  const {skipUninstall, newSimulator = false} = opts;
237
- const device = /** @type {import('./driver').Simulator} */ (this.device);
223
+ const device = this.device as Simulator;
238
224
 
239
225
  if (!skipUninstall && !newSimulator && bundleId && (await device.isAppInstalled(bundleId))) {
240
226
  this.log.debug(`Reset requested. Removing app with id '${bundleId}' from the device`);
@@ -248,10 +234,10 @@ export async function installToSimulator(
248
234
  }
249
235
 
250
236
  /**
251
- * @this {import('./driver').XCUITestDriver}
237
+ * Shutdown other simulators
252
238
  */
253
- export async function shutdownOtherSimulators() {
254
- const device = /** @type {import('./driver').Simulator} */ (this.device);
239
+ export async function shutdownOtherSimulators(this: XCUITestDriver): Promise<void> {
240
+ const device = this.device as Simulator;
255
241
  const simctl = new Simctl({
256
242
  devicesSetPath: device.devicesSetPath,
257
243
  });
@@ -281,30 +267,27 @@ export async function shutdownOtherSimulators() {
281
267
  /**
282
268
  * Configures Safari options based on the given session capabilities
283
269
  *
284
- * @this {import('./driver').XCUITestDriver}
285
- * @return {Promise<boolean>} true if any preferences have been updated
270
+ * @returns true if any preferences have been updated
286
271
  */
287
- export async function setSafariPrefs() {
272
+ export async function setSafariPrefs(this: XCUITestDriver): Promise<boolean> {
288
273
  const prefs = buildSafariPreferences(this.opts);
289
274
  if (_.isEmpty(prefs)) {
290
275
  return false;
291
276
  }
292
277
 
293
278
  this.log.debug(`About to update Safari preferences: ${JSON.stringify(prefs)}`);
294
- await /** @type {import('./driver').Simulator} */ (this.device).updateSafariSettings(prefs);
279
+ await (this.device as Simulator).updateSafariSettings(prefs);
295
280
  return true;
296
281
  }
297
282
 
298
283
  /**
299
284
  * Changes Simulator localization preferences
300
285
  *
301
- * @this {import('./driver').XCUITestDriver}
302
- * @returns {Promise<boolean>} True if preferences were changed
286
+ * @returns True if preferences were changed
303
287
  */
304
- export async function setLocalizationPrefs() {
288
+ export async function setLocalizationPrefs(this: XCUITestDriver): Promise<boolean> {
305
289
  const {language, locale, calendarFormat, skipSyncUiDialogTranslation} = this.opts;
306
- /** @type {import('appium-ios-simulator').LocalizationOptions} */
307
- const l10nConfig = {};
290
+ const l10nConfig: LocalizationOptions = {};
308
291
  if (language) {
309
292
  l10nConfig.language = {name: language, skipSyncUiDialogTranslation };
310
293
  }
@@ -319,6 +302,30 @@ export async function setLocalizationPrefs() {
319
302
  }
320
303
 
321
304
  this.log.debug(`About to update localization preferences: ${JSON.stringify(l10nConfig)}`);
322
- await /** @type {import('./driver').Simulator} */ (this.device).configureLocalization(l10nConfig);
305
+ await (this.device as Simulator).configureLocalization(l10nConfig);
323
306
  return true;
324
307
  }
308
+
309
+ //#region Type Definitions
310
+
311
+ export interface SimulatorLookupOptions {
312
+ /** The name of the device to lookup */
313
+ deviceName?: string;
314
+ /** The platform version string */
315
+ platformVersion: string;
316
+ /** The full path to the simulator devices set */
317
+ simulatorDevicesSetPath?: string;
318
+ /** Simulator udid */
319
+ udid?: string;
320
+ /** The name of the current platform */
321
+ platformName?: string;
322
+ }
323
+
324
+ export interface SimulatorInstallOptions {
325
+ /** Whether to skip app uninstall before installing it */
326
+ skipUninstall?: boolean;
327
+ /** Whether the simulator is brand new */
328
+ newSimulator?: boolean;
329
+ }
330
+
331
+ //#endregion
package/lib/driver.js CHANGED
@@ -65,7 +65,7 @@ import * as xctestCommands from './commands/xctest';
65
65
  import * as xctestRecordScreenCommands from './commands/xctest-record-screen';
66
66
  import * as increaseContrastCommands from './commands/increase-contrast';
67
67
  import {desiredCapConstraints} from './desired-caps';
68
- import {DEVICE_CONNECTIONS_FACTORY} from './device-connections-factory';
68
+ import {DEVICE_CONNECTIONS_FACTORY} from './device/device-connections-factory';
69
69
  import {executeMethodMap} from './execute-method-map';
70
70
  import {newMethodMap} from './method-map';
71
71
  import { Pyidevice } from './real-device-clients/py-ios-device-client';
@@ -74,11 +74,9 @@ import {
74
74
  runRealDeviceReset,
75
75
  applySafariStartupArgs,
76
76
  detectUdid,
77
- } from './real-device-management';
78
- import {
79
77
  RealDevice,
80
78
  getConnectedDevices,
81
- } from './real-device';
79
+ } from './device/real-device-management';
82
80
  import {
83
81
  createSim,
84
82
  getExistingSim,
@@ -88,7 +86,7 @@ import {
88
86
  setSafariPrefs,
89
87
  shutdownOtherSimulators,
90
88
  shutdownSimulator,
91
- } from './simulator-management';
89
+ } from './device/simulator-management';
92
90
  import {
93
91
  DEFAULT_TIMEOUT_KEY,
94
92
  UDID_AUTO,
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "appium-xcuitest-driver",
3
- "version": "10.8.2",
3
+ "version": "10.8.4",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "appium-xcuitest-driver",
9
- "version": "10.8.2",
9
+ "version": "10.8.4",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "@appium/strongbox": "^1.0.0-rc.1",
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "xcuitest",
9
9
  "xctest"
10
10
  ],
11
- "version": "10.8.2",
11
+ "version": "10.8.4",
12
12
  "author": "Appium Contributors",
13
13
  "license": "Apache-2.0",
14
14
  "repository": {
@@ -1,13 +0,0 @@
1
- export default DEVICE_CONNECTIONS_FACTORY;
2
- export const DEVICE_CONNECTIONS_FACTORY: DeviceConnectionsFactory;
3
- export class DeviceConnectionsFactory {
4
- _connectionsMapping: {};
5
- _udidAsToken(udid: any): string;
6
- _portAsToken(port: any): string;
7
- _toKey(udid?: null, port?: null): string;
8
- _releaseProxiedConnections(connectionKeys: any): any;
9
- listConnections(udid?: null, port?: null, strict?: boolean): string[];
10
- requestConnection(udid: any, port: any, options?: {}): Promise<void>;
11
- releaseConnection(udid?: null, port?: null): void;
12
- }
13
- //# sourceMappingURL=device-connections-factory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"device-connections-factory.d.ts","sourceRoot":"","sources":["../../lib/device-connections-factory.js"],"names":[],"mappings":";AAyQA,kEAAkE;AAjKlE;IAEI,wBAA6B;IAG/B,gCAEC;IAED,gCAEC;IAED,yCAEC;IAED,qDAWC;IAED,sEAeC;IAED,qEAwFC;IAED,kDAqBC;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"device-connections-factory.js","sourceRoot":"","sources":["../../lib/device-connections-factory.js"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,8CAAsB;AACtB,wDAAyB;AACzB,4CAAoD;AACpD,yDAA4C;AAC5C,6CAA4C;AAC5C,uCAA0C;AAE1C,MAAM,SAAS,GAAG,WAAW,CAAC;AAE9B,MAAM,MAAM;IACV,YAAY,IAAI,EAAE,SAAS,EAAE,UAAU;QACrC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;QACzC,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QAC3C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,GAAG,GAAG,gBAAM,CAAC,SAAS,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAClF,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,OAAO;QACT,CAAC;QAED,IAAI,CAAC,WAAW,GAAG,aAAG,CAAC,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE;YACxD,IAAI,YAAY,CAAC;YACjB,IAAI,CAAC;gBACH,sFAAsF;gBACtF,YAAY,GAAG,MAAM,6BAAS,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;YACzE,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;gBAC1B,WAAW,CAAC,OAAO,EAAE,CAAC;gBACtB,OAAO;YACT,CAAC;YAED,MAAM,kBAAkB,GAAG,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AAC,CAAC;QACtC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;QACvC,CAAC;QACD,GAAG,CAAC,KAAK,CAAC,6BAA6B,gBAAC,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;IAC7E,CAAC;CACF;AAImC,4DAAwB;AAF5D,MAAM,0BAA0B,GAAG,IAAI,wBAAwB,EAAE,CAAC;AAE1D,gEAA0B;AAClC,kBAAe,0BAA0B,CAAC"}
@@ -1,75 +0,0 @@
1
- /**
2
- * Retrieve a file from a real device
3
- *
4
- * @param {any} afcService Apple File Client service instance from
5
- * 'appium-ios-device' module
6
- * @param {string} remotePath Relative path to the file on the device
7
- * @returns {Promise<Buffer>} The file content as a buffer
8
- */
9
- export function pullFile(afcService: any, remotePath: string): Promise<Buffer>;
10
- /**
11
- * Retrieve a folder from a real device
12
- *
13
- * @param {any} afcService Apple File Client service instance from
14
- * 'appium-ios-device' module
15
- * @param {string} remoteRootPath Relative path to the folder on the device
16
- * @returns {Promise<Buffer>} The folder content as a zipped base64-encoded buffer
17
- */
18
- export function pullFolder(afcService: any, remoteRootPath: string): Promise<Buffer>;
19
- /**
20
- * @typedef {Object} PushFileOptions
21
- * @property {number} [timeoutMs=240000] The maximum count of milliceconds to wait until
22
- * file push is completed. Cannot be lower than 60000ms
23
- */
24
- /**
25
- * Pushes a file to a real device
26
- *
27
- * @param {any} afcService afcService Apple File Client service instance from
28
- * 'appium-ios-device' module
29
- * @param {string|Buffer} localPathOrPayload Either full path to the source file
30
- * or a buffer payload to be written into the remote destination
31
- * @param {string} remotePath Relative path to the file on the device. The remote
32
- * folder structure is created automatically if necessary.
33
- * @param {PushFileOptions} [opts={}]
34
- */
35
- export function pushFile(afcService: any, localPathOrPayload: string | Buffer, remotePath: string, opts?: PushFileOptions): Promise<void>;
36
- /**
37
- * @typedef {Object} PushFolderOptions
38
- *
39
- * @property {number} [timeoutMs=240000] The maximum timeout to wait until a
40
- * single file is copied
41
- * @property {boolean} [enableParallelPush=false] Whether to push files in parallel.
42
- * This usually gives better performance, but might sometimes be less stable.
43
- */
44
- /**
45
- * Pushes a folder to a real device
46
- *
47
- * @param {any} afcService Apple File Client service instance from
48
- * 'appium-ios-device' module
49
- * @param {string} srcRootPath The full path to the source folder
50
- * @param {string} dstRootPath The relative path to the destination folder. The folder
51
- * will be deleted if already exists.
52
- * @param {PushFolderOptions} opts
53
- */
54
- export function pushFolder(afcService: any, srcRootPath: string, dstRootPath: string, opts?: PushFolderOptions): Promise<void>;
55
- export const IO_TIMEOUT_MS: number;
56
- export type PushFileOptions = {
57
- /**
58
- * The maximum count of milliceconds to wait until
59
- * file push is completed. Cannot be lower than 60000ms
60
- */
61
- timeoutMs?: number | undefined;
62
- };
63
- export type PushFolderOptions = {
64
- /**
65
- * The maximum timeout to wait until a
66
- * single file is copied
67
- */
68
- timeoutMs?: number | undefined;
69
- /**
70
- * Whether to push files in parallel.
71
- * This usually gives better performance, but might sometimes be less stable.
72
- */
73
- enableParallelPush?: boolean | undefined;
74
- };
75
- //# sourceMappingURL=ios-fs-helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ios-fs-helpers.d.ts","sourceRoot":"","sources":["../../lib/ios-fs-helpers.js"],"names":[],"mappings":"AAWA;;;;;;;GAOG;AACH,qCALW,GAAG,cAEH,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CAY3B;AAgBD;;;;;;;GAOG;AACH,uCALW,GAAG,kBAEH,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CA0E3B;AA0BD;;;;GAIG;AAEH;;;;;;;;;;GAUG;AACH,qCARW,GAAG,sBAEH,MAAM,GAAC,MAAM,cAEb,MAAM,SAEN,eAAe,iBAgDzB;AAED;;;;;;;GAOG;AAEH;;;;;;;;;GASG;AACH,uCAPW,GAAG,eAEH,MAAM,eACN,MAAM,SAEN,iBAAiB,iBAyH3B;AA5VD,mCAA2C"}