@limrun/appium-xcuitest-driver 10.14.6-lim.2 → 10.14.6-lim.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 (78) hide show
  1. package/README.md +15 -0
  2. package/package.json +1 -18
  3. package/build/lib/commands/deviceInfo.d.ts +0 -12
  4. package/build/lib/commands/deviceInfo.d.ts.map +0 -1
  5. package/build/lib/commands/deviceInfo.js +0 -25
  6. package/build/lib/commands/deviceInfo.js.map +0 -1
  7. package/build/lib/device-connections-factory.d.ts +0 -13
  8. package/build/lib/device-connections-factory.d.ts.map +0 -1
  9. package/build/lib/device-connections-factory.js +0 -244
  10. package/build/lib/device-connections-factory.js.map +0 -1
  11. package/build/lib/device-log/helpers.d.ts +0 -10
  12. package/build/lib/device-log/helpers.d.ts.map +0 -1
  13. package/build/lib/device-log/helpers.js +0 -37
  14. package/build/lib/device-log/helpers.js.map +0 -1
  15. package/build/lib/device-log/ios-crash-log.d.ts +0 -34
  16. package/build/lib/device-log/ios-crash-log.d.ts.map +0 -1
  17. package/build/lib/device-log/ios-crash-log.js +0 -141
  18. package/build/lib/device-log/ios-crash-log.js.map +0 -1
  19. package/build/lib/device-log/ios-device-log.d.ts +0 -19
  20. package/build/lib/device-log/ios-device-log.d.ts.map +0 -1
  21. package/build/lib/device-log/ios-device-log.js +0 -42
  22. package/build/lib/device-log/ios-device-log.js.map +0 -1
  23. package/build/lib/device-log/ios-log.d.ts +0 -24
  24. package/build/lib/device-log/ios-log.d.ts.map +0 -1
  25. package/build/lib/device-log/ios-log.js +0 -50
  26. package/build/lib/device-log/ios-log.js.map +0 -1
  27. package/build/lib/device-log/ios-performance-log.d.ts +0 -18
  28. package/build/lib/device-log/ios-performance-log.d.ts.map +0 -1
  29. package/build/lib/device-log/ios-performance-log.js +0 -43
  30. package/build/lib/device-log/ios-performance-log.js.map +0 -1
  31. package/build/lib/device-log/ios-simulator-log.d.ts +0 -38
  32. package/build/lib/device-log/ios-simulator-log.d.ts.map +0 -1
  33. package/build/lib/device-log/ios-simulator-log.js +0 -184
  34. package/build/lib/device-log/ios-simulator-log.js.map +0 -1
  35. package/build/lib/device-log/line-consuming-log.d.ts +0 -9
  36. package/build/lib/device-log/line-consuming-log.d.ts.map +0 -1
  37. package/build/lib/device-log/line-consuming-log.js +0 -16
  38. package/build/lib/device-log/line-consuming-log.js.map +0 -1
  39. package/build/lib/device-log/safari-console-log.d.ts +0 -67
  40. package/build/lib/device-log/safari-console-log.d.ts.map +0 -1
  41. package/build/lib/device-log/safari-console-log.js +0 -81
  42. package/build/lib/device-log/safari-console-log.js.map +0 -1
  43. package/build/lib/device-log/safari-network-log.d.ts +0 -75
  44. package/build/lib/device-log/safari-network-log.d.ts.map +0 -1
  45. package/build/lib/device-log/safari-network-log.js +0 -47
  46. package/build/lib/device-log/safari-network-log.js.map +0 -1
  47. package/build/lib/ios-fs-helpers.d.ts +0 -75
  48. package/build/lib/ios-fs-helpers.d.ts.map +0 -1
  49. package/build/lib/ios-fs-helpers.js +0 -370
  50. package/build/lib/ios-fs-helpers.js.map +0 -1
  51. package/build/lib/ios-generic-simulators.d.ts +0 -6
  52. package/build/lib/ios-generic-simulators.d.ts.map +0 -1
  53. package/build/lib/ios-generic-simulators.js +0 -14
  54. package/build/lib/ios-generic-simulators.js.map +0 -1
  55. package/build/lib/real-device-clients/base-device-client.d.ts +0 -22
  56. package/build/lib/real-device-clients/base-device-client.d.ts.map +0 -1
  57. package/build/lib/real-device-clients/base-device-client.js +0 -14
  58. package/build/lib/real-device-clients/base-device-client.js.map +0 -1
  59. package/build/lib/real-device-clients/py-ios-device-client.d.ts +0 -21
  60. package/build/lib/real-device-clients/py-ios-device-client.d.ts.map +0 -1
  61. package/build/lib/real-device-clients/py-ios-device-client.js +0 -125
  62. package/build/lib/real-device-clients/py-ios-device-client.js.map +0 -1
  63. package/build/lib/real-device-management.d.ts +0 -53
  64. package/build/lib/real-device-management.d.ts.map +0 -1
  65. package/build/lib/real-device-management.js +0 -128
  66. package/build/lib/real-device-management.js.map +0 -1
  67. package/build/lib/real-device.d.ts +0 -112
  68. package/build/lib/real-device.d.ts.map +0 -1
  69. package/build/lib/real-device.js +0 -352
  70. package/build/lib/real-device.js.map +0 -1
  71. package/build/lib/simulator-management.d.ts +0 -106
  72. package/build/lib/simulator-management.d.ts.map +0 -1
  73. package/build/lib/simulator-management.js +0 -282
  74. package/build/lib/simulator-management.js.map +0 -1
  75. package/build/lib/xcrun.d.ts +0 -3
  76. package/build/lib/xcrun.d.ts.map +0 -1
  77. package/build/lib/xcrun.js +0 -17
  78. package/build/lib/xcrun.js.map +0 -1
