appium-xcuitest-driver 10.14.12 → 10.15.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/lib/commands/file-movement.d.ts.map +1 -1
- package/build/lib/commands/file-movement.js +73 -45
- package/build/lib/commands/file-movement.js.map +1 -1
- package/build/lib/device/afc-client.d.ts +135 -0
- package/build/lib/device/afc-client.d.ts.map +1 -0
- package/build/lib/device/afc-client.js +422 -0
- package/build/lib/device/afc-client.js.map +1 -0
- package/build/lib/device/real-device-management.d.ts +13 -14
- package/build/lib/device/real-device-management.d.ts.map +1 -1
- package/build/lib/device/real-device-management.js +50 -162
- package/build/lib/device/real-device-management.js.map +1 -1
- package/build/scripts/build-wda.d.mts +2 -0
- package/build/scripts/build-wda.d.mts.map +1 -0
- package/build/scripts/build-wda.mjs +36 -0
- package/build/scripts/build-wda.mjs.map +1 -0
- package/build/scripts/download-wda-sim.d.mts +2 -0
- package/build/scripts/download-wda-sim.d.mts.map +1 -0
- package/build/scripts/download-wda-sim.mjs +62 -0
- package/build/scripts/download-wda-sim.mjs.map +1 -0
- package/build/scripts/image-mounter.d.mts +3 -0
- package/build/scripts/image-mounter.d.mts.map +1 -0
- package/build/scripts/image-mounter.mjs +189 -0
- package/build/scripts/image-mounter.mjs.map +1 -0
- package/build/scripts/open-wda.d.mts +2 -0
- package/build/scripts/open-wda.d.mts.map +1 -0
- package/build/scripts/open-wda.mjs +13 -0
- package/build/scripts/open-wda.mjs.map +1 -0
- package/build/scripts/tunnel-creation.d.mts +3 -0
- package/build/scripts/tunnel-creation.d.mts.map +1 -0
- package/build/scripts/tunnel-creation.mjs +297 -0
- package/build/scripts/tunnel-creation.mjs.map +1 -0
- package/build/scripts/utils.d.ts +8 -0
- package/build/scripts/utils.d.ts.map +1 -0
- package/build/scripts/utils.js +20 -0
- package/build/scripts/utils.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/lib/commands/file-movement.ts +100 -56
- package/lib/device/afc-client.ts +503 -0
- package/lib/device/real-device-management.ts +73 -166
- package/npm-shrinkwrap.json +5 -5
- package/package.json +1 -1
- package/scripts/build-wda.mjs +7 -0
- package/scripts/download-wda-sim.mjs +7 -3
- package/scripts/tunnel-creation.mjs +7 -2
- package/scripts/build-docs.js +0 -56
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Image mounter script for mounting and unmounting Personalized Developer Disk Image on iOS devices
|
|
4
|
+
* This script provides a CLI interface to mount/unmount DDI via remote XPC services
|
|
5
|
+
*/
|
|
6
|
+
import { logger } from 'appium/support.js';
|
|
7
|
+
import { promises as fs } from 'fs';
|
|
8
|
+
import path from 'path';
|
|
9
|
+
import { Command } from 'commander';
|
|
10
|
+
const log = logger.getLogger('ImageMounter');
|
|
11
|
+
/**
|
|
12
|
+
* ImageMounter class for managing image mounting and unmounting operations
|
|
13
|
+
*/
|
|
14
|
+
class ImageMounter {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.remoteXPCModule = null;
|
|
17
|
+
}
|
|
18
|
+
async initializeRemoteXPC() {
|
|
19
|
+
if (this.remoteXPCModule) {
|
|
20
|
+
return this.remoteXPCModule;
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
this.remoteXPCModule = await import('appium-ios-remotexpc');
|
|
24
|
+
return this.remoteXPCModule;
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
throw new Error('appium-ios-remotexpc is not installed. Please install it using:\n' +
|
|
28
|
+
'npm install appium-ios-remotexpc\n\n' +
|
|
29
|
+
'Note: This is an optional dependency required for image mounting functionality.');
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
async validateFile(filePath, fileType) {
|
|
33
|
+
const absolutePath = path.resolve(filePath);
|
|
34
|
+
try {
|
|
35
|
+
const stat = await fs.stat(absolutePath);
|
|
36
|
+
if (!stat.isFile()) {
|
|
37
|
+
throw new Error(`${fileType} path is not a file: ${absolutePath}`);
|
|
38
|
+
}
|
|
39
|
+
return absolutePath;
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
if (error.code === 'ENOENT') {
|
|
43
|
+
throw new Error(`${fileType} file not found: ${absolutePath}`);
|
|
44
|
+
}
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async getTargetDevice(udid) {
|
|
49
|
+
const { createUsbmux } = await this.initializeRemoteXPC();
|
|
50
|
+
log.info('Connecting to usbmuxd...');
|
|
51
|
+
const usbmux = await createUsbmux();
|
|
52
|
+
const devices = await usbmux.listDevices();
|
|
53
|
+
if (devices.length === 0) {
|
|
54
|
+
await usbmux.close();
|
|
55
|
+
throw new Error('No iOS devices found. Ensure a device is connected, unlocked, and trusted. ' +
|
|
56
|
+
'See https://appium.github.io/appium-xcuitest-driver/latest/preparation/real-device-config/ for details.');
|
|
57
|
+
}
|
|
58
|
+
let targetDevice;
|
|
59
|
+
if (udid) {
|
|
60
|
+
targetDevice = devices.find((device) => device.Properties.SerialNumber === udid);
|
|
61
|
+
if (!targetDevice) {
|
|
62
|
+
await usbmux.close();
|
|
63
|
+
throw new Error(`Device with UDID ${udid} not found. Available devices:\n` +
|
|
64
|
+
devices.map((d) => ` - ${d.Properties.SerialNumber}`).join('\n'));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
if (devices.length > 1) {
|
|
69
|
+
log.warn(`Multiple devices found. Using first device: ${devices[0].Properties.SerialNumber}`);
|
|
70
|
+
log.warn('Available devices:');
|
|
71
|
+
devices.forEach((device) => log.warn(` - ${device.Properties.SerialNumber}`));
|
|
72
|
+
log.warn('Use --udid flag to specify a particular device.');
|
|
73
|
+
}
|
|
74
|
+
targetDevice = devices[0];
|
|
75
|
+
}
|
|
76
|
+
return { usbmux, targetDevice };
|
|
77
|
+
}
|
|
78
|
+
async withImageMounterService(udid, fn) {
|
|
79
|
+
const { usbmux, targetDevice } = await this.getTargetDevice(udid);
|
|
80
|
+
const deviceUdid = targetDevice.Properties.SerialNumber;
|
|
81
|
+
try {
|
|
82
|
+
const remoteXPCModule = await this.initializeRemoteXPC();
|
|
83
|
+
const { Services } = remoteXPCModule;
|
|
84
|
+
log.info('Starting mobile image mounter service...');
|
|
85
|
+
const { mobileImageMounterService: imageMounterService, remoteXPC } = await Services.startMobileImageMounterService(deviceUdid);
|
|
86
|
+
try {
|
|
87
|
+
return await fn(imageMounterService, deviceUdid);
|
|
88
|
+
}
|
|
89
|
+
finally {
|
|
90
|
+
await imageMounterService.cleanup();
|
|
91
|
+
if (remoteXPC) {
|
|
92
|
+
log.info(`Closing remoteXPC connection for device ${deviceUdid}`);
|
|
93
|
+
await remoteXPC.close();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
finally {
|
|
98
|
+
await usbmux.close();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Mount Personalized Developer Disk Image on device
|
|
103
|
+
* @param {string} imagePath - Path to the .dmg file
|
|
104
|
+
* @param {string} manifestPath - Path to the BuildManifest.plist file
|
|
105
|
+
* @param {string} trustCachePath - Path to the .trustcache file
|
|
106
|
+
* @param {string} [udid] - Device UDID
|
|
107
|
+
*/
|
|
108
|
+
async mount(imagePath, manifestPath, trustCachePath, udid) {
|
|
109
|
+
const [validatedImagePath, validatedManifestPath, validatedTrustCachePath] = await Promise.all([
|
|
110
|
+
this.validateFile(imagePath, 'Image (.dmg)'),
|
|
111
|
+
this.validateFile(manifestPath, 'Build Manifest (.plist)'),
|
|
112
|
+
this.validateFile(trustCachePath, 'Trust Cache (.trustcache)')
|
|
113
|
+
]);
|
|
114
|
+
await this.withImageMounterService(udid, async (imageMounterService, deviceUdid) => {
|
|
115
|
+
log.info(`Mounting image on device: ${deviceUdid}`);
|
|
116
|
+
if (await imageMounterService.isPersonalizedImageMounted()) {
|
|
117
|
+
log.info('✅ Personalized image is already mounted on the device');
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
await imageMounterService.mount(validatedImagePath, validatedManifestPath, validatedTrustCachePath);
|
|
121
|
+
log.info('✅ Image mounted successfully!');
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Unmount image from device
|
|
126
|
+
* @param {string} [udid] - Device UDID
|
|
127
|
+
* @param {string} [mountPath='/System/Developer'] - Mount path to unmount
|
|
128
|
+
*/
|
|
129
|
+
async unmount(udid, mountPath = '/System/Developer') {
|
|
130
|
+
await this.withImageMounterService(udid, async (imageMounterService, deviceUdid) => {
|
|
131
|
+
log.info(`Unmounting image from device: ${deviceUdid}`);
|
|
132
|
+
log.info(`Mount path: ${mountPath}`);
|
|
133
|
+
await imageMounterService.unmountImage(mountPath);
|
|
134
|
+
log.info('✅ Image unmounted successfully!');
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* CLI with Commander.js
|
|
140
|
+
*/
|
|
141
|
+
async function main() {
|
|
142
|
+
const program = new Command();
|
|
143
|
+
const imageMounter = new ImageMounter();
|
|
144
|
+
program
|
|
145
|
+
.name('appium driver run xcuitest image-mounter')
|
|
146
|
+
.description('Mount and unmount Developer Disk Images on iOS devices')
|
|
147
|
+
.version('1.0.0')
|
|
148
|
+
.addHelpText('after', `
|
|
149
|
+
NOTE:
|
|
150
|
+
This script requires the 'appium-ios-remotexpc' package to be installed.
|
|
151
|
+
Install it using: npm install appium-ios-remotexpc`);
|
|
152
|
+
// Mount command
|
|
153
|
+
program
|
|
154
|
+
.command('mount')
|
|
155
|
+
.description('Mount a Developer Disk Image on iOS device')
|
|
156
|
+
.requiredOption('-i, --image <path>', 'Path to the .dmg image file')
|
|
157
|
+
.requiredOption('-m, --manifest <path>', 'Path to the BuildManifest.plist file')
|
|
158
|
+
.requiredOption('-t, --trustcache <path>', 'Path to the .trustcache file')
|
|
159
|
+
.option('-u, --udid <udid>', 'Target device UDID (optional, uses first device if not specified)')
|
|
160
|
+
.addHelpText('after', `
|
|
161
|
+
EXAMPLES:
|
|
162
|
+
# Mount Developer Disk Image
|
|
163
|
+
appium driver run xcuitest image-mounter mount --image DeveloperDiskImage.dmg --manifest BuildManifest.plist --trustcache DeveloperDiskImage.trustcache
|
|
164
|
+
|
|
165
|
+
# Mount on specific device
|
|
166
|
+
appium driver run xcuitest image-mounter mount --image DeveloperDiskImage.dmg --manifest BuildManifest.plist --trustcache DeveloperDiskImage.trustcache --udid <udid>`)
|
|
167
|
+
.action(async (options) => {
|
|
168
|
+
await imageMounter.mount(options.image, options.manifest, options.trustcache, options.udid);
|
|
169
|
+
});
|
|
170
|
+
// Unmount command
|
|
171
|
+
program
|
|
172
|
+
.command('unmount')
|
|
173
|
+
.description('Unmount a Developer Disk Image from iOS device')
|
|
174
|
+
.option('-u, --udid <udid>', 'Target device UDID (optional, uses first device if not specified)')
|
|
175
|
+
.option('-p, --mount-path <path>', 'Mount path to unmount', '/System/Developer')
|
|
176
|
+
.addHelpText('after', `
|
|
177
|
+
EXAMPLES:
|
|
178
|
+
# Unmount from default path
|
|
179
|
+
appium driver run xcuitest image-mounter unmount
|
|
180
|
+
|
|
181
|
+
# Unmount from specific device
|
|
182
|
+
appium driver run xcuitest image-mounter unmount --udid <udid>`)
|
|
183
|
+
.action(async (options) => {
|
|
184
|
+
await imageMounter.unmount(options.udid, options.mountPath);
|
|
185
|
+
});
|
|
186
|
+
await program.parseAsync(process.argv);
|
|
187
|
+
}
|
|
188
|
+
(async () => await main())();
|
|
189
|
+
//# sourceMappingURL=image-mounter.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-mounter.mjs","sourceRoot":"","sources":["../../scripts/image-mounter.mjs"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAC,QAAQ,IAAI,EAAE,EAAC,M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,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AAED,CAAC,KAAK,IAAI,EAAE,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-wda.d.mts","sourceRoot":"","sources":["../../scripts/open-wda.mjs"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { exec } from 'teen_process';
|
|
3
|
+
import { logger } from 'appium/support.js';
|
|
4
|
+
import { BOOTSTRAP_PATH } from 'appium-webdriveragent';
|
|
5
|
+
const log = logger.getLogger('WDA');
|
|
6
|
+
const XCODEPROJ_NAME = 'WebDriverAgent.xcodeproj';
|
|
7
|
+
async function openWda() {
|
|
8
|
+
const dstPath = path.resolve(BOOTSTRAP_PATH, XCODEPROJ_NAME);
|
|
9
|
+
log.info(`Opening '${dstPath}'`);
|
|
10
|
+
await exec('open', [dstPath]);
|
|
11
|
+
}
|
|
12
|
+
(async () => await openWda())();
|
|
13
|
+
//# sourceMappingURL=open-wda.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-wda.mjs","sourceRoot":"","sources":["../../scripts/open-wda.mjs"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AACpC,MAAM,cAAc,GAAG,0BAA0B,CAAC;AAElD,KAAK,UAAU,OAAO;IACpB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;IAC7D,GAAG,CAAC,IAAI,CAAC,YAAY,OAAO,GAAG,CAAC,CAAC;IACjC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AAChC,CAAC;AAED,CAAC,KAAK,IAAI,EAAE,CAAC,MAAM,OAAO,EAAE,CAAC,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tunnel-creation.d.mts","sourceRoot":"","sources":["../../scripts/tunnel-creation.mjs"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Test script for creating lockdown service, starting CoreDeviceProxy, and creating tunnel
|
|
4
|
+
* This script demonstrates the tunnel creation workflow for all connected devices
|
|
5
|
+
*/
|
|
6
|
+
import { logger, node } from 'appium/support.js';
|
|
7
|
+
import _ from 'lodash';
|
|
8
|
+
import { PacketStreamServer, TunnelManager, createLockdownServiceByUDID, createUsbmux, startCoreDeviceProxy, startTunnelRegistryServer, } from 'appium-ios-remotexpc';
|
|
9
|
+
import { strongbox } from '@appium/strongbox';
|
|
10
|
+
import path from 'path';
|
|
11
|
+
import fs from 'fs';
|
|
12
|
+
const log = logger.getLogger('TunnelCreation');
|
|
13
|
+
const TUNNEL_REGISTRY_PORT = 'tunnelRegistryPort';
|
|
14
|
+
/**
|
|
15
|
+
* TunnelCreator class for managing tunnel creation and related operations
|
|
16
|
+
*/
|
|
17
|
+
class TunnelCreator {
|
|
18
|
+
constructor() {
|
|
19
|
+
this._packetStreamServers = new Map();
|
|
20
|
+
// Default port value, will be updated in main() if --packet-stream-base-port is provided
|
|
21
|
+
this._packetStreamBasePort = 50000;
|
|
22
|
+
// Default port value, will be updated in main() if --tunnel-registry-port is provided
|
|
23
|
+
this._tunnelRegistryPort = 42314;
|
|
24
|
+
}
|
|
25
|
+
get packetStreamBasePort() {
|
|
26
|
+
return this._packetStreamBasePort;
|
|
27
|
+
}
|
|
28
|
+
set packetStreamBasePort(port) {
|
|
29
|
+
this._packetStreamBasePort = port;
|
|
30
|
+
}
|
|
31
|
+
get tunnelRegistryPort() {
|
|
32
|
+
return this._tunnelRegistryPort;
|
|
33
|
+
}
|
|
34
|
+
set tunnelRegistryPort(port) {
|
|
35
|
+
this._tunnelRegistryPort = port;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Update tunnel registry with new tunnel information
|
|
39
|
+
* @param {import('appium-ios-remotexpc').TunnelResult[]} results - Array of tunnel results
|
|
40
|
+
* @returns {Promise<import('appium-ios-remotexpc').TunnelRegistry>} Updated tunnel registry
|
|
41
|
+
*/
|
|
42
|
+
async updateTunnelRegistry(results) {
|
|
43
|
+
const now = Date.now();
|
|
44
|
+
const nowISOString = new Date().toISOString();
|
|
45
|
+
// Initialize registry if it doesn't exist
|
|
46
|
+
const registry = {
|
|
47
|
+
tunnels: {},
|
|
48
|
+
metadata: {
|
|
49
|
+
lastUpdated: nowISOString,
|
|
50
|
+
totalTunnels: 0,
|
|
51
|
+
activeTunnels: 0,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
// Update tunnels
|
|
55
|
+
for (const result of results) {
|
|
56
|
+
if (result.success) {
|
|
57
|
+
const udid = result.device.Properties.SerialNumber;
|
|
58
|
+
registry.tunnels[udid] = {
|
|
59
|
+
udid,
|
|
60
|
+
deviceId: result.device.DeviceID,
|
|
61
|
+
address: result.tunnel.Address,
|
|
62
|
+
rsdPort: result.tunnel.RsdPort ?? 0,
|
|
63
|
+
packetStreamPort: result.packetStreamPort,
|
|
64
|
+
connectionType: result.device.Properties.ConnectionType,
|
|
65
|
+
productId: result.device.Properties.ProductID,
|
|
66
|
+
createdAt: registry.tunnels[udid]?.createdAt ?? now,
|
|
67
|
+
lastUpdated: now,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// Update metadata
|
|
72
|
+
registry.metadata = {
|
|
73
|
+
lastUpdated: nowISOString,
|
|
74
|
+
totalTunnels: Object.keys(registry.tunnels).length,
|
|
75
|
+
activeTunnels: Object.keys(registry.tunnels).length, // Assuming all are active for now
|
|
76
|
+
};
|
|
77
|
+
return registry;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Setup cleanup handlers for graceful shutdown
|
|
81
|
+
*/
|
|
82
|
+
setupCleanupHandlers() {
|
|
83
|
+
const cleanup = async (signal) => {
|
|
84
|
+
log.warn(`\nReceived ${signal}. Cleaning up...`);
|
|
85
|
+
// Close all packet stream servers
|
|
86
|
+
if (this._packetStreamServers.size > 0) {
|
|
87
|
+
log.info(`Closing ${this._packetStreamServers.size} packet stream server(s)...`);
|
|
88
|
+
for (const [udid, server] of this._packetStreamServers) {
|
|
89
|
+
try {
|
|
90
|
+
await server.stop();
|
|
91
|
+
log.info(`Closed packet stream server for device ${udid}`);
|
|
92
|
+
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
log.warn(`Failed to close packet stream server for device ${udid}: ${err}`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
this._packetStreamServers.clear();
|
|
98
|
+
}
|
|
99
|
+
log.info('Cleanup completed. Exiting...');
|
|
100
|
+
process.exit(0);
|
|
101
|
+
};
|
|
102
|
+
// Handle various termination signals
|
|
103
|
+
process.on('SIGINT', () => cleanup('SIGINT (Ctrl+C)'));
|
|
104
|
+
process.on('SIGTERM', () => cleanup('SIGTERM'));
|
|
105
|
+
process.on('SIGHUP', () => cleanup('SIGHUP'));
|
|
106
|
+
// Handle uncaught exceptions and unhandled rejections
|
|
107
|
+
process.on('uncaughtException', async (error) => {
|
|
108
|
+
log.error('Uncaught Exception:', error);
|
|
109
|
+
await cleanup('Uncaught Exception');
|
|
110
|
+
});
|
|
111
|
+
process.on('unhandledRejection', async (reason, promise) => {
|
|
112
|
+
log.error('Unhandled Rejection at:', promise, 'reason:', reason);
|
|
113
|
+
await cleanup('Unhandled Rejection');
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Create tunnel for a single device
|
|
118
|
+
* @param {import('appium-ios-remotexpc').UsbmuxDevice} device - Device object
|
|
119
|
+
* @param {import('tls').ConnectionOptions} tlsOptions - TLS options
|
|
120
|
+
* @returns {Promise<import('appium-ios-remotexpc').TunnelResult & { socket?: any; socketInfo?: import('appium-ios-remotexpc').SocketInfo }>} Tunnel result
|
|
121
|
+
*/
|
|
122
|
+
async createTunnelForDevice(device, tlsOptions) {
|
|
123
|
+
const udid = device.Properties.SerialNumber;
|
|
124
|
+
log.info(`\n--- Processing device: ${udid} ---`);
|
|
125
|
+
log.info(`Device ID: ${device.DeviceID}`);
|
|
126
|
+
log.info(`Connection Type: ${device.Properties.ConnectionType}`);
|
|
127
|
+
log.info(`Product ID: ${device.Properties.ProductID}`);
|
|
128
|
+
log.info('Creating lockdown service...');
|
|
129
|
+
const { lockdownService, device: lockdownDevice } = await createLockdownServiceByUDID(udid);
|
|
130
|
+
log.info(`Lockdown service created for device: ${lockdownDevice.Properties.SerialNumber}`);
|
|
131
|
+
log.info('Starting CoreDeviceProxy...');
|
|
132
|
+
const { socket } = await startCoreDeviceProxy(lockdownService, lockdownDevice.DeviceID, lockdownDevice.Properties.SerialNumber, tlsOptions);
|
|
133
|
+
log.info('CoreDeviceProxy started successfully');
|
|
134
|
+
log.info('Creating tunnel...');
|
|
135
|
+
const tunnel = await TunnelManager.getTunnel(socket);
|
|
136
|
+
log.info(`Tunnel created for address: ${tunnel.Address} with RsdPort: ${tunnel.RsdPort}`);
|
|
137
|
+
let packetStreamPort;
|
|
138
|
+
packetStreamPort = this._packetStreamBasePort++;
|
|
139
|
+
const packetStreamServer = new PacketStreamServer(packetStreamPort);
|
|
140
|
+
await packetStreamServer.start();
|
|
141
|
+
const consumer = packetStreamServer.getPacketConsumer();
|
|
142
|
+
if (consumer) {
|
|
143
|
+
tunnel.addPacketConsumer(consumer);
|
|
144
|
+
}
|
|
145
|
+
this._packetStreamServers.set(udid, packetStreamServer);
|
|
146
|
+
log.info(`Packet stream server started on port ${packetStreamPort}`);
|
|
147
|
+
log.info(`✅ Tunnel creation completed successfully for device: ${udid}`);
|
|
148
|
+
log.info(` Tunnel Address: ${tunnel.Address}`);
|
|
149
|
+
log.info(` Tunnel RsdPort: ${tunnel.RsdPort}`);
|
|
150
|
+
if (packetStreamPort) {
|
|
151
|
+
log.info(` Packet Stream Port: ${packetStreamPort}`);
|
|
152
|
+
}
|
|
153
|
+
if (_.isFunction(socket?.setNoDelay)) {
|
|
154
|
+
socket.setNoDelay(true);
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
device,
|
|
158
|
+
tunnel: {
|
|
159
|
+
Address: tunnel.Address,
|
|
160
|
+
RsdPort: tunnel.RsdPort,
|
|
161
|
+
},
|
|
162
|
+
packetStreamPort,
|
|
163
|
+
success: true,
|
|
164
|
+
socket,
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Sets up tunnels for all connected devices.
|
|
169
|
+
* @param {import('appium-ios-remotexpc').Usbmux} usbmux - The usbmux object.
|
|
170
|
+
* @param {string|undefined} specificUdid - A specific UDID to process, or undefined for all devices.
|
|
171
|
+
* @param {import('tls').ConnectionOptions} tlsOptions - TLS options.
|
|
172
|
+
*/
|
|
173
|
+
async setupTunnels(usbmux, specificUdid, tlsOptions) {
|
|
174
|
+
log.info('Listing all connected devices...');
|
|
175
|
+
const devices = await usbmux.listDevices();
|
|
176
|
+
if (devices.length === 0) {
|
|
177
|
+
log.warn('No devices found. Make sure iOS devices are connected and trusted.');
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
log.info(`Found ${devices.length} connected device(s):`);
|
|
181
|
+
devices.forEach((device, index) => {
|
|
182
|
+
log.info(` ${index + 1}. UDID: ${device.Properties.SerialNumber}`);
|
|
183
|
+
log.info(` Device ID: ${device.DeviceID}`);
|
|
184
|
+
log.info(` Connection: ${device.Properties.ConnectionType}`);
|
|
185
|
+
log.info(` Product ID: ${device.Properties.ProductID}`);
|
|
186
|
+
});
|
|
187
|
+
let devicesToProcess = devices;
|
|
188
|
+
if (specificUdid) {
|
|
189
|
+
devicesToProcess = devices.filter((device) => device.Properties.SerialNumber === specificUdid);
|
|
190
|
+
if (devicesToProcess.length === 0) {
|
|
191
|
+
log.error(`Device with UDID ${specificUdid} not found in connected devices.`);
|
|
192
|
+
log.error('Available devices:');
|
|
193
|
+
devices.forEach((device) => {
|
|
194
|
+
log.error(` - ${device.Properties.SerialNumber}`);
|
|
195
|
+
});
|
|
196
|
+
process.exit(1);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
log.info(`\nProcessing ${devicesToProcess.length} device(s)...`);
|
|
200
|
+
/** @type {import('appium-ios-remotexpc').TunnelResult[]} */
|
|
201
|
+
const results = [];
|
|
202
|
+
for (const device of devicesToProcess) {
|
|
203
|
+
const result = await this.createTunnelForDevice(device, tlsOptions);
|
|
204
|
+
results.push(result);
|
|
205
|
+
}
|
|
206
|
+
log.info('\n=== TUNNEL CREATION SUMMARY ===');
|
|
207
|
+
const successful = results.filter((r) => r.success);
|
|
208
|
+
const failed = results.filter((r) => !r.success);
|
|
209
|
+
log.info(`Total devices processed: ${results.length}`);
|
|
210
|
+
log.info(`Successful tunnels: ${successful.length}`);
|
|
211
|
+
log.info(`Failed tunnels: ${failed.length}`);
|
|
212
|
+
if (successful.length > 0) {
|
|
213
|
+
log.info('\n✅ Successful tunnels:');
|
|
214
|
+
const registry = await this.updateTunnelRegistry(results);
|
|
215
|
+
await startTunnelRegistryServer(registry, this._tunnelRegistryPort);
|
|
216
|
+
log.info('\n📁 Tunnel registry API:');
|
|
217
|
+
log.info(' The tunnel registry is now available through the API at:');
|
|
218
|
+
log.info(` http://localhost:${this._tunnelRegistryPort}/remotexpc/tunnels`);
|
|
219
|
+
log.info('\n Available endpoints:');
|
|
220
|
+
log.info(' - GET /remotexpc/tunnels - List all tunnels');
|
|
221
|
+
log.info(' - GET /remotexpc/tunnels/:udid - Get tunnel by UDID');
|
|
222
|
+
log.info(' - GET /remotexpc/tunnels/metadata - Get registry metadata');
|
|
223
|
+
if (successful.length > 0) {
|
|
224
|
+
const firstUdid = successful[0].device.Properties.SerialNumber;
|
|
225
|
+
log.info(` curl http://localhost:4723/remotexpc/tunnels/${firstUdid}`);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Helper function to parse string arguments
|
|
232
|
+
* @param {string[]} args - Array of command line arguments
|
|
233
|
+
* @param {string} flagName - Name of the flag to parse (e.g. '--udid')
|
|
234
|
+
* @returns {string|undefined} The value of the flag if found, undefined otherwise
|
|
235
|
+
*/
|
|
236
|
+
function parseArg(args, flagName) {
|
|
237
|
+
const equalsArg = args.find((arg) => arg.startsWith(`${flagName}=`));
|
|
238
|
+
if (equalsArg) {
|
|
239
|
+
const value = equalsArg.split('=')[1];
|
|
240
|
+
log.info(`Using ${flagName.slice(2)}: ${value}`);
|
|
241
|
+
return value;
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
const flagIndex = args.indexOf(flagName);
|
|
245
|
+
if (flagIndex !== -1 && flagIndex + 1 < args.length) {
|
|
246
|
+
const value = args[flagIndex + 1];
|
|
247
|
+
log.info(`Using ${flagName.slice(2)}: ${value}`);
|
|
248
|
+
return value;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return undefined;
|
|
252
|
+
}
|
|
253
|
+
;
|
|
254
|
+
const BOOTSTRAP_PATH = node.getModuleRootSync('appium-xcuitest-driver', import.meta.url);
|
|
255
|
+
/**
|
|
256
|
+
*/
|
|
257
|
+
async function main() {
|
|
258
|
+
// Create an instance of TunnelCreator
|
|
259
|
+
const tunnelCreator = new TunnelCreator();
|
|
260
|
+
tunnelCreator.setupCleanupHandlers();
|
|
261
|
+
const args = process.argv.slice(2);
|
|
262
|
+
const specificUdid = parseArg(args, '--udid');
|
|
263
|
+
const packetStreamBasePort = parseArg(args, '--packet-stream-base-port');
|
|
264
|
+
if (packetStreamBasePort !== undefined) {
|
|
265
|
+
tunnelCreator.packetStreamBasePort = parseInt(packetStreamBasePort, 10);
|
|
266
|
+
}
|
|
267
|
+
const tunnelRegistryPort = parseArg(args, '--tunnel-registry-port');
|
|
268
|
+
if (tunnelRegistryPort !== undefined) {
|
|
269
|
+
tunnelCreator.tunnelRegistryPort = parseInt(tunnelRegistryPort, 10);
|
|
270
|
+
}
|
|
271
|
+
if (!BOOTSTRAP_PATH) {
|
|
272
|
+
throw new Error(`BOOTSTRAP_PATH is null`);
|
|
273
|
+
}
|
|
274
|
+
const packageInfo = JSON.parse(fs.readFileSync(path.join(BOOTSTRAP_PATH, 'package.json'), 'utf8'));
|
|
275
|
+
const box = strongbox(packageInfo.name);
|
|
276
|
+
try {
|
|
277
|
+
await box.createItemWithValue(TUNNEL_REGISTRY_PORT, String(tunnelCreator.tunnelRegistryPort));
|
|
278
|
+
}
|
|
279
|
+
catch (error) {
|
|
280
|
+
throw new Error(`Tunnel registry port cannot be persisted: ${error.message}`);
|
|
281
|
+
}
|
|
282
|
+
/** @type {import('tls').ConnectionOptions} */
|
|
283
|
+
const tlsOptions = {
|
|
284
|
+
rejectUnauthorized: false,
|
|
285
|
+
minVersion: 'TLSv1.2',
|
|
286
|
+
};
|
|
287
|
+
log.info('Connecting to usbmuxd...');
|
|
288
|
+
const usbmux = await createUsbmux();
|
|
289
|
+
try {
|
|
290
|
+
await tunnelCreator.setupTunnels(usbmux, specificUdid, tlsOptions);
|
|
291
|
+
}
|
|
292
|
+
finally {
|
|
293
|
+
await usbmux.close();
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
(async () => await main())();
|
|
297
|
+
//# sourceMappingURL=tunnel-creation.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tunnel-creation.mjs","sourceRoot":"","sources":["../../scripts/tunnel-creation.mjs"],"names":[],"mappings":";AACA;;;GAGG;AACH,OAAO,EAA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,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseArgValue = parseArgValue;
|
|
4
|
+
/**
|
|
5
|
+
* Get the value of the given argument name.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} argName
|
|
8
|
+
* @returns {string?} The value of the given 'argName'.
|
|
9
|
+
*/
|
|
10
|
+
function parseArgValue(argName) {
|
|
11
|
+
const argNamePattern = new RegExp(`^--${argName}\\b`);
|
|
12
|
+
for (let i = 1; i < process.argv.length; ++i) {
|
|
13
|
+
const arg = process.argv[i];
|
|
14
|
+
if (argNamePattern.test(arg)) {
|
|
15
|
+
return arg.includes('=') ? arg.split('=')[1] : process.argv[i + 1];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../scripts/utils.js"],"names":[],"mappings":";;AAMA,sCASC;AAfD;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,OAAO;IACnC,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC,MAAM,OAAO,KAAK,CAAC,CAAC;IACtD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;QAC7C,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC5B,IAAI,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7B,OAAO,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|