appium-xcuitest-driver 7.21.0 → 7.21.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 +12 -0
- package/build/lib/commands/context.d.ts.map +1 -1
- package/build/lib/commands/context.js +4 -1
- package/build/lib/commands/context.js.map +1 -1
- package/build/lib/commands/log.d.ts +0 -8
- package/build/lib/commands/log.d.ts.map +1 -1
- package/build/lib/commands/log.js +7 -15
- package/build/lib/commands/log.js.map +1 -1
- package/build/lib/commands/types.d.ts +5 -0
- package/build/lib/commands/types.d.ts.map +1 -1
- package/build/lib/device-log/helpers.d.ts +3 -0
- package/build/lib/device-log/helpers.d.ts.map +1 -0
- package/build/lib/device-log/helpers.js +11 -0
- package/build/lib/device-log/helpers.js.map +1 -0
- package/build/lib/device-log/ios-crash-log.d.ts +6 -17
- package/build/lib/device-log/ios-crash-log.d.ts.map +1 -1
- package/build/lib/device-log/ios-crash-log.js +4 -10
- package/build/lib/device-log/ios-crash-log.js.map +1 -1
- package/build/lib/device-log/ios-device-log.d.ts +17 -8
- package/build/lib/device-log/ios-device-log.d.ts.map +1 -1
- package/build/lib/device-log/ios-device-log.js +9 -21
- package/build/lib/device-log/ios-device-log.js.map +1 -1
- package/build/lib/device-log/ios-log.d.ts +24 -16
- package/build/lib/device-log/ios-log.d.ts.map +1 -1
- package/build/lib/device-log/ios-log.js +40 -38
- package/build/lib/device-log/ios-log.js.map +1 -1
- package/build/lib/device-log/ios-performance-log.d.ts +19 -10
- package/build/lib/device-log/ios-performance-log.d.ts.map +1 -1
- package/build/lib/device-log/ios-performance-log.js +28 -30
- package/build/lib/device-log/ios-performance-log.js.map +1 -1
- package/build/lib/device-log/ios-simulator-log.d.ts +22 -18
- package/build/lib/device-log/ios-simulator-log.d.ts.map +1 -1
- package/build/lib/device-log/ios-simulator-log.js +39 -61
- package/build/lib/device-log/ios-simulator-log.js.map +1 -1
- package/build/lib/device-log/line-consuming-log.d.ts +9 -0
- package/build/lib/device-log/line-consuming-log.d.ts.map +1 -0
- package/build/lib/device-log/line-consuming-log.js +16 -0
- package/build/lib/device-log/line-consuming-log.js.map +1 -0
- package/lib/commands/context.js +4 -1
- package/lib/commands/log.js +9 -16
- package/lib/commands/types.ts +6 -0
- package/lib/device-log/helpers.ts +9 -0
- package/lib/device-log/ios-crash-log.js +4 -11
- package/lib/device-log/ios-device-log.ts +52 -0
- package/lib/device-log/ios-log.ts +87 -0
- package/lib/device-log/ios-performance-log.ts +61 -0
- package/lib/device-log/ios-simulator-log.ts +119 -0
- package/lib/device-log/line-consuming-log.ts +16 -0
- package/npm-shrinkwrap.json +52 -27
- package/package.json +2 -2
- package/lib/device-log/ios-device-log.js +0 -54
- package/lib/device-log/ios-log.js +0 -65
- package/lib/device-log/ios-performance-log.js +0 -57
- package/lib/device-log/ios-simulator-log.js +0 -124
|
@@ -2,57 +2,59 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IOSLog = void 0;
|
|
4
4
|
const events_1 = require("events");
|
|
5
|
+
const lru_cache_1 = require("lru-cache");
|
|
6
|
+
const support_1 = require("appium/support");
|
|
5
7
|
// We keep only the most recent log entries to avoid out of memory error
|
|
6
8
|
const MAX_LOG_ENTRIES_COUNT = 10000;
|
|
7
9
|
class IOSLog extends events_1.EventEmitter {
|
|
8
|
-
constructor() {
|
|
10
|
+
constructor(opts = {}) {
|
|
9
11
|
super();
|
|
10
|
-
this.
|
|
11
|
-
this.
|
|
12
|
-
|
|
12
|
+
this.maxBufferSize = opts.maxBufferSize ?? MAX_LOG_ENTRIES_COUNT;
|
|
13
|
+
this.logs = new lru_cache_1.LRUCache({
|
|
14
|
+
max: this.maxBufferSize,
|
|
15
|
+
});
|
|
16
|
+
this.logIndexSinceLastRequest = null;
|
|
17
|
+
this._log = opts.log ?? support_1.logger.getLogger(this.constructor.name);
|
|
13
18
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
async startCapture() {
|
|
17
|
-
throw new Error(`Sub-classes need to implement a 'startCapture' function`);
|
|
19
|
+
get log() {
|
|
20
|
+
return this._log;
|
|
18
21
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const logObj = {
|
|
30
|
-
timestamp: Date.now(),
|
|
31
|
-
level: 'ALL',
|
|
32
|
-
message: logLine,
|
|
33
|
-
};
|
|
34
|
-
this.logs.push(logObj);
|
|
35
|
-
this.emit('output', logObj);
|
|
36
|
-
if (this.logs.length > this.maxBufferSize) {
|
|
37
|
-
this.logs.shift();
|
|
38
|
-
if (this.logIdxSinceLastRequest > 0) {
|
|
39
|
-
--this.logIdxSinceLastRequest;
|
|
40
|
-
}
|
|
22
|
+
broadcast(entry) {
|
|
23
|
+
let recentIndex = -1;
|
|
24
|
+
for (const key of this.logs.rkeys()) {
|
|
25
|
+
recentIndex = key;
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
const serializedEntry = this._serializeEntry(entry);
|
|
29
|
+
this.logs.set(++recentIndex, serializedEntry);
|
|
30
|
+
if (this.listenerCount('output')) {
|
|
31
|
+
this.emit('output', this._deserializeEntry(serializedEntry));
|
|
41
32
|
}
|
|
42
33
|
}
|
|
43
34
|
getLogs() {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
const result = [];
|
|
36
|
+
let recentLogIndex = null;
|
|
37
|
+
for (const [index, value] of this.logs.entries()) {
|
|
38
|
+
if (this.logIndexSinceLastRequest && index > this.logIndexSinceLastRequest
|
|
39
|
+
|| !this.logIndexSinceLastRequest) {
|
|
40
|
+
recentLogIndex = index;
|
|
41
|
+
result.push(this._deserializeEntry(value));
|
|
48
42
|
}
|
|
49
|
-
this.logIdxSinceLastRequest = this.logs.length;
|
|
50
|
-
return result;
|
|
51
43
|
}
|
|
52
|
-
|
|
44
|
+
if (recentLogIndex !== null) {
|
|
45
|
+
this.logIndexSinceLastRequest = recentLogIndex;
|
|
46
|
+
}
|
|
47
|
+
return result;
|
|
53
48
|
}
|
|
54
49
|
getAllLogs() {
|
|
55
|
-
|
|
50
|
+
const result = [];
|
|
51
|
+
for (const value of this.logs.values()) {
|
|
52
|
+
result.push(this._deserializeEntry(value));
|
|
53
|
+
}
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
_clearEntries() {
|
|
57
|
+
this.logs.clear();
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
exports.IOSLog = IOSLog;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ios-log.js","sourceRoot":"","sources":["../../../lib/device-log/ios-log.
|
|
1
|
+
{"version":3,"file":"ios-log.js","sourceRoot":"","sources":["../../../lib/device-log/ios-log.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AACpC,yCAAqC;AAGrC,4CAAsC;AAEtC,wEAAwE;AACxE,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAOpC,MAAsB,MAGpB,SAAQ,qBAAY;IAMpB,YAAY,OAAsB,EAAE;QAClC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,IAAI,qBAAqB,CAAC;QACjE,IAAI,CAAC,IAAI,GAAG,IAAI,oBAAQ,CAAC;YACvB,GAAG,EAAE,IAAI,CAAC,aAAa;SACxB,CAAC,CAAC;QACH,IAAI,CAAC,wBAAwB,GAAG,IAAI,CAAC;QACrC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,IAAI,gBAAM,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAClE,CAAC;IAMD,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,SAAS,CAAC,KAAgB;QACxB,IAAI,WAAW,GAAG,CAAC,CAAC,CAAC;QACr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AC7C,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAKS,aAAa;QACrB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;CACF;AAtED,wBAsEC;AAED,kBAAe,MAAM,CAAC"}
|
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { IOSLog } from './ios-log';
|
|
2
|
+
import type { LogEntry } from '../commands/types';
|
|
3
|
+
import type { AppiumLogger } from '@appium/types';
|
|
4
|
+
type PerformanceLogEntry = object;
|
|
5
|
+
export interface IOSPerformanceLogOptions {
|
|
4
6
|
remoteDebugger: any;
|
|
5
|
-
maxEvents
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
maxEvents?: number;
|
|
8
|
+
log?: AppiumLogger;
|
|
9
|
+
}
|
|
10
|
+
export declare class IOSPerformanceLog extends IOSLog<PerformanceLogEntry, PerformanceLogEntry> {
|
|
11
|
+
private remoteDebugger;
|
|
12
|
+
private _started;
|
|
13
|
+
constructor(opts: IOSPerformanceLogOptions);
|
|
14
|
+
startCapture(): Promise<void>;
|
|
15
|
+
stopCapture(): Promise<void>;
|
|
16
|
+
get isCapturing(): boolean;
|
|
17
|
+
protected _serializeEntry(value: PerformanceLogEntry): PerformanceLogEntry;
|
|
18
|
+
protected _deserializeEntry(value: PerformanceLogEntry): LogEntry;
|
|
19
|
+
private onTimelineEvent;
|
|
12
20
|
}
|
|
21
|
+
export default IOSPerformanceLog;
|
|
13
22
|
//# sourceMappingURL=ios-performance-log.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ios-performance-log.d.ts","sourceRoot":"","sources":["../../../lib/device-log/ios-performance-log.
|
|
1
|
+
{"version":3,"file":"ios-performance-log.d.ts","sourceRoot":"","sources":["../../../lib/device-log/ios-performance-log.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAIlD,KAAK,mBAAmB,GAAG,MAAM,CAAC;AAClC,MAAM,WAAW,wBAAwB;IACvC,cAAc,EAAE,GAAG,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,YAAY,CAAC;CACpB;AAED,qBAAa,iBAAkB,SAAQ,MAAM,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;IACrF,OAAO,CAAC,cAAc,CAAM;IAC5B,OAAO,CAAC,QAAQ,CAAU;gBAEd,IAAI,EAAE,wBAAwB;IAS3B,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ7B,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAO3C,IAAa,WAAW,IAAI,OAAO,CAElC;cAEkB,eAAe,CAAC,KAAK,EAAE,mBAAmB,GAAG,mBAAmB;cAIhE,iBAAiB,CAAC,KAAK,EAAE,mBAAmB,GAAG,QAAQ;IAI1E,OAAO,CAAC,eAAe;CAIxB;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -4,45 +4,43 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.IOSPerformanceLog = void 0;
|
|
7
|
-
const support_1 = require("appium/support");
|
|
8
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
-
const
|
|
8
|
+
const ios_log_1 = require("./ios-log");
|
|
10
9
|
const MAX_EVENTS = 5000;
|
|
11
|
-
class IOSPerformanceLog {
|
|
12
|
-
constructor(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
class IOSPerformanceLog extends ios_log_1.IOSLog {
|
|
11
|
+
constructor(opts) {
|
|
12
|
+
super({
|
|
13
|
+
maxBufferSize: opts.maxEvents ?? MAX_EVENTS,
|
|
14
|
+
log: opts.log,
|
|
15
|
+
});
|
|
16
|
+
this.remoteDebugger = opts.remoteDebugger;
|
|
17
|
+
this._started = false;
|
|
16
18
|
}
|
|
17
19
|
async startCapture() {
|
|
18
|
-
log.debug('Starting performance (Timeline) log capture');
|
|
19
|
-
this.
|
|
20
|
-
|
|
20
|
+
this.log.debug('Starting performance (Timeline) log capture');
|
|
21
|
+
this._clearEntries();
|
|
22
|
+
const result = await this.remoteDebugger.startTimeline(this.onTimelineEvent.bind(this));
|
|
23
|
+
this._started = true;
|
|
24
|
+
return result;
|
|
21
25
|
}
|
|
22
26
|
async stopCapture() {
|
|
23
|
-
log.debug('Stopping performance (Timeline) log capture');
|
|
24
|
-
|
|
27
|
+
this.log.debug('Stopping performance (Timeline) log capture');
|
|
28
|
+
const result = await this.remoteDebugger.stopTimeline();
|
|
29
|
+
this._started = false;
|
|
30
|
+
return result;
|
|
25
31
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
let removedEvent = this.timelineEvents.shift();
|
|
32
|
-
log.warn(`Too many Timeline events, removing earliest: ${lodash_1.default.truncate(JSON.stringify(removedEvent))}`);
|
|
33
|
-
}
|
|
32
|
+
get isCapturing() {
|
|
33
|
+
return this._started;
|
|
34
|
+
}
|
|
35
|
+
_serializeEntry(value) {
|
|
36
|
+
return value;
|
|
34
37
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
let events = this.timelineEvents;
|
|
38
|
-
// flush events
|
|
39
|
-
log.debug('Flushing Timeline events');
|
|
40
|
-
this.timelineEvents = [];
|
|
41
|
-
return events;
|
|
38
|
+
_deserializeEntry(value) {
|
|
39
|
+
return value;
|
|
42
40
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
onTimelineEvent(event) {
|
|
42
|
+
this.log.debug(`Received Timeline event: ${lodash_1.default.truncate(JSON.stringify(event))}`);
|
|
43
|
+
this.broadcast(event);
|
|
46
44
|
}
|
|
47
45
|
}
|
|
48
46
|
exports.IOSPerformanceLog = IOSPerformanceLog;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ios-performance-log.js","sourceRoot":"","sources":["../../../lib/device-log/ios-performance-log.
|
|
1
|
+
{"version":3,"file":"ios-performance-log.js","sourceRoot":"","sources":["../../../lib/device-log/ios-performance-log.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,uCAAmC;AAInC,MAAM,UAAU,GAAG,IAAI,CAAC;AASxB,MAAa,iBAAkB,SAAQ,gBAAgD;IAIrF,YAAY,IAA8B;QACxC,KAAK,CAAC;YACJ,aAAa,EAAE,IAAI,CAAC,SAAS,IAAI,UAAU;YAC3C,GAAG,EAAE,IAAI,CAAC,GAAG;SACd,CAAC,CAAC;QACH,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QAC1C,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC;IAEQ,KAAK,CAAC,YAAY;QACzB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAC;QAC9D,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACxF,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,OAAO,MAAM,CAAC;IAChB,CAAC;IAEQ,KAAK,CAAC,WAAW;QACxB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAC;QAC9D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC;QACxD,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAEkB,eAAe,CAAC,KAA0B;QAC3D,OAAO,KAAK,CAAC;IACf,CAAC;IAEkB,iBAAiB,CAAC,KAA0B;QAC7D,OAAO,KAAiB,CAAC;IAC3B,CAAC;IAEO,eAAe,CAAC,KAA0B;QAChD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,4BAA4B,gBAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;QAChF,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;CACF;AA5CD,8CA4CC;AAED,kBAAe,iBAAiB,CAAC"}
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { LineConsumingLog } from './line-consuming-log';
|
|
2
|
+
import type { Simulator } from 'appium-ios-simulator';
|
|
3
|
+
import type { AppiumLogger } from '@appium/types';
|
|
4
|
+
export interface IOSSimulatorLogOptions {
|
|
5
|
+
sim: Simulator;
|
|
6
|
+
showLogs?: boolean;
|
|
7
|
+
iosSimulatorLogsPredicate?: string;
|
|
8
|
+
log?: AppiumLogger;
|
|
9
|
+
}
|
|
10
|
+
export declare class IOSSimulatorLog extends LineConsumingLog {
|
|
11
|
+
private sim;
|
|
12
|
+
private showLogs;
|
|
13
|
+
private predicate?;
|
|
14
|
+
private proc;
|
|
15
|
+
constructor(opts: IOSSimulatorLogOptions);
|
|
16
|
+
startCapture(): Promise<void>;
|
|
17
|
+
stopCapture(): Promise<void>;
|
|
18
|
+
get isCapturing(): boolean;
|
|
19
|
+
private onOutput;
|
|
20
|
+
private killLogSubProcess;
|
|
21
|
+
private finishStartingLogCapture;
|
|
18
22
|
}
|
|
19
|
-
|
|
23
|
+
export default IOSSimulatorLog;
|
|
20
24
|
//# sourceMappingURL=ios-simulator-log.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ios-simulator-log.d.ts","sourceRoot":"","sources":["../../../lib/device-log/ios-simulator-log.
|
|
1
|
+
{"version":3,"file":"ios-simulator-log.d.ts","sourceRoot":"","sources":["../../../lib/device-log/ios-simulator-log.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAMlD,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,SAAS,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,GAAG,CAAC,EAAE,YAAY,CAAC;CACpB;AAED,qBAAa,eAAgB,SAAQ,gBAAgB;IACnD,OAAO,CAAC,GAAG,CAAY;IACvB,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,SAAS,CAAC,CAAS;IAC3B,OAAO,CAAC,IAAI,CAAoB;gBAEpB,IAAI,EAAE,sBAAsB;IAQzB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IA2B7B,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ3C,IAAa,WAAW,IAAI,OAAO,CAElC;IAED,OAAO,CAAC,QAAQ;YAQF,iBAAiB;YAiBjB,wBAAwB;CAqBvC;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -5,18 +5,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.IOSSimulatorLog = void 0;
|
|
7
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
-
const ios_log_1 = require("./ios-log");
|
|
9
|
-
const support_1 = require("appium/support");
|
|
10
8
|
const teen_process_1 = require("teen_process");
|
|
11
|
-
const
|
|
9
|
+
const line_consuming_log_1 = require("./line-consuming-log");
|
|
10
|
+
const EXECVP_ERROR_PATTERN = /execvp\(\)/;
|
|
12
11
|
const START_TIMEOUT = 10000;
|
|
13
|
-
class IOSSimulatorLog extends
|
|
14
|
-
constructor(
|
|
15
|
-
super();
|
|
16
|
-
this.sim = sim;
|
|
17
|
-
this.showLogs = !!showLogs;
|
|
18
|
-
this.
|
|
19
|
-
this.predicate = iosSimulatorLogsPredicate;
|
|
12
|
+
class IOSSimulatorLog extends line_consuming_log_1.LineConsumingLog {
|
|
13
|
+
constructor(opts) {
|
|
14
|
+
super({ log: opts.log });
|
|
15
|
+
this.sim = opts.sim;
|
|
16
|
+
this.showLogs = !!opts.showLogs;
|
|
17
|
+
this.predicate = opts.iosSimulatorLogsPredicate;
|
|
20
18
|
this.proc = null;
|
|
21
19
|
}
|
|
22
20
|
async startCapture() {
|
|
@@ -30,7 +28,7 @@ class IOSSimulatorLog extends ios_log_1.IOSLog {
|
|
|
30
28
|
if (this.predicate) {
|
|
31
29
|
spawnArgs.push('--predicate', this.predicate);
|
|
32
30
|
}
|
|
33
|
-
log.debug(`Starting log capture for iOS Simulator with udid '${this.sim.udid}' ` + `using simctl`);
|
|
31
|
+
this.log.debug(`Starting log capture for iOS Simulator with udid '${this.sim.udid}' ` + `using simctl`);
|
|
34
32
|
try {
|
|
35
33
|
// cleanup existing listeners if the previous session has not been terminated properly
|
|
36
34
|
await (0, teen_process_1.exec)('pkill', ['-f', [this.sim.udid, ...spawnArgs].join(' ')]);
|
|
@@ -44,40 +42,6 @@ class IOSSimulatorLog extends ios_log_1.IOSLog {
|
|
|
44
42
|
throw new Error(`Simulator log capture failed. Original error: ${e.message}`);
|
|
45
43
|
}
|
|
46
44
|
}
|
|
47
|
-
async finishStartingLogCapture() {
|
|
48
|
-
if (!this.proc) {
|
|
49
|
-
log.errorAndThrow('Could not capture simulator log');
|
|
50
|
-
}
|
|
51
|
-
let firstLine = true;
|
|
52
|
-
let logRow = '';
|
|
53
|
-
this.proc.on('output', (stdout, stderr) => {
|
|
54
|
-
if (stdout) {
|
|
55
|
-
if (firstLine) {
|
|
56
|
-
if (stdout.endsWith('\n')) {
|
|
57
|
-
// don't store the first line of the log because it came before the sim was launched
|
|
58
|
-
firstLine = false;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
logRow += stdout;
|
|
63
|
-
if (stdout.endsWith('\n')) {
|
|
64
|
-
this.onOutput(logRow);
|
|
65
|
-
logRow = '';
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
if (stderr) {
|
|
70
|
-
this.onOutput(logRow, 'STDERR');
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
let sd = (stdout, stderr) => {
|
|
74
|
-
if (/execvp\(\)/.test(stderr)) {
|
|
75
|
-
throw new Error('iOS log capture process failed to start');
|
|
76
|
-
}
|
|
77
|
-
return stdout || stderr;
|
|
78
|
-
};
|
|
79
|
-
await this.proc.start(sd, START_TIMEOUT);
|
|
80
|
-
}
|
|
81
45
|
async stopCapture() {
|
|
82
46
|
if (!this.proc) {
|
|
83
47
|
return;
|
|
@@ -85,11 +49,21 @@ class IOSSimulatorLog extends ios_log_1.IOSLog {
|
|
|
85
49
|
await this.killLogSubProcess();
|
|
86
50
|
this.proc = null;
|
|
87
51
|
}
|
|
52
|
+
get isCapturing() {
|
|
53
|
+
return Boolean(this.proc && this.proc.isRunning);
|
|
54
|
+
}
|
|
55
|
+
onOutput(logRow, prefix = '') {
|
|
56
|
+
this.broadcast(logRow);
|
|
57
|
+
if (this.showLogs) {
|
|
58
|
+
const space = prefix.length > 0 ? ' ' : '';
|
|
59
|
+
this.log.info(`[IOS_SYSLOG_ROW${space}${prefix}] ${logRow}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
88
62
|
async killLogSubProcess() {
|
|
89
|
-
if (!this.proc
|
|
63
|
+
if (!this.proc?.isRunning) {
|
|
90
64
|
return;
|
|
91
65
|
}
|
|
92
|
-
log.debug('Stopping iOS log capture');
|
|
66
|
+
this.log.debug('Stopping iOS log capture');
|
|
93
67
|
try {
|
|
94
68
|
await this.proc.stop('SIGTERM', 1000);
|
|
95
69
|
}
|
|
@@ -97,24 +71,28 @@ class IOSSimulatorLog extends ios_log_1.IOSLog {
|
|
|
97
71
|
if (!this.proc.isRunning) {
|
|
98
72
|
return;
|
|
99
73
|
}
|
|
100
|
-
log.warn('Cannot stop log capture process. Sending SIGKILL');
|
|
74
|
+
this.log.warn('Cannot stop log capture process. Sending SIGKILL');
|
|
101
75
|
await this.proc.stop('SIGKILL');
|
|
102
76
|
}
|
|
103
77
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
const space = prefix.length > 0 ? ' ' : '';
|
|
115
|
-
log.info(`[IOS_SYSLOG_ROW${space}${prefix}] ${logLine}`);
|
|
116
|
-
}
|
|
78
|
+
async finishStartingLogCapture() {
|
|
79
|
+
if (!this.proc) {
|
|
80
|
+
throw this.log.errorWithException('Could not capture simulator log');
|
|
81
|
+
}
|
|
82
|
+
for (const streamName of ['stdout', 'stderr']) {
|
|
83
|
+
this.proc.on(`lines-${streamName}`, (/** @type {string[]} */ lines) => {
|
|
84
|
+
for (const line of lines) {
|
|
85
|
+
this.onOutput(line, ...(streamName === 'stderr' ? ['STDERR'] : []));
|
|
86
|
+
}
|
|
87
|
+
});
|
|
117
88
|
}
|
|
89
|
+
const startDetector = (/** @type {string} */ stdout, /** @type {string} */ stderr) => {
|
|
90
|
+
if (EXECVP_ERROR_PATTERN.test(stderr)) {
|
|
91
|
+
throw new Error('iOS log capture process failed to start');
|
|
92
|
+
}
|
|
93
|
+
return stdout || stderr;
|
|
94
|
+
};
|
|
95
|
+
await this.proc.start(startDetector, START_TIMEOUT);
|
|
118
96
|
}
|
|
119
97
|
}
|
|
120
98
|
exports.IOSSimulatorLog = IOSSimulatorLog;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ios-simulator-log.js","sourceRoot":"","sources":["../../../lib/device-log/ios-simulator-log.
|
|
1
|
+
{"version":3,"file":"ios-simulator-log.js","sourceRoot":"","sources":["../../../lib/device-log/ios-simulator-log.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,+CAA8C;AAC9C,6DAAwD;AAIxD,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAE1C,MAAM,aAAa,GAAG,KAAK,CAAC;AAS5B,MAAa,eAAgB,SAAQ,qCAAgB;IAMnD,YAAY,IAA4B;QACtC,KAAK,CAAC,EAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAC,CAAC,CAAC;QACvB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;QAChC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,yBAAyB,CAAC;QAChD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAEQ,KAAK,CAAC,YAAY;QACzB,IAAI,gBAAC,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACrD,CAAC;QAED,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC,4BAA4B,IAAI,CAAC,GAAG,CAAC,IAAI,kBAAkB,CAAC,CAAC;QAC/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AM,IAAI,IAAI,KAAK,EAAE,CAAC;oBACzB,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBACtE,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QAED,MAAM,aAAa,GAAG,CAAC,qBAAqB,CAAC,MAAM,EAAE,qBAAqB,CAAC,MAAM,EAAE,EAAE;YACnF,IAAI,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;gBACtC,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;YAC7D,CAAC;YACD,OAAO,MAAM,IAAI,MAAM,CAAC;QAC1B,CAAC,CAAC;QACF,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;IACtD,CAAC;CACF;AAnGD,0CAmGC;AAED,kBAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IOSLog } from './ios-log';
|
|
2
|
+
import type { LogEntry } from '../commands/types';
|
|
3
|
+
type TSerializedEntry = [string, number];
|
|
4
|
+
export declare abstract class LineConsumingLog extends IOSLog<string, TSerializedEntry> {
|
|
5
|
+
protected _serializeEntry(value: string): TSerializedEntry;
|
|
6
|
+
protected _deserializeEntry(value: TSerializedEntry): LogEntry;
|
|
7
|
+
}
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=line-consuming-log.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-consuming-log.d.ts","sourceRoot":"","sources":["../../../lib/device-log/line-consuming-log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AAEjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,KAAK,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEzC,8BAAsB,gBAAiB,SAAQ,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC;cAC1D,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB;cAIhD,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,QAAQ;CAIxE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LineConsumingLog = void 0;
|
|
4
|
+
const ios_log_1 = require("./ios-log");
|
|
5
|
+
const helpers_1 = require("./helpers");
|
|
6
|
+
class LineConsumingLog extends ios_log_1.IOSLog {
|
|
7
|
+
_serializeEntry(value) {
|
|
8
|
+
return [value, Date.now()];
|
|
9
|
+
}
|
|
10
|
+
_deserializeEntry(value) {
|
|
11
|
+
const [message, timestamp] = value;
|
|
12
|
+
return (0, helpers_1.toLogEntry)(message, timestamp);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.LineConsumingLog = LineConsumingLog;
|
|
16
|
+
//# sourceMappingURL=line-consuming-log.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-consuming-log.js","sourceRoot":"","sources":["../../../lib/device-log/line-consuming-log.ts"],"names":[],"mappings":";;;AAAA,uCAAiC;AACjC,uCAAuC;AAKvC,MAAsB,gBAAiB,SAAQ,gBAAgC;IAC1D,eAAe,CAAC,KAAa;QAC9C,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC7B,CAAC;IAEkB,iBAAiB,CAAC,KAAuB;QAC1D,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC;QACnC,OAAO,IAAA,oBAAU,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACxC,CAAC;CACF;AATD,4CASC"}
|
package/lib/commands/context.js
CHANGED
|
@@ -558,7 +558,10 @@ const commands = {
|
|
|
558
558
|
// attempt to start performance logging, if requested
|
|
559
559
|
if (this.opts.enablePerformanceLogging && this.remote) {
|
|
560
560
|
this.log.debug(`Starting performance log on '${this.curContext}'`);
|
|
561
|
-
this.logs.performance = new IOSPerformanceLog(
|
|
561
|
+
this.logs.performance = new IOSPerformanceLog({
|
|
562
|
+
remoteDebugger: this.remote,
|
|
563
|
+
log: this.log,
|
|
564
|
+
});
|
|
562
565
|
await this.logs.performance.startCapture();
|
|
563
566
|
}
|
|
564
567
|
|
package/lib/commands/log.js
CHANGED
|
@@ -8,6 +8,7 @@ import log from '../logger';
|
|
|
8
8
|
import WebSocket from 'ws';
|
|
9
9
|
import SafariConsoleLog from '../device-log/safari-console-log';
|
|
10
10
|
import SafariNetworkLog from '../device-log/safari-network-log';
|
|
11
|
+
import { toLogEntry } from '../device-log/helpers';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Determines the websocket endpoint based on the `sessionId`
|
|
@@ -47,27 +48,18 @@ const SUPPORTED_LOG_TYPES = {
|
|
|
47
48
|
server: {
|
|
48
49
|
description: 'Appium server logs',
|
|
49
50
|
/**
|
|
50
|
-
* @returns {
|
|
51
|
+
* @returns {import('./types').LogEntry[]}
|
|
51
52
|
*/
|
|
52
53
|
getter: (self) => {
|
|
53
54
|
self.assertFeatureEnabled(GET_SERVER_LOGS_FEATURE);
|
|
54
|
-
return log.unwrap().record.map((x) => (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}));
|
|
55
|
+
return log.unwrap().record.map((x) => toLogEntry(
|
|
56
|
+
_.isEmpty(x.prefix) ? x.message : `[${x.prefix}] ${x.message}`,
|
|
57
|
+
/** @type {any} */ (x).timestamp ?? Date.now()
|
|
58
|
+
));
|
|
59
59
|
},
|
|
60
60
|
},
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
/**
|
|
64
|
-
* Log entry in the array returned by `getLogs('server')`
|
|
65
|
-
* @typedef AppiumServerLogEntry
|
|
66
|
-
* @property {number} timestamp
|
|
67
|
-
* @property {'ALL'} level
|
|
68
|
-
* @property {string} message
|
|
69
|
-
*/
|
|
70
|
-
|
|
71
63
|
export default {
|
|
72
64
|
supportedLogTypes: SUPPORTED_LOG_TYPES,
|
|
73
65
|
/**
|
|
@@ -111,13 +103,14 @@ export default {
|
|
|
111
103
|
this.logs.syslog = new IOSDeviceLog({
|
|
112
104
|
udid: this.opts.udid,
|
|
113
105
|
showLogs: this.opts.showIOSLog,
|
|
106
|
+
log: this.log,
|
|
114
107
|
});
|
|
115
108
|
} else {
|
|
116
109
|
this.logs.syslog = new IOSSimulatorLog({
|
|
117
|
-
sim: this.device,
|
|
110
|
+
sim: /** @type {import('appium-ios-simulator').Simulator} */ (this.device),
|
|
118
111
|
showLogs: this.opts.showIOSLog,
|
|
119
|
-
xcodeVersion: this.xcodeVersion,
|
|
120
112
|
iosSimulatorLogsPredicate: this.opts.iosSimulatorLogsPredicate,
|
|
113
|
+
log: this.log,
|
|
121
114
|
});
|
|
122
115
|
}
|
|
123
116
|
this.logs.safariConsole = new SafariConsoleLog(!!this.opts.showSafariConsoleLog);
|
package/lib/commands/types.ts
CHANGED