package/README.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## Local Dev
2
+
3
+ Delete the existing driver:
4
+ ```bash
5
+
6
+ ```
7
+
8
+ Build the local version and install it:
9
+ ```
10
+ appium driver uninstall xcuitest && \
11
+ npm run build && \
12
+ appium driver install --source local $(pwd) && \
13
+ appium
14
+ ```
15
+
1
16
  # appium-xcuitest-driver
2
17
 
3
18
  [![npm version](http://img.shields.io/npm/v/appium-xcuitest-driver.svg)](https://npmjs.org/package/appium-xcuitest-driver)
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "xcuitest",
9
9
  "xctest"
10
10
  ],
11
- "version": "10.14.6-lim.2",
11
+ "version": "10.14.6-lim.4",
12
12
  "author": "Appium Contributors",
13
13
  "license": "Apache-2.0",
14
14
  "repository": {
@@ -37,23 +37,6 @@
37
37
  "download-wda-sim": "./scripts/download-wda-sim.mjs",
38
38
  "image-mounter": "./scripts/image-mounter.mjs"
39
39
  },
40
- "schema": {
41
- "$schema": "http://json-schema.org/draft-07/schema",
42
- "type": "object",
43
- "properties": {
44
- "webdriveragent-port": {
45
- "appiumCliDest": "wdaLocalPort",
46
- "default": 8100,
47
- "description": "Local port used for communication with WebDriverAgent",
48
- "maximum": 65535,
49
- "minimum": 1,
50
- "type": "integer"
51
- }
52
- },
53
- "additionalProperties": false,
54
- "title": "XCUITest Driver Configuration",
55
- "description": "Appium configuration schema for the XCUITest driver."
56
- },
57
40
  "doctor": {
58
41
  "checks": [
59
42
  "./build/lib/doctor/required-checks.js",
@@ -1,12 +0,0 @@
1
- /**
2
- * Returns the miscellaneous information about the device under test.
3
- *
4
- * Since XCUITest driver v4.2.0, this includes device information via lockdown in a real device.
5
- *
6
- * @returns {Promise<DeviceInfo | (DeviceInfo & LockdownInfo)>} The response of `/wda/device/info'`
7
- * @this {import('../driver').XCUITestDriver}
8
- */
9
- export function mobileGetDeviceInfo(this: import("../driver").XCUITestDriver): Promise<DeviceInfo | (DeviceInfo & LockdownInfo)>;
10
- export type DeviceInfo = import("./types").DeviceInfo;
11
- export type LockdownInfo = import("./types").LockdownInfo;
12
- //# sourceMappingURL=deviceInfo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deviceInfo.d.ts","sourceRoot":"","sources":["../../../lib/commands/deviceInfo.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,+EAHa,OAAO,CAAC,UAAU,GAAG,CAAC,UAAU,GAAG,YAAY,CAAC,CAAC,CAc7D;yBAGY,OAAO,SAAS,EAAE,UAAU;2BAC5B,OAAO,SAAS,EAAE,YAAY"}
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mobileGetDeviceInfo = mobileGetDeviceInfo;
4
- const appium_ios_device_1 = require("appium-ios-device");
5
- /**
6
- * Returns the miscellaneous information about the device under test.
7
- *
8
- * Since XCUITest driver v4.2.0, this includes device information via lockdown in a real device.
9
- *
10
- * @returns {Promise<DeviceInfo | (DeviceInfo & LockdownInfo)>} The response of `/wda/device/info'`
11
- * @this {import('../driver').XCUITestDriver}
12
- */
13
- async function mobileGetDeviceInfo() {
14
- const infoByWda = /** @type {import('./types').DeviceInfo} */ (await this.proxyCommand('/wda/device/info', 'GET'));
15
- if (this.isRealDevice()) {
16
- const lockdownInfo = await appium_ios_device_1.utilities.getDeviceInfo(this.device.udid);
17
- return { ...infoByWda, ...{ lockdownInfo } };
18
- }
19
- return infoByWda;
20
- }
21
- /**
22
- * @typedef {import('./types').DeviceInfo} DeviceInfo
23
- * @typedef {import('./types').LockdownInfo} LockdownInfo
24
- */
25
- //# sourceMappingURL=deviceInfo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deviceInfo.js","sourceRoot":"","sources":["../../../lib/commands/deviceInfo.js"],"names":[],"mappings":";;AAUA,kDAWC;AArBD,yDAA4C;AAE5C;;;;;;;GAOG;AACI,KAAK,UAAU,mBAAmB;IACvC,MAAM,SAAS,GAAG,2CAA2C,CAAC,CAC5D,MAAM,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,KAAK,CAAC,CACnD,CAAC;IAEF,IAAI,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;QACxB,MAAM,YAAY,GAAG,MAAM,6BAAS,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACrE,OAAO,EAAC,GAAG,SAAS,EAAE,GAAG,EAAC,YAAY,EAAC,EAAC,CAAC;IAC3C,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;GAGG"}
@@ -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,244 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.DeviceConnectionsFactory = exports.DEVICE_CONNECTIONS_FACTORY = void 0;
7
- const lodash_1 = __importDefault(require("lodash"));
8
- const net_1 = __importDefault(require("net"));
9
- const bluebird_1 = __importDefault(require("bluebird"));
10
- const support_1 = require("appium/support");
11
- const appium_ios_device_1 = require("appium-ios-device");
12
- const portscanner_1 = require("portscanner");
13
- const asyncbox_1 = require("asyncbox");
14
- const LOCALHOST = '127.0.0.1';
15
- class iProxy {
16
- constructor(udid, localport, deviceport) {
17
- this.localport = parseInt(localport, 10);
18
- this.deviceport = parseInt(deviceport, 10);
19
- this.udid = udid;
20
- this.localServer = null;
21
- this.log = support_1.logger.getLogger(`iProxy@${udid.substring(0, 8)}:${this.localport}`);
22
- }
23
- async start() {
24
- if (this.localServer) {
25
- return;
26
- }
27
- this.localServer = net_1.default.createServer(async (localSocket) => {
28
- let remoteSocket;
29
- try {
30
- // We can only connect to the remote socket after the local socket connection succeeds
31
- remoteSocket = await appium_ios_device_1.utilities.connectPort(this.udid, this.deviceport);
32
- }
33
- catch (e) {
34
- this.log.debug(e.message);
35
- localSocket.destroy();
36
- return;
37
- }
38
- const destroyCommChannel = () => {
39
- remoteSocket.unpipe(localSocket);
40
- localSocket.unpipe(remoteSocket);
41
- };
42
- remoteSocket.once('close', () => {
43
- destroyCommChannel();
44
- localSocket.destroy();
45
- });
46
- // not all remote socket errors are critical for the user
47
- remoteSocket.on('error', (e) => this.log.debug(e));
48
- localSocket.once('end', destroyCommChannel);
49
- localSocket.once('close', () => {
50
- destroyCommChannel();
51
- remoteSocket.destroy();
52
- });
53
- localSocket.on('error', (e) => this.log.warn(e.message));
54
- localSocket.pipe(remoteSocket);
55
- remoteSocket.pipe(localSocket);
56
- });
57
- const listeningPromise = new bluebird_1.default((resolve, reject) => {
58
- /** @type {net.Server} */ (this.localServer).once('listening', resolve);
59
- /** @type {net.Server} */ (this.localServer).once('error', reject);
60
- });
61
- this.localServer.listen(this.localport);
62
- try {
63
- await listeningPromise;
64
- }
65
- catch (e) {
66
- this.localServer = null;
67
- throw e;
68
- }
69
- this.localServer.on('error', (e) => this.log.warn(e.message));
70
- this.localServer.once('close', (e) => {
71
- if (e) {
72
- this.log.info(`The connection has been closed with error ${e.message}`);
73
- }
74
- else {
75
- this.log.info(`The connection has been closed`);
76
- }
77
- this.localServer = null;
78
- });
79
- this.onBeforeProcessExit = this._closeLocalServer.bind(this);
80
- // Make sure we free up the socket on process exit
81
- process.on('beforeExit', this.onBeforeProcessExit);
82
- }
83
- _closeLocalServer() {
84
- if (!this.localServer) {
85
- return;
86
- }
87
- this.log.debug(`Closing the connection`);
88
- this.localServer.close();
89
- this.localServer = null;
90
- }
91
- stop() {
92
- if (this.onBeforeProcessExit) {
93
- process.off('beforeExit', this.onBeforeProcessExit);
94
- this.onBeforeProcessExit = null;
95
- }
96
- this._closeLocalServer();
97
- }
98
- }
99
- const log = support_1.logger.getLogger('DevCon Factory');
100
- const PORT_CLOSE_TIMEOUT = 15 * 1000; // 15 seconds
101
- const SPLITTER = ':';
102
- class DeviceConnectionsFactory {
103
- constructor() {
104
- this._connectionsMapping = {};
105
- }
106
- _udidAsToken(udid) {
107
- return `${support_1.util.hasValue(udid) ? udid : ''}${SPLITTER}`;
108
- }
109
- _portAsToken(port) {
110
- return `${SPLITTER}${support_1.util.hasValue(port) ? port : ''}`;
111
- }
112
- _toKey(udid = null, port = null) {
113
- return `${support_1.util.hasValue(udid) ? udid : ''}${SPLITTER}${support_1.util.hasValue(port) ? port : ''}`;
114
- }
115
- _releaseProxiedConnections(connectionKeys) {
116
- const keys = connectionKeys.filter((k) => lodash_1.default.has(this._connectionsMapping[k], 'iproxy'));
117
- for (const key of keys) {
118
- log.info(`Releasing the listener for '${key}'`);
119
- try {
120
- this._connectionsMapping[key].iproxy.stop();
121
- }
122
- catch (e) {
123
- log.debug(e);
124
- }
125
- }
126
- return keys;
127
- }
128
- listConnections(udid = null, port = null, strict = false) {
129
- if (!udid && !port) {
130
- return [];
131
- }
132
- // `this._connectionMapping` keys have format `udid:port`
133
- // the `strict` argument enforces to match keys having both `udid` and `port`
134
- // if they are defined
135
- // while in non-strict mode keys having any of these are going to be matched
136
- return lodash_1.default.keys(this._connectionsMapping).filter((key) => strict && udid && port
137
- ? key === this._toKey(udid, port)
138
- : (udid && key.startsWith(this._udidAsToken(udid))) ||
139
- (port && key.endsWith(this._portAsToken(port))));
140
- }
141
- async requestConnection(udid, port, options = {}) {
142
- if (!udid || !port) {
143
- log.warn('Did not know how to request the connection:');
144
- if (!udid) {
145
- log.warn('- Device UDID is unset');
146
- }
147
- if (!port) {
148
- log.warn('- The local port number is unset');
149
- }
150
- return;
151
- }
152
- const { usePortForwarding, devicePort } = options;
153
- log.info(`Requesting connection for device ${udid} on local port ${port}` +
154
- (devicePort ? `, device port ${devicePort}` : ''));
155
- log.debug(`Cached connections count: ${lodash_1.default.size(this._connectionsMapping)}`);
156
- const connectionsOnPort = this.listConnections(null, port);
157
- if (!lodash_1.default.isEmpty(connectionsOnPort)) {
158
- log.info(`Found cached connections on port #${port}: ${JSON.stringify(connectionsOnPort)}`);
159
- }
160
- if (usePortForwarding) {
161
- let isPortBusy = (await (0, portscanner_1.checkPortStatus)(port, LOCALHOST)) === 'open';
162
- if (isPortBusy) {
163
- log.warn(`Port #${port} is busy. Did you quit the previous driver session(s) properly?`);
164
- if (!lodash_1.default.isEmpty(connectionsOnPort)) {
165
- log.info('Trying to release the port');
166
- for (const key of this._releaseProxiedConnections(connectionsOnPort)) {
167
- delete this._connectionsMapping[key];
168
- }
169
- const timer = new support_1.timing.Timer().start();
170
- try {
171
- await (0, asyncbox_1.waitForCondition)(async () => {
172
- try {
173
- if ((await (0, portscanner_1.checkPortStatus)(port, LOCALHOST)) !== 'open') {
174
- log.info(`Port #${port} has been successfully released after ` +
175
- `${timer.getDuration().asMilliSeconds.toFixed(0)}ms`);
176
- isPortBusy = false;
177
- return true;
178
- }
179
- }
180
- catch { }
181
- return false;
182
- }, {
183
- waitMs: PORT_CLOSE_TIMEOUT,
184
- intervalMs: 300,
185
- });
186
- }
187
- catch {
188
- log.warn(`Did not know how to release port #${port} in ` +
189
- `${timer.getDuration().asMilliSeconds.toFixed(0)}ms`);
190
- }
191
- }
192
- }
193
- if (isPortBusy) {
194
- throw new Error(`The port #${port} is occupied by an other process. ` +
195
- `You can either quit that process or select another free port.`);
196
- }
197
- }
198
- const currentKey = this._toKey(udid, port);
199
- if (usePortForwarding) {
200
- const iproxy = new iProxy(udid, port, devicePort);
201
- try {
202
- await iproxy.start();
203
- this._connectionsMapping[currentKey] = { iproxy };
204
- }
205
- catch (e) {
206
- try {
207
- iproxy.stop();
208
- }
209
- catch (e1) {
210
- log.debug(e1);
211
- }
212
- throw e;
213
- }
214
- }
215
- else {
216
- this._connectionsMapping[currentKey] = {};
217
- }
218
- log.info(`Successfully requested the connection for ${currentKey}`);
219
- }
220
- releaseConnection(udid = null, port = null) {
221
- if (!udid && !port) {
222
- log.warn('Neither device UDID nor local port is set. ' +
223
- 'Did not know how to release the connection');
224
- return;
225
- }
226
- log.info(`Releasing connections for ${udid || 'any'} device on ${port || 'any'} port number`);
227
- const keys = this.listConnections(udid, port, true);
228
- if (lodash_1.default.isEmpty(keys)) {
229
- log.info('No cached connections have been found');
230
- return;
231
- }
232
- log.info(`Found cached connections to release: ${JSON.stringify(keys)}`);
233
- this._releaseProxiedConnections(keys);
234
- for (const key of keys) {
235
- delete this._connectionsMapping[key];
236
- }
237
- log.debug(`Cached connections count: ${lodash_1.default.size(this._connectionsMapping)}`);
238
- }
239
- }
240
- exports.DeviceConnectionsFactory = DeviceConnectionsFactory;
241
- const DEVICE_CONNECTIONS_FACTORY = new DeviceConnectionsFactory();
242
- exports.DEVICE_CONNECTIONS_FACTORY = DEVICE_CONNECTIONS_FACTORY;
243
- exports.default = DEVICE_CONNECTIONS_FACTORY;
244
- //# sourceMappingURL=device-connections-factory.js.map
@@ -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;YACz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GAAG,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;YAClD,OAAO;QACT,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,wCAAwC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACzE,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,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,10 +0,0 @@
1
- import type { LogEntry } from '../commands/types';
2
- export declare const DEFAULT_LOG_LEVEL = "ALL";
3
- export declare const MAX_JSON_LOG_LENGTH = 200;
4
- export declare const MAX_BUFFERED_EVENTS_COUNT = 5000;
5
- export declare function toLogEntry(message: string, timestamp: number, level?: string): LogEntry;
6
- export interface GrepOptions {
7
- caseInsensitive?: boolean;
8
- }
9
- export declare function grepFile(fullPath: string, str: string, opts?: GrepOptions): Promise<boolean>;
10
- //# sourceMappingURL=helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../lib/device-log/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAKlD,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AACvC,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,GAAE,MAA0B,GAAG,QAAQ,CAM1G;AAED,MAAM,WAAW,WAAW;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAsB,QAAQ,CAC5B,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,WAAgB,GACrB,OAAO,CAAC,OAAO,CAAC,CAclB"}
@@ -1,37 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.MAX_BUFFERED_EVENTS_COUNT = exports.MAX_JSON_LOG_LENGTH = exports.DEFAULT_LOG_LEVEL = void 0;
7
- exports.toLogEntry = toLogEntry;
8
- exports.grepFile = grepFile;
9
- const support_1 = require("appium/support");
10
- const node_readline_1 = require("node:readline");
11
- const lodash_1 = __importDefault(require("lodash"));
12
- exports.DEFAULT_LOG_LEVEL = 'ALL';
13
- exports.MAX_JSON_LOG_LENGTH = 200;
14
- exports.MAX_BUFFERED_EVENTS_COUNT = 5000;
15
- function toLogEntry(message, timestamp, level = exports.DEFAULT_LOG_LEVEL) {
16
- return {
17
- timestamp,
18
- level,
19
- message,
20
- };
21
- }
22
- async function grepFile(fullPath, str, opts = {}) {
23
- const input = support_1.fs.createReadStream(fullPath);
24
- const rl = (0, node_readline_1.createInterface)({ input });
25
- return await new Promise((resolve, reject) => {
26
- input.once('error', reject);
27
- rl.on('line', (line) => {
28
- if (opts.caseInsensitive && lodash_1.default.toLower(line).includes(lodash_1.default.toLower(str))
29
- || !opts.caseInsensitive && line.includes(str)) {
30
- resolve(true);
31
- input.close();
32
- }
33
- });
34
- input.once('end', () => resolve(false));
35
- });
36
- }
37
- //# sourceMappingURL=helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../lib/device-log/helpers.ts"],"names":[],"mappings":";;;;;;AAS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SLog } from './ios-log';
2
- import type { AppiumLogger } from '@appium/types';
3
- import type { Simulator } from '@limrun/appium-ios-simulator';
4
- import type { LogEntry } from '../commands/types';
5
- type TSerializedEntry = [string, number];
6
- export interface IOSCrashLogOptions {
7
- /** UDID of a real device */
8
- udid?: string;
9
- /** Simulator instance */
10
- sim?: Simulator;
11
- log: AppiumLogger;
12
- }
13
- export declare class IOSCrashLog extends IOSLog<TSerializedEntry, TSerializedEntry> {
14
- private readonly _udid;
15
- private readonly _realDeviceClient;
16
- private readonly _logDir;
17
- private readonly _sim;
18
- private _recentCrashFiles;
19
- private _started;
20
- constructor(opts: IOSCrashLogOptions);
21
- startCapture(): Promise<void>;
22
- stopCapture(): Promise<void>;
23
- get isCapturing(): boolean;
24
- getLogs(): Promise<LogEntry[]>;
25
- protected _serializeEntry(value: TSerializedEntry): TSerializedEntry;
26
- protected _deserializeEntry(value: TSerializedEntry): LogEntry;
27
- private _serializeCrashes;
28
- private _gatherFromRealDevice;
29
- private _gatherFromSimulator;
30
- private _listCrashFiles;
31
- private _isRealDevice;
32
- }
33
- export default IOSCrashLog;
34
- //# sourceMappingURL=ios-crash-log.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ios-crash-log.d.ts","sourceRoot":"","sources":["../../../lib/device-log/ios-crash-log.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AAEjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAQlD,KAAK,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEzC,MAAM,WAAW,kBAAkB;IACjC,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,GAAG,EAAE,YAAY,CAAC;CACnB;AAED,qBAAa,WAAY,SAAQ,MAAM,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IACzE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqB;IAC3C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA0B;IAC5D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IACxC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAwB;IAC7C,OAAO,CAAC,iBAAiB,CAAW;IACpC,OAAO,CAAC,QAAQ,CAAU;gBAEd,IAAI,EAAE,kBAAkB;IAoBrB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAK7B,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3C,IAAa,WAAW,IAAI,OAAO,CAElC;IAEc,OAAO,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;cAa1B,eAAe,CAAC,KAAK,EAAE,gBAAgB,GAAG,gBAAgB;cAI1D,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,QAAQ;YAKzD,iBAAiB;YA0BjB,qBAAqB;YAerB,oBAAoB;YAsBpB,eAAe;IAM7B,OAAO,CAAC,aAAa;CAGtB;AAED,eAAe,WAAW,CAAC"}
@@ -1,141 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.IOSCrashLog = void 0;
7
- const support_1 = require("appium/support");
8
- const bluebird_1 = __importDefault(require("bluebird"));
9
- const path_1 = __importDefault(require("path"));
10
- const lodash_1 = __importDefault(require("lodash"));
11
- const py_ios_device_client_1 = require("../real-device-clients/py-ios-device-client");
12
- const ios_log_1 = require("./ios-log");
13
- const helpers_1 = require("./helpers");
14
- // The file format has been changed from '.crash' to '.ips' since Monterey.
15
- const CRASH_REPORTS_GLOB_PATTERN = '**/*.@(crash|ips)';
16
- // The size of a single diagnostic report might be hundreds of kilobytes.
17
- // Thus we do not want to store too many items in the memory at once.
18
- const MAX_RECENT_ITEMS = 20;
19
- class IOSCrashLog extends ios_log_1.IOSLog {
20
- _udid;
21
- _realDeviceClient;
22
- _logDir;
23
- _sim;
24
- _recentCrashFiles;
25
- _started;
26
- constructor(opts) {
27
- super({
28
- log: opts.log,
29
- maxBufferSize: MAX_RECENT_ITEMS,
30
- });
31
- this._udid = opts.udid;
32
- this._sim = opts.sim;
33
- this._realDeviceClient = this._isRealDevice()
34
- ? new py_ios_device_client_1.Pyidevice({
35
- udid: this._udid,
36
- log: opts.log,
37
- })
38
- : null;
39
- this._logDir = this._isRealDevice()
40
- ? null
41
- : path_1.default.resolve(process.env.HOME || '/', 'Library', 'Logs', 'DiagnosticReports');
42
- this._recentCrashFiles = [];
43
- this._started = false;
44
- }
45
- async startCapture() {
46
- this._recentCrashFiles = await this._listCrashFiles(false);
47
- this._started = true;
48
- }
49
- async stopCapture() {
50
- this._started = false;
51
- }
52
- get isCapturing() {
53
- return this._started;
54
- }
55
- async getLogs() {
56
- const crashFiles = (await this._listCrashFiles(true)).slice(-MAX_RECENT_ITEMS);
57
- const diffFiles = lodash_1.default.difference(crashFiles, this._recentCrashFiles);
58
- if (lodash_1.default.isEmpty(diffFiles)) {
59
- return [];
60
- }
61
- this.log.debug(`Found ${support_1.util.pluralize('fresh crash report', diffFiles.length, true)}`);
62
- await this._serializeCrashes(diffFiles);
63
- this._recentCrashFiles = crashFiles;
64
- return super.getLogs();
65
- }
66
- _serializeEntry(value) {
67
- return value;
68
- }
69
- _deserializeEntry(value) {
70
- const [message, timestamp] = value;
71
- return (0, helpers_1.toLogEntry)(message, timestamp);
72
- }
73
- async _serializeCrashes(paths) {
74
- const tmpRoot = await support_1.tempDir.openDir();
75
- try {
76
- for (const filePath of paths) {
77
- let fullPath = filePath;
78
- if (this._isRealDevice()) {
79
- const fileName = filePath;
80
- try {
81
- await this._realDeviceClient.exportCrash(fileName, tmpRoot);
82
- }
83
- catch (e) {
84
- this.log.warn(`Cannot export the crash report '${fileName}'. Skipping it. ` +
85
- `Original error: ${e.message}`);
86
- return;
87
- }
88
- fullPath = path_1.default.join(tmpRoot, fileName);
89
- }
90
- const { ctime } = await support_1.fs.stat(fullPath);
91
- this.broadcast([await support_1.fs.readFile(fullPath, 'utf8'), ctime.getTime()]);
92
- }
93
- }
94
- finally {
95
- await support_1.fs.rimraf(tmpRoot);
96
- }
97
- }
98
- async _gatherFromRealDevice(strict) {
99
- if (!this._realDeviceClient) {
100
- return [];
101
- }
102
- if (!await this._realDeviceClient.assertExists(strict)) {
103
- this.log.info(`The ${lodash_1.default.toLower(this._realDeviceClient.constructor.name)} tool is not present in PATH. ` +
104
- `Skipping crash logs collection for real devices.`);
105
- return [];
106
- }
107
- return await this._realDeviceClient.listCrashes();
108
- }
109
- async _gatherFromSimulator() {
110
- if (!this._logDir || !this._sim || !(await support_1.fs.exists(this._logDir))) {
111
- this.log.debug(`Crash reports root '${this._logDir}' does not exist. Got nothing to gather.`);
112
- return [];
113
- }
114
- const foundFiles = await support_1.fs.glob(CRASH_REPORTS_GLOB_PATTERN, {
115
- cwd: this._logDir,
116
- absolute: true,
117
- });
118
- const simUdid = this._sim.udid;
119
- // For Simulator only include files, that contain current UDID
120
- return await bluebird_1.default.filter(foundFiles, async (filePath) => {
121
- try {
122
- return await (0, helpers_1.grepFile)(filePath, simUdid, { caseInsensitive: true });
123
- }
124
- catch (err) {
125
- this.log.warn(err);
126
- return false;
127
- }
128
- });
129
- }
130
- async _listCrashFiles(strict) {
131
- return this._isRealDevice()
132
- ? await this._gatherFromRealDevice(strict)
133
- : await this._gatherFromSimulator();
134
- }
135
- _isRealDevice() {
136
- return Boolean(this._udid);
137
- }
138
- }
139
- exports.IOSCrashLog = IOSCrashLog;
140
- exports.default = IOSCrashLog;
141
- //# sourceMappingURL=ios-crash-log.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ios-crash-log.js","sourceRoot":"","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CAAC,oBAAoB,EAAE,CAAC;IACxC,CAAC;IAEO,aAAa;QACnB,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;CACF;AAvID,kCAuIC;AAED,kBAAe,WAAW,CAAC"}
@@ -1,19 +0,0 @@
1
- import { LineConsumingLog } from './line-consuming-log';
2
- import type { AppiumLogger } from '@appium/types';
3
- export interface IOSDeviceLogOpts {
4
- udid: string;
5
- showLogs?: boolean;
6
- log: AppiumLogger;
7
- }
8
- export declare class IOSDeviceLog extends LineConsumingLog {
9
- private readonly udid;
10
- private readonly showLogs;
11
- private service;
12
- constructor(opts: IOSDeviceLogOpts);
13
- startCapture(): Promise<void>;
14
- get isCapturing(): boolean;
15
- stopCapture(): Promise<void>;
16
- private onLog;
17
- }
18
- export default IOSDeviceLog;
19
- //# sourceMappingURL=ios-device-log.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ios-device-log.d.ts","sourceRoot":"","sources":["../../../lib/device-log/ios-device-log.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,EAAE,YAAY,CAAC;CACnB;AAED,qBAAa,YAAa,SAAQ,gBAAgB;IAChD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IACnC,OAAO,CAAC,OAAO,CAAa;gBAEhB,IAAI,EAAE,gBAAgB;IAOnB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ5C,IAAa,WAAW,IAAI,OAAO,CAElC;IAEc,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ3C,OAAO,CAAC,KAAK;CAMd;AAED,eAAe,YAAY,CAAC"}