appium-xcuitest-driver 10.16.1 → 10.16.2
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 +6 -0
- package/build/lib/device/real-device-management.d.ts +1 -0
- package/build/lib/device/real-device-management.d.ts.map +1 -1
- package/build/lib/device/real-device-management.js +12 -5
- package/build/lib/device/real-device-management.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/lib/device/real-device-management.ts +11 -5
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -264,6 +264,7 @@ export class RealDevice {
|
|
|
264
264
|
readonly udid: string;
|
|
265
265
|
private readonly _log: AppiumLogger;
|
|
266
266
|
readonly devicectl: Devicectl;
|
|
267
|
+
private platformVersion: string | undefined;
|
|
267
268
|
|
|
268
269
|
constructor(udid: string, logger?: AppiumLogger) {
|
|
269
270
|
this.udid = udid;
|
|
@@ -293,18 +294,20 @@ export class RealDevice {
|
|
|
293
294
|
timeoutMs = IO_TIMEOUT_MS,
|
|
294
295
|
} = opts;
|
|
295
296
|
const timer = new timing.Timer().start();
|
|
296
|
-
const
|
|
297
|
+
const platformVersion = await this.getPlatformVersion();
|
|
298
|
+
const useRemoteXPC = !!platformVersion && util.compareVersions(platformVersion, '>=', '18.0');
|
|
299
|
+
const afcClient = await AfcClient.createForDevice(this.udid, useRemoteXPC);
|
|
297
300
|
try {
|
|
298
301
|
let bundlePathOnPhone: string;
|
|
299
302
|
if ((await fs.stat(appPath)).isFile()) {
|
|
300
303
|
// https://github.com/doronz88/pymobiledevice3/blob/6ff5001f5776e03b610363254e82d7fbcad4ef5f/pymobiledevice3/services/installation_proxy.py#L75
|
|
301
304
|
bundlePathOnPhone = `/${path.basename(appPath)}`;
|
|
302
|
-
await pushFile(
|
|
305
|
+
await pushFile(afcClient, appPath, bundlePathOnPhone, {
|
|
303
306
|
timeoutMs,
|
|
304
307
|
});
|
|
305
308
|
} else {
|
|
306
309
|
bundlePathOnPhone = `${INSTALLATION_STAGING_DIR}/${bundleId}`;
|
|
307
|
-
await pushFolder(
|
|
310
|
+
await pushFolder(afcClient, appPath, bundlePathOnPhone, {
|
|
308
311
|
enableParallelPush: true,
|
|
309
312
|
timeoutMs,
|
|
310
313
|
});
|
|
@@ -325,7 +328,7 @@ export class RealDevice {
|
|
|
325
328
|
errMessage += `. Original error: ${(err as Error).message}`;
|
|
326
329
|
throw new Error(errMessage);
|
|
327
330
|
} finally {
|
|
328
|
-
|
|
331
|
+
await afcClient.close();
|
|
329
332
|
}
|
|
330
333
|
this.log.info(
|
|
331
334
|
`The installation of '${bundleId}' succeeded after ${timer.getDuration().asMilliSeconds.toFixed(0)}ms`
|
|
@@ -513,7 +516,10 @@ export class RealDevice {
|
|
|
513
516
|
}
|
|
514
517
|
|
|
515
518
|
async getPlatformVersion(): Promise<string> {
|
|
516
|
-
|
|
519
|
+
if (!this.platformVersion) {
|
|
520
|
+
this.platformVersion = await utilities.getOSVersion(this.udid) as string;
|
|
521
|
+
}
|
|
522
|
+
return this.platformVersion;
|
|
517
523
|
}
|
|
518
524
|
|
|
519
525
|
async reset(opts: {bundleId?: string; fullReset?: boolean}): Promise<void> {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appium-xcuitest-driver",
|
|
3
|
-
"version": "10.16.
|
|
3
|
+
"version": "10.16.2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "appium-xcuitest-driver",
|
|
9
|
-
"version": "10.16.
|
|
9
|
+
"version": "10.16.2",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@appium/strongbox": "^1.0.0-rc.1",
|