@quiesco/core 0.8.1 → 0.10.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/dist/config.d.ts +8 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -0
- package/dist/config.js.map +1 -1
- package/dist/device.d.ts.map +1 -1
- package/dist/device.js +9 -1
- package/dist/device.js.map +1 -1
- package/dist/devices/android.d.ts +4 -0
- package/dist/devices/android.d.ts.map +1 -1
- package/dist/devices/android.js +10 -0
- package/dist/devices/android.js.map +1 -1
- package/dist/devices/crash.d.ts +24 -0
- package/dist/devices/crash.d.ts.map +1 -0
- package/dist/devices/crash.js +132 -0
- package/dist/devices/crash.js.map +1 -0
- package/dist/devices/ios-runner.d.ts +14 -1
- package/dist/devices/ios-runner.d.ts.map +1 -1
- package/dist/devices/ios-runner.js +49 -8
- package/dist/devices/ios-runner.js.map +1 -1
- package/dist/devices/ios.d.ts +26 -2
- package/dist/devices/ios.d.ts.map +1 -1
- package/dist/devices/ios.js +108 -19
- package/dist/devices/ios.js.map +1 -1
- package/dist/devices/provider.d.ts +13 -0
- package/dist/devices/provider.d.ts.map +1 -1
- package/dist/devices/provider.js.map +1 -1
- package/dist/driver.d.ts +2 -0
- package/dist/driver.d.ts.map +1 -1
- package/dist/driver.js +10 -5
- package/dist/driver.js.map +1 -1
- package/dist/errors.d.ts +3 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/server/ws-server.d.ts +10 -2
- package/dist/server/ws-server.d.ts.map +1 -1
- package/dist/server/ws-server.js +44 -3
- package/dist/server/ws-server.js.map +1 -1
- package/dist/session.d.ts +29 -1
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +115 -5
- package/dist/session.js.map +1 -1
- package/dist/timeline.d.ts +10 -1
- package/dist/timeline.d.ts.map +1 -1
- package/dist/timeline.js +25 -11
- package/dist/timeline.js.map +1 -1
- package/ios-runner/Runner/SystemUIServer.swift +29 -13
- package/package.json +2 -2
- package/src/config.ts +10 -1
- package/src/device.ts +9 -1
- package/src/devices/android.ts +13 -0
- package/src/devices/crash.ts +146 -0
- package/src/devices/ios-runner.ts +49 -8
- package/src/devices/ios.ts +114 -18
- package/src/devices/provider.ts +13 -0
- package/src/driver.ts +11 -5
- package/src/errors.ts +3 -1
- package/src/index.ts +1 -0
- package/src/server/ws-server.ts +41 -3
- package/src/session.ts +119 -9
- package/src/timeline.ts +33 -6
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
// POST /edgeSwipeBack → drag from the left edge of the screen (the interactive pop gesture)
|
|
10
10
|
// GET /elements?bundleId=… → the UIKit elements of an app (the app under test, Safari, SafariViewService), from
|
|
11
11
|
// one snapshot: { state, elements: [{ type, label, id, value, frame, enabled, selected }] }
|
|
12
|
+
// GET /appState?bundleId=… → { state } (XCUIApplication.State) without reading the app's UI
|
|
12
13
|
// POST /typeText?bundleId=…&text=… → type into the focused field of that app with its keyboard (409 without one)
|
|
13
14
|
// POST /quit → end the test
|
|
14
15
|
import Network
|
|
@@ -104,6 +105,9 @@ final class SystemUIServer: XCTestCase {
|
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
107
|
return ("200 OK", ["state": app.state.rawValue, "elements": out])
|
|
108
|
+
case "/appState":
|
|
109
|
+
guard let id = q["bundleId"], !id.isEmpty else { return ("400 Bad Request", ["error": "bundleId"]) }
|
|
110
|
+
return ("200 OK", ["state": XCUIApplication(bundleIdentifier: id).state.rawValue])
|
|
107
111
|
case "/typeText":
|
|
108
112
|
guard let id = q["bundleId"], !id.isEmpty, let text = q["text"] else { return ("400 Bad Request", ["error": "bundleId and text"]) }
|
|
109
113
|
let app = XCUIApplication(bundleIdentifier: id)
|
|
@@ -124,23 +128,35 @@ final class SystemUIServer: XCTestCase {
|
|
|
124
128
|
return [f.minX, f.minY, f.width, f.height].map { Double($0) }
|
|
125
129
|
}
|
|
126
130
|
|
|
131
|
+
/**
|
|
132
|
+
* SpringBoard's alerts and its other labelled buttons (banners, Notification Center cells), from one
|
|
133
|
+
* snapshot (issue #65): reading the elements one by one by index fails, and ends this test, when the list
|
|
134
|
+
* changes in between (a notification stack expanding). The snapshot has no `isHittable`: a button counts
|
|
135
|
+
* when its frame is on screen.
|
|
136
|
+
*/
|
|
127
137
|
private func screen() -> [String: Any] {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
return ["label": b.label, "id": b.identifier, "frame": frame(b)]
|
|
135
|
-
}
|
|
136
|
-
alerts.append(["label": a.label, "id": a.identifier, "frame": frame(a), "texts": texts, "buttons": buttons])
|
|
138
|
+
guard let root = try? springboard.snapshot() else { return ["alerts": [], "others": []] }
|
|
139
|
+
let screenFrame = root.frame
|
|
140
|
+
func rect(_ f: CGRect) -> [Double] { [f.minX, f.minY, f.width, f.height].map { Double($0) } }
|
|
141
|
+
func onScreen(_ f: CGRect) -> Bool { f.width > 0 && f.height > 0 && (screenFrame.isEmpty || screenFrame.intersects(f)) }
|
|
142
|
+
func descendants(_ e: XCUIElementSnapshot, _ type: XCUIElement.ElementType) -> [XCUIElementSnapshot] {
|
|
143
|
+
e.children.flatMap { c in (c.elementType == type ? [c] : []) + descendants(c, type) }
|
|
137
144
|
}
|
|
138
|
-
|
|
145
|
+
var alerts: [[String: Any]] = []
|
|
139
146
|
var others: [[String: Any]] = []
|
|
140
|
-
|
|
141
|
-
if
|
|
142
|
-
|
|
147
|
+
func walk(_ e: XCUIElementSnapshot) {
|
|
148
|
+
if e.elementType == .alert {
|
|
149
|
+
let texts = descendants(e, .staticText).map { ["label": $0.label, "frame": rect($0.frame)] as [String: Any] }
|
|
150
|
+
let buttons = descendants(e, .button).map { ["label": $0.label, "id": $0.identifier, "frame": rect($0.frame)] as [String: Any] }
|
|
151
|
+
alerts.append(["label": e.label, "id": e.identifier, "frame": rect(e.frame), "texts": texts, "buttons": buttons])
|
|
152
|
+
return
|
|
153
|
+
}
|
|
154
|
+
if e.elementType == .button && !e.label.isEmpty && onScreen(e.frame) {
|
|
155
|
+
others.append(["label": e.label, "id": e.identifier, "frame": rect(e.frame)])
|
|
156
|
+
}
|
|
157
|
+
for c in e.children { walk(c) }
|
|
143
158
|
}
|
|
159
|
+
walk(root)
|
|
144
160
|
return ["alerts": alerts, "others": others]
|
|
145
161
|
}
|
|
146
162
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quiesco/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Quiesco host side: WebSocket server, Driver, device providers (test-runner agnostic)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "h2nology",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"ios-runner/QuiescoSystemUI.xcodeproj"
|
|
51
51
|
],
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@quiesco/protocol": "0.
|
|
53
|
+
"@quiesco/protocol": "0.10.0",
|
|
54
54
|
"ws": "8.22.1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
package/src/config.ts
CHANGED
|
@@ -147,8 +147,15 @@ export interface QuiescoConfig {
|
|
|
147
147
|
countIntervals?: boolean;
|
|
148
148
|
stableFrames?: number;
|
|
149
149
|
ignoreUrls?: (RegExp | string)[];
|
|
150
|
-
/**
|
|
150
|
+
/**
|
|
151
|
+
* Disable individual trackers, e.g. `{ 'frame-stable': false }`, or enable `native-module` (off by
|
|
152
|
+
* default): `{ 'native-module': true }`.
|
|
153
|
+
*/
|
|
151
154
|
trackers?: Partial<Record<TrackerName, boolean>>;
|
|
155
|
+
/** `native-module` tracker: how long a pending native module call counts as busy (default 2000 ms). */
|
|
156
|
+
nativeCallThresholdMs?: number;
|
|
157
|
+
/** `native-module` tracker: calls that never count, as "Module.method" (strings match as substrings). */
|
|
158
|
+
ignoreNativeCalls?: (RegExp | string)[];
|
|
152
159
|
/**
|
|
153
160
|
* Elements whose changes never keep the app busy for the frame-stable check (they and their
|
|
154
161
|
* subtrees are left out), e.g. `['logo-glow']` for a decorative animation that runs for minutes.
|
|
@@ -285,6 +292,8 @@ export function toAgentConfig(config: QuiescoConfig, gestureSlop?: GestureSlop,
|
|
|
285
292
|
stableFrames: s.stableFrames ?? SyncDefaults.stableFrames,
|
|
286
293
|
ignoreUrls: (s.ignoreUrls ?? []).map(toTextMatch),
|
|
287
294
|
trackers: { ...s.trackers },
|
|
295
|
+
nativeCallThresholdMs: s.nativeCallThresholdMs ?? SyncDefaults.nativeCallThresholdMs,
|
|
296
|
+
ignoreNativeCalls: (s.ignoreNativeCalls ?? []).map(toTextMatch),
|
|
288
297
|
ignoreElements: (s.ignoreElements ?? []).map(toMatcher),
|
|
289
298
|
},
|
|
290
299
|
logLevel: config.logLevel ?? 'warn',
|
package/src/device.ts
CHANGED
|
@@ -125,6 +125,7 @@ export class DeviceApi {
|
|
|
125
125
|
expectNotVisible: async (query: SystemQuery, opts: SystemWaitOptions = {}): Promise<void> => {
|
|
126
126
|
checkSystemQuery('system.expectNotVisible', query);
|
|
127
127
|
const p = this.systemProvider('system.expectNotVisible');
|
|
128
|
+
await this.host.provider.prepareSystemUi?.();
|
|
128
129
|
const deadline = Date.now() + (opts.timeoutMs ?? SYSTEM_WAIT_MS);
|
|
129
130
|
for (;;) {
|
|
130
131
|
const match = (await p.systemNodes()).find((n) => matchesSystemQuery(n, query));
|
|
@@ -473,7 +474,12 @@ export class DeviceApi {
|
|
|
473
474
|
if (this.host.appState === 'terminated') throw notRunning('openNotification');
|
|
474
475
|
await p.openNotification(title, timeoutMs);
|
|
475
476
|
this.host.appState = 'running';
|
|
476
|
-
await this.waitForAppState((s) => s === 'active', true)
|
|
477
|
+
await this.waitForAppState((s) => s === 'active', true).catch((e: unknown) => {
|
|
478
|
+
// Still in the background: the next scenario's reset brings it back instead of waiting on a
|
|
479
|
+
// suspended app (issue #68).
|
|
480
|
+
this.host.appState = 'background';
|
|
481
|
+
throw e;
|
|
482
|
+
});
|
|
477
483
|
await this.host.reapplyConfig();
|
|
478
484
|
await this.host.waitForIdle();
|
|
479
485
|
}
|
|
@@ -639,6 +645,8 @@ export class DeviceApi {
|
|
|
639
645
|
private async findSystemNode(action: string, what: string, pick: (nodes: SystemNode[]) => SystemNode | undefined, opts: SystemWaitOptions): Promise<SystemNode> {
|
|
640
646
|
const p = this.systemProvider(action);
|
|
641
647
|
const timeoutMs = opts.timeoutMs ?? SYSTEM_WAIT_MS;
|
|
648
|
+
// Not counted: starting the system UI runner (issue #64).
|
|
649
|
+
await this.host.provider.prepareSystemUi?.();
|
|
642
650
|
const deadline = Date.now() + timeoutMs;
|
|
643
651
|
for (;;) {
|
|
644
652
|
const nodes = await p.systemNodes();
|
package/src/devices/android.ts
CHANGED
|
@@ -42,6 +42,8 @@ export const DEV_MENU_PREFS =
|
|
|
42
42
|
' <boolean name="motionGestureEnabled" value="false" />\n' +
|
|
43
43
|
'</map>\n';
|
|
44
44
|
|
|
45
|
+
import { androidCrash } from './crash.js';
|
|
46
|
+
import type { CrashReport } from './crash.js';
|
|
45
47
|
import fs from 'node:fs/promises';
|
|
46
48
|
import os from 'node:os';
|
|
47
49
|
import path from 'node:path';
|
|
@@ -229,6 +231,17 @@ export class AndroidProvider implements DeviceProvider {
|
|
|
229
231
|
return this.adbRun(['shell', command]);
|
|
230
232
|
}
|
|
231
233
|
|
|
234
|
+
async isAppRunning(): Promise<boolean> {
|
|
235
|
+
return (await this.shell(`pidof ${shq(this.pkg)}`).catch(() => '')).trim() !== '';
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/** The crash in logcat's crash buffer (times as epoch seconds, so the host's clock can pick the recent one). */
|
|
239
|
+
async crashReport(sinceMs: number): Promise<CrashReport | null> {
|
|
240
|
+
const log = await this.adbRun(['logcat', '-d', '-b', 'crash', '-v', 'threadtime', '-v', 'epoch']).catch(() => '');
|
|
241
|
+
const summary = androidCrash(log, this.pkg, sinceMs);
|
|
242
|
+
return summary === null ? null : { summary };
|
|
243
|
+
}
|
|
244
|
+
|
|
232
245
|
/** Online devices from `adb devices`. */
|
|
233
246
|
private async devices(): Promise<string[]> {
|
|
234
247
|
const { stdout } = await this.exec(this.adb, ['devices']);
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a crashed app left behind (issue #76): the crash in Android's logcat crash buffer, or an iOS
|
|
3
|
+
* crash report (`.ips` in ~/Library/Logs/DiagnosticReports), cut down to the lines that say why.
|
|
4
|
+
*/
|
|
5
|
+
import fs from 'node:fs/promises';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
|
|
8
|
+
/** A crash of the app under test. */
|
|
9
|
+
export interface CrashReport {
|
|
10
|
+
/** A few lines: the exception and the top of the crashing thread's stack. */
|
|
11
|
+
summary: string;
|
|
12
|
+
/** The full report on this machine (iOS), to copy into the evidence. */
|
|
13
|
+
file?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Stack frames in a summary. */
|
|
17
|
+
const FRAMES = 8;
|
|
18
|
+
/** Longer symbols (C++ templates) are cut. */
|
|
19
|
+
const SYMBOL_CHARS = 140;
|
|
20
|
+
|
|
21
|
+
const LOGCAT_LINE = /^\s*(\d+(?:\.\d+)?)\s+(\d+)\s+(\d+)\s+[VDIWEF]\s+([^:]*?)\s*:\s?(.*)$/;
|
|
22
|
+
|
|
23
|
+
interface LogcatLine {
|
|
24
|
+
t: number;
|
|
25
|
+
pid: string;
|
|
26
|
+
tag: string;
|
|
27
|
+
message: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function parseLogcat(text: string): LogcatLine[] {
|
|
31
|
+
const out: LogcatLine[] = [];
|
|
32
|
+
for (const line of text.split('\n')) {
|
|
33
|
+
const m = LOGCAT_LINE.exec(line);
|
|
34
|
+
if (m !== null) out.push({ t: Number(m[1]), pid: m[2] as string, tag: m[4] as string, message: (m[5] as string).replace(/\r$/, '') });
|
|
35
|
+
}
|
|
36
|
+
return out;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The app's last crash in `adb logcat -b crash -v threadtime -v epoch` output at or after `sinceMs`
|
|
41
|
+
* (ms since the epoch): a Java / Kotlin `FATAL EXCEPTION` (the exception and its first frames, with
|
|
42
|
+
* the `Caused by` lines), or a native `Fatal signal` with the abort message and the first backtrace
|
|
43
|
+
* frames. Null when the app did not crash there.
|
|
44
|
+
*/
|
|
45
|
+
export function androidCrash(logcat: string, pkg: string, sinceMs: number): string | null {
|
|
46
|
+
const lines = parseLogcat(logcat).filter((l) => l.t * 1000 >= sinceMs - 1000);
|
|
47
|
+
// Java: "FATAL EXCEPTION: main", then "Process: <pkg>, PID: <pid>".
|
|
48
|
+
let java: string[] | null = null;
|
|
49
|
+
for (let i = 0; i < lines.length; i++) {
|
|
50
|
+
const l = lines[i] as LogcatLine;
|
|
51
|
+
if (l.tag !== 'AndroidRuntime' || !l.message.startsWith('FATAL EXCEPTION')) continue;
|
|
52
|
+
const next = lines[i + 1];
|
|
53
|
+
if (next === undefined || !next.message.startsWith(`Process: ${pkg},`)) continue;
|
|
54
|
+
const block = lines.slice(i).filter((b) => b.pid === l.pid && b.tag === 'AndroidRuntime').map((b) => b.message);
|
|
55
|
+
// The exception, its first frames, and each "Caused by" with its first frame.
|
|
56
|
+
const kept: string[] = [];
|
|
57
|
+
let frames = 0;
|
|
58
|
+
for (const m of block) {
|
|
59
|
+
const frame = /^\s*at /.test(m);
|
|
60
|
+
if (!frame) frames = 0;
|
|
61
|
+
else if (++frames > (kept.some((k) => k.startsWith('Caused by')) ? 2 : FRAMES)) continue;
|
|
62
|
+
kept.push(m.replace(/^\t/, ' '));
|
|
63
|
+
}
|
|
64
|
+
java = kept;
|
|
65
|
+
}
|
|
66
|
+
if (java !== null) return java.join('\n');
|
|
67
|
+
// Native: libc "Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 1 (main), pid 1 (<pkg>)", then the
|
|
68
|
+
// tombstone (tag DEBUG): "Abort message: …", "#00 pc …".
|
|
69
|
+
const signal = [...lines].reverse().find((l) => l.message.startsWith('Fatal signal') && l.message.includes(`(${pkg})`));
|
|
70
|
+
if (signal === undefined) return null;
|
|
71
|
+
const after = lines.slice(lines.indexOf(signal) + 1);
|
|
72
|
+
const abort = after.find((l) => l.message.startsWith('Abort message:'));
|
|
73
|
+
const frames = after.filter((l) => /^\s*#\d+ pc /.test(l.message)).slice(0, FRAMES);
|
|
74
|
+
return [signal.message, ...(abort !== undefined ? [abort.message] : []), ...frames.map((f) => ` ${f.message.trim()}`)].join('\n');
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
interface IpsBody {
|
|
78
|
+
exception?: { type?: string; signal?: string; subtype?: string };
|
|
79
|
+
termination?: { indicator?: string };
|
|
80
|
+
asi?: Record<string, unknown>;
|
|
81
|
+
faultingThread?: number;
|
|
82
|
+
threads?: { frames?: { imageIndex?: number; symbol?: string; imageOffset?: number }[] }[];
|
|
83
|
+
usedImages?: { name?: string }[];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** The header (first line) of an `.ips` report, or null when it is not one. */
|
|
87
|
+
export function ipsHeader(text: string): { bundleID?: string; app_name?: string } | null {
|
|
88
|
+
const end = text.indexOf('\n');
|
|
89
|
+
try {
|
|
90
|
+
return JSON.parse(end < 0 ? text : text.slice(0, end)) as { bundleID?: string; app_name?: string };
|
|
91
|
+
} catch {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** An iOS crash report (`.ips`, JSON) as a few lines: exception, termination reason, crashing thread's top frames. */
|
|
97
|
+
export function summarizeIps(text: string): string | null {
|
|
98
|
+
const end = text.indexOf('\n');
|
|
99
|
+
if (end < 0) return null;
|
|
100
|
+
let body: IpsBody;
|
|
101
|
+
try {
|
|
102
|
+
body = JSON.parse(text.slice(end + 1)) as IpsBody;
|
|
103
|
+
} catch {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
const lines: string[] = [];
|
|
107
|
+
const e = body.exception;
|
|
108
|
+
if (e?.type !== undefined) lines.push(`${e.type}${e.signal !== undefined ? ` (${e.signal})` : ''}${e.subtype !== undefined ? `: ${e.subtype}` : ''}${body.termination?.indicator !== undefined ? `, ${body.termination.indicator}` : ''}`);
|
|
109
|
+
for (const v of Object.values(body.asi ?? {})) {
|
|
110
|
+
for (const s of Array.isArray(v) ? v : [v]) if (typeof s === 'string' && s.trim() !== '') lines.push(s.trim());
|
|
111
|
+
}
|
|
112
|
+
const n = body.faultingThread;
|
|
113
|
+
const frames = n === undefined ? undefined : body.threads?.[n]?.frames;
|
|
114
|
+
if (frames !== undefined && frames.length > 0) {
|
|
115
|
+
lines.push(`Thread ${n} crashed:`);
|
|
116
|
+
frames.slice(0, FRAMES).forEach((f, i) => {
|
|
117
|
+
const image = (f.imageIndex !== undefined ? body.usedImages?.[f.imageIndex]?.name : undefined) ?? '???';
|
|
118
|
+
const symbol = f.symbol ?? (f.imageOffset !== undefined ? `+${f.imageOffset}` : '');
|
|
119
|
+
lines.push(` ${i} ${image} ${symbol.length > SYMBOL_CHARS ? `${symbol.slice(0, SYMBOL_CHARS)}…` : symbol}`);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
return lines.length > 0 ? lines.join('\n') : null;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** The newest `.ips` report in `dir` for `bundleId` written at or after `sinceMs`. */
|
|
126
|
+
export async function newestIosCrash(dir: string, bundleId: string, sinceMs: number): Promise<CrashReport | null> {
|
|
127
|
+
let names: string[];
|
|
128
|
+
try {
|
|
129
|
+
names = (await fs.readdir(dir)).filter((n) => n.endsWith('.ips'));
|
|
130
|
+
} catch {
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
const candidates: { file: string; mtime: number }[] = [];
|
|
134
|
+
for (const n of names) {
|
|
135
|
+
const file = path.join(dir, n);
|
|
136
|
+
const stat = await fs.stat(file).catch(() => null);
|
|
137
|
+
if (stat !== null && stat.mtimeMs >= sinceMs - 1000) candidates.push({ file, mtime: stat.mtimeMs });
|
|
138
|
+
}
|
|
139
|
+
candidates.sort((a, b) => b.mtime - a.mtime);
|
|
140
|
+
for (const c of candidates) {
|
|
141
|
+
const text = await fs.readFile(c.file, 'utf8').catch(() => '');
|
|
142
|
+
if (ipsHeader(text)?.bundleID !== bundleId) continue;
|
|
143
|
+
return { summary: summarizeIps(text) ?? 'The crash report could not be read.', file: c.file };
|
|
144
|
+
}
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
@@ -153,7 +153,7 @@ export class IosSystemRunner {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
async screen(): Promise<RunnerScreen> {
|
|
156
|
-
return this.call(() => this.request<RunnerScreen>('GET', '/screen'));
|
|
156
|
+
return this.call(() => this.request<RunnerScreen>('GET', '/screen'), true);
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
async tap(x: number, y: number): Promise<void> {
|
|
@@ -162,7 +162,7 @@ export class IosSystemRunner {
|
|
|
162
162
|
|
|
163
163
|
/** The navigation bars of the app `bundleId` (issue #4). */
|
|
164
164
|
async navigationBar(bundleId: string): Promise<RunnerNavigationBar> {
|
|
165
|
-
return this.call(() => this.request<RunnerNavigationBar>('GET', `/navigationBar?bundleId=${encodeURIComponent(bundleId)}`));
|
|
165
|
+
return this.call(() => this.request<RunnerNavigationBar>('GET', `/navigationBar?bundleId=${encodeURIComponent(bundleId)}`), true);
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
/**
|
|
@@ -170,7 +170,15 @@ export class IosSystemRunner {
|
|
|
170
170
|
* the app's state (XCUIApplication.State: 1 not running … 4 in front).
|
|
171
171
|
*/
|
|
172
172
|
async elements(bundleId: string): Promise<RunnerElements> {
|
|
173
|
-
return this.call(() => this.request('GET', `/elements?bundleId=${encodeURIComponent(bundleId)}`));
|
|
173
|
+
return this.call(() => this.request('GET', `/elements?bundleId=${encodeURIComponent(bundleId)}`), true);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* The state of the app `bundleId` alone (XCUIApplication.State: 1 not running, 2 suspended, 3 in the
|
|
178
|
+
* background, 4 in front), without reading its UI: openNotification confirms its tap with it (issue #68).
|
|
179
|
+
*/
|
|
180
|
+
async appState(bundleId: string): Promise<number> {
|
|
181
|
+
return (await this.call(() => this.request<{ state: number }>('GET', `/appState?bundleId=${encodeURIComponent(bundleId)}`), true)).state;
|
|
174
182
|
}
|
|
175
183
|
|
|
176
184
|
/** Type into the focused field of `bundleId` through its keyboard (XCUITest typeText, issue #51). */
|
|
@@ -189,18 +197,30 @@ export class IosSystemRunner {
|
|
|
189
197
|
|
|
190
198
|
/**
|
|
191
199
|
* A request to the running runner. The runner's test can die while xcodebuild lives on (seen in parallel
|
|
192
|
-
* runs, Phase 6.12): nothing listens on its port any more.
|
|
200
|
+
* runs, Phase 6.12): nothing listens on its port any more. Or it dies while answering (an XCTest failure
|
|
201
|
+
* ends the test, issue #65): the connection is reset. Then the runner is restarted, and a request that
|
|
202
|
+
* only reads (`readOnly`), or one that never reached it (refused), is sent again once. A tap that may
|
|
203
|
+
* have happened is not repeated: it fails with what the runner printed.
|
|
193
204
|
*/
|
|
194
|
-
private async call<T>(request: () => Promise<T
|
|
205
|
+
private async call<T>(request: () => Promise<T>, readOnly = false): Promise<T> {
|
|
195
206
|
await this.start();
|
|
196
207
|
try {
|
|
197
208
|
return await request();
|
|
198
209
|
} catch (e) {
|
|
199
|
-
if (!
|
|
200
|
-
|
|
210
|
+
if (!isRunnerGone(e)) throw e;
|
|
211
|
+
const output = this.output.slice(-1500);
|
|
212
|
+
this.options.logger.warn(`the iOS system UI runner stopped answering (${describeNetworkError(e)}); restarting it. Its last output:\n${output}`);
|
|
201
213
|
await this.stop();
|
|
202
214
|
await this.start();
|
|
203
|
-
|
|
215
|
+
if (!readOnly && !isConnectionRefused(e)) {
|
|
216
|
+
throw new QuiescoError('DEVICE_ERROR', `the iOS system UI runner ended while answering (${describeNetworkError(e)}); it was restarted. Its last output:\n${output}`);
|
|
217
|
+
}
|
|
218
|
+
try {
|
|
219
|
+
return await request();
|
|
220
|
+
} catch (again) {
|
|
221
|
+
if (!isRunnerGone(again)) throw again;
|
|
222
|
+
throw new QuiescoError('DEVICE_ERROR', `the iOS system UI runner stopped answering twice (${describeNetworkError(again)}). Its last output:\n${this.output.slice(-1500)}`);
|
|
223
|
+
}
|
|
204
224
|
}
|
|
205
225
|
}
|
|
206
226
|
|
|
@@ -254,6 +274,27 @@ export class IosSystemRunner {
|
|
|
254
274
|
}
|
|
255
275
|
}
|
|
256
276
|
|
|
277
|
+
/** The error's network code: `TypeError: fetch failed` carries it in `cause` (undici). */
|
|
278
|
+
function networkCode(e: unknown): string {
|
|
279
|
+
const cause = (e as { cause?: { code?: string } } | null)?.cause;
|
|
280
|
+
return cause?.code ?? '';
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
function describeNetworkError(e: unknown): string {
|
|
284
|
+
return networkCode(e) || String((e as Error | null)?.message ?? e);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* The runner is not there any more: nobody listens (ECONNREFUSED) or it went away while answering
|
|
289
|
+
* (ECONNRESET, a closed socket; issue #65).
|
|
290
|
+
*/
|
|
291
|
+
export function isRunnerGone(e: unknown): boolean {
|
|
292
|
+
if (isConnectionRefused(e)) return true;
|
|
293
|
+
const code = networkCode(e);
|
|
294
|
+
if (code === 'ECONNRESET' || code === 'EPIPE' || code === 'UND_ERR_SOCKET' || code === 'UND_ERR_CLOSED') return true;
|
|
295
|
+
return /ECONNRESET|socket hang up|other side closed/.test(String((e as Error | null)?.message ?? ''));
|
|
296
|
+
}
|
|
297
|
+
|
|
257
298
|
/** fetch() to a port nobody listens on: `TypeError: fetch failed` caused by ECONNREFUSED. */
|
|
258
299
|
export function isConnectionRefused(e: unknown): boolean {
|
|
259
300
|
const cause = (e as { cause?: { code?: string } } | null)?.cause;
|
package/src/devices/ios.ts
CHANGED
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
* screen), or opening the Settings app for apps without @quiesco/native; foreground = `simctl launch`
|
|
20
20
|
* without terminating (the running process is activated, its arguments are ignored).
|
|
21
21
|
*/
|
|
22
|
+
import { newestIosCrash } from './crash.js';
|
|
23
|
+
import type { CrashReport } from './crash.js';
|
|
22
24
|
import fs from 'node:fs/promises';
|
|
23
25
|
import os from 'node:os';
|
|
24
26
|
import path from 'node:path';
|
|
@@ -35,6 +37,7 @@ import { execCommand } from './exec.js';
|
|
|
35
37
|
import { LogBuffer, exited, spawnProcess } from './streams.js';
|
|
36
38
|
import type { ChildLike, SpawnProcess } from './streams.js';
|
|
37
39
|
import { IosSystemRunner, PERMISSION_ALLOW, PERMISSION_DENY, backButton, dismissButton, screenNodes } from './ios-runner.js';
|
|
40
|
+
import type { RunnerScreen } from './ios-runner.js';
|
|
38
41
|
import type { Permission } from './permissions.js';
|
|
39
42
|
import { SERIAL_WORKER } from './provider.js';
|
|
40
43
|
import type { ColorScheme, DeviceProvider, InAppControls, LaunchParams, LaunchUrlHandling, NotificationSpec, StateChange, StatusBarOptions, SystemNode, WorkerInfo } from './provider.js';
|
|
@@ -135,10 +138,14 @@ export interface IosProviderOptions {
|
|
|
135
138
|
worker?: WorkerInfo;
|
|
136
139
|
/** How long match() / fail() wait for the app's authentication to start (tests). Default 10 s. */
|
|
137
140
|
biometricWaitMs?: number;
|
|
141
|
+
/** Where crash reports are written (tests). Default ~/Library/Logs/DiagnosticReports. */
|
|
142
|
+
crashReportDir?: string;
|
|
143
|
+
/** How long crashReport() waits for the report to appear (tests). Default 5 s. */
|
|
144
|
+
crashReportWaitMs?: number;
|
|
138
145
|
}
|
|
139
146
|
|
|
140
147
|
/** What IosProvider uses of IosSystemRunner. */
|
|
141
|
-
export type SystemRunnerLike = Pick<IosSystemRunner, 'running' | 'screen' | 'tap' | 'openNotificationCenter' | 'stop'> & Partial<Pick<IosSystemRunner, 'navigationBar' | 'edgeSwipeBack' | 'elements' | 'typeText'>>;
|
|
148
|
+
export type SystemRunnerLike = Pick<IosSystemRunner, 'running' | 'screen' | 'tap' | 'openNotificationCenter' | 'stop'> & Partial<Pick<IosSystemRunner, 'navigationBar' | 'edgeSwipeBack' | 'elements' | 'typeText' | 'appState' | 'start'>>;
|
|
142
149
|
|
|
143
150
|
/** `27.0` / `iOS 27.0` / `27` → does the runtime identifier match? */
|
|
144
151
|
export function runtimeMatches(runtime: string, version: string): boolean {
|
|
@@ -221,6 +228,16 @@ export function uikitNodes(elements: readonly { type: number; label: string; id:
|
|
|
221
228
|
});
|
|
222
229
|
}
|
|
223
230
|
|
|
231
|
+
/**
|
|
232
|
+
* Whether `frame` ([x, y, w, h]) looks like the "Open" button a locked device shows beside the tapped
|
|
233
|
+
* notification `b`: in its row, on its left, less than half its width.
|
|
234
|
+
*/
|
|
235
|
+
function revealedOpen(frame: number[], b: { x1: number; x2: number; y1: number; y2: number }): boolean {
|
|
236
|
+
const [x = 0, y = 0, w = 0, h = 0] = frame;
|
|
237
|
+
const mid = y + h / 2;
|
|
238
|
+
return mid >= b.y1 && mid <= b.y2 && x + w / 2 < (b.x1 + b.x2) / 2 && w < (b.x2 - b.x1) / 2;
|
|
239
|
+
}
|
|
240
|
+
|
|
224
241
|
/** Darwin notification state BiometricKit_Sim reads for "enrolled" (1 / 0). */
|
|
225
242
|
const BIOMETRIC_ENROLLMENT = 'com.apple.BiometricKit.enrollmentChanged';
|
|
226
243
|
|
|
@@ -229,8 +246,13 @@ const BANNER_WAIT_MS = 2_000;
|
|
|
229
246
|
const NOTIFICATION_POLL_MS = 250;
|
|
230
247
|
/** openUrlFromOutside: how long SpringBoard's "Open in …?" confirmation may take to show up. */
|
|
231
248
|
const OPEN_URL_CONFIRM_MS = 5_000;
|
|
232
|
-
/**
|
|
249
|
+
/**
|
|
250
|
+
* After tapping a notification: how long the app may take to come to the front (or, with a runner that
|
|
251
|
+
* cannot tell, the notification to go away) before Quiesco looks again, and how many taps it makes.
|
|
252
|
+
*/
|
|
233
253
|
const NOTIFICATION_TAP_CONFIRM_MS = 1_500;
|
|
254
|
+
/** The same for a runner that reads the app's state: an app resuming from suspension may take a moment. */
|
|
255
|
+
const NOTIFICATION_FRONT_MS = 3_000;
|
|
234
256
|
const NOTIFICATION_TAPS = 3;
|
|
235
257
|
|
|
236
258
|
export class IosProvider implements DeviceProvider {
|
|
@@ -707,6 +729,11 @@ export class IosProvider implements DeviceProvider {
|
|
|
707
729
|
* a web authentication session or Safari, and the app's own UIKit views (an inline date picker, the
|
|
708
730
|
* keyboard). The app's React views are in that tree too; tapping them is a real touch all the same.
|
|
709
731
|
*/
|
|
732
|
+
/** Start the system UI runner: system UI waits start their clock after it (a cold start takes 7–15 s, issue #64). */
|
|
733
|
+
async prepareSystemUi(): Promise<void> {
|
|
734
|
+
await this.runner.start?.();
|
|
735
|
+
}
|
|
736
|
+
|
|
710
737
|
async systemNodes(): Promise<SystemNode[]> {
|
|
711
738
|
const runner = this.runner;
|
|
712
739
|
const nodes = screenNodes(await runner.screen());
|
|
@@ -761,6 +788,7 @@ export class IosProvider implements DeviceProvider {
|
|
|
761
788
|
* No confirmation within OPEN_URL_CONFIRM_MS (a link the system opens directly): nothing to answer.
|
|
762
789
|
*/
|
|
763
790
|
async openUrlFromOutside(url: string): Promise<void> {
|
|
791
|
+
await this.prepareSystemUi();
|
|
764
792
|
await this.simctl(['openurl', this.udid, url]);
|
|
765
793
|
const deadline = Date.now() + OPEN_URL_CONFIRM_MS;
|
|
766
794
|
for (;;) {
|
|
@@ -795,44 +823,93 @@ export class IosProvider implements DeviceProvider {
|
|
|
795
823
|
|
|
796
824
|
/**
|
|
797
825
|
* Tap the notification titled `title`: its banner while it is shown, else in Notification Center
|
|
798
|
-
* (swiped down from the top edge). Banners read "<time>, <title>, <body>". Waits up to `timeoutMs` for it
|
|
826
|
+
* (swiped down from the top edge). Banners read "<time>, <title>, <body>". Waits up to `timeoutMs` for it,
|
|
827
|
+
* counted once the system UI runner is up (issue #64).
|
|
828
|
+
*
|
|
829
|
+
* A tap counts once the app is in front (issue #68): a banner that slides away by itself under the tap
|
|
830
|
+
* also leaves the screen, but the app stays suspended. Otherwise Quiesco looks again — in Notification
|
|
831
|
+
* Center once the banner is gone — and taps the topmost matching notification: a first tap on a stack of
|
|
832
|
+
* the app's notifications only expands it (issue #65).
|
|
799
833
|
*/
|
|
800
834
|
async openNotification(title: string, timeoutMs: number): Promise<void> {
|
|
801
|
-
|
|
835
|
+
await this.prepareSystemUi();
|
|
836
|
+
const runner = this.runner;
|
|
837
|
+
const matches = (o: { label: string }) => o.label.split(', ').includes(title) || o.label.includes(title);
|
|
838
|
+
let shown: RunnerScreen['others'] = [];
|
|
839
|
+
// The topmost one: in an expanded stack the newest notification comes first.
|
|
840
|
+
const find = async () => {
|
|
841
|
+
shown = (await runner.screen()).others;
|
|
842
|
+
return shown.filter(matches).sort((a, b) => (a.frame[1] ?? 0) - (b.frame[1] ?? 0))[0];
|
|
843
|
+
};
|
|
844
|
+
const appState = runner.appState?.bind(runner);
|
|
845
|
+
const inFront = async () => appState !== undefined && (await appState(this.bundleId).catch(() => 0)) === RUNNING_FOREGROUND;
|
|
802
846
|
const start = Date.now();
|
|
803
847
|
const deadline = start + timeoutMs;
|
|
804
848
|
let centerOpened = false;
|
|
805
849
|
let taps = 0;
|
|
806
850
|
for (;;) {
|
|
807
851
|
const hit = await find();
|
|
808
|
-
if (hit !== undefined) {
|
|
809
|
-
// The banner slides in: tap only once two reads
|
|
810
|
-
//
|
|
811
|
-
//
|
|
852
|
+
if (hit !== undefined && taps < NOTIFICATION_TAPS && (taps === 0 || Date.now() <= deadline)) {
|
|
853
|
+
// The banner slides in, Notification Center slides down: tap only once two reads a moment apart
|
|
854
|
+
// agree on where it is (a tap during the animation misses; the app then stays in the background,
|
|
855
|
+
// suspended — batch D 2026-11-13).
|
|
856
|
+
await new Promise((r) => setTimeout(r, NOTIFICATION_POLL_MS));
|
|
812
857
|
const again = await find();
|
|
813
858
|
if (again === undefined || JSON.stringify(again.frame) !== JSON.stringify(hit.frame)) continue;
|
|
859
|
+
const before = new Set(shown.map((o) => o.label));
|
|
860
|
+
const matching = shown.filter(matches).length;
|
|
814
861
|
const b = screenNodes({ alerts: [], others: [again] })[0]!.bounds;
|
|
815
|
-
await
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
if (
|
|
820
|
-
|
|
862
|
+
await runner.tap((b.x1 + b.x2) / 2, (b.y1 + b.y2) / 2);
|
|
863
|
+
taps++;
|
|
864
|
+
// A stack that expanded shows more matching notifications: look again right away.
|
|
865
|
+
const expanded = async () => (await find(), shown.filter(matches).length > matching);
|
|
866
|
+
if (await this.tapOpened(appState !== undefined, inFront, find, deadline, expanded)) return;
|
|
867
|
+
// On a locked device a tap only slides the notification to the right and shows an "Open" button on
|
|
868
|
+
// its left (in the device's language): a new, small button, not a notification, left in that row.
|
|
869
|
+
// Not one on the right ("Clear", "Options"), nor another notification.
|
|
870
|
+
await find();
|
|
871
|
+
const revealed = shown.find((o) => !before.has(o.label) && !matches(o) && !o.label.includes(', ') && revealedOpen(o.frame, b));
|
|
872
|
+
if (revealed !== undefined) {
|
|
873
|
+
const r = screenNodes({ alerts: [], others: [revealed] })[0]!.bounds;
|
|
874
|
+
this.logger.warn(`openNotification: tapping "${title}" showed ${JSON.stringify(revealed.label)} (a locked device); tapping it`);
|
|
875
|
+
await runner.tap((r.x1 + r.x2) / 2, (r.y1 + r.y2) / 2);
|
|
876
|
+
if (await this.tapOpened(appState !== undefined, inFront, find, deadline, async () => false)) return;
|
|
877
|
+
}
|
|
878
|
+
this.logger.warn(`openNotification: the app did not come to the front after tapping "${title}"; looking again`);
|
|
821
879
|
continue;
|
|
822
880
|
}
|
|
881
|
+
if (taps > 0 && (await inFront())) return;
|
|
823
882
|
if (Date.now() > deadline) {
|
|
824
|
-
const seen = (await
|
|
883
|
+
const seen = (await runner.screen().catch(() => ({ alerts: [], others: [] }))).others.map((o) => JSON.stringify(o.label)).slice(0, 8);
|
|
884
|
+
if (taps > 0) {
|
|
885
|
+
throw new QuiescoError('DEVICE_ERROR', `openNotification: tapped "${title}" ${taps} time(s), but the app did not come to the front within ${timeoutMs}ms (seen: ${seen.join(', ') || 'nothing'})`);
|
|
886
|
+
}
|
|
825
887
|
throw new QuiescoError('DEVICE_ERROR', `openNotification: no notification "${title}" in a banner or Notification Center within ${timeoutMs}ms (seen: ${seen.join(', ') || 'nothing'}). Can the app show notifications (system.allowPermission())?`);
|
|
826
888
|
}
|
|
827
|
-
// The banner goes away after a few seconds; then the notification is in Notification Center.
|
|
828
|
-
if (!centerOpened && Date.now() > start + Math.min(BANNER_WAIT_MS, timeoutMs / 2)) {
|
|
829
|
-
await
|
|
889
|
+
// The banner goes away after a few seconds (also after a tap that missed it); then the notification is in Notification Center.
|
|
890
|
+
if (!centerOpened && (taps > 0 || Date.now() > start + Math.min(BANNER_WAIT_MS, timeoutMs / 2))) {
|
|
891
|
+
await runner.openNotificationCenter();
|
|
830
892
|
centerOpened = true;
|
|
831
893
|
}
|
|
832
894
|
await new Promise((r) => setTimeout(r, NOTIFICATION_POLL_MS));
|
|
833
895
|
}
|
|
834
896
|
}
|
|
835
897
|
|
|
898
|
+
/**
|
|
899
|
+
* Whether a notification tap opened the app: the app is in front within NOTIFICATION_FRONT_MS
|
|
900
|
+
* (`knowsState`), else (a runner that cannot tell) the notification went away within NOTIFICATION_TAP_CONFIRM_MS.
|
|
901
|
+
*/
|
|
902
|
+
private async tapOpened(knowsState: boolean, inFront: () => Promise<boolean>, find: () => Promise<unknown>, deadline: number, expanded: () => Promise<boolean>): Promise<boolean> {
|
|
903
|
+
// Not past the call's deadline (but one look at least).
|
|
904
|
+
const until = Math.min(Date.now() + (knowsState ? NOTIFICATION_FRONT_MS : NOTIFICATION_TAP_CONFIRM_MS), Math.max(deadline, Date.now()));
|
|
905
|
+
for (;;) {
|
|
906
|
+
if (knowsState ? await inFront() : (await find()) === undefined) return true;
|
|
907
|
+
if (knowsState && (await expanded())) return false;
|
|
908
|
+
if (Date.now() >= until) return false;
|
|
909
|
+
await new Promise((r) => setTimeout(r, NOTIFICATION_POLL_MS));
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
|
|
836
913
|
/** Alerts outlive the app (a relaunch keeps a permission alert up): dismiss what an earlier scenario left. */
|
|
837
914
|
private async dismissLeftoverAlerts(): Promise<void> {
|
|
838
915
|
if (this.runnerInstance?.running !== true) return;
|
|
@@ -1031,6 +1108,25 @@ export class IosProvider implements DeviceProvider {
|
|
|
1031
1108
|
if (this.bootedByUs && this.options.device?.shutdown === true) await this.simctl(['shutdown', this.sim.udid]).catch(() => undefined);
|
|
1032
1109
|
}
|
|
1033
1110
|
|
|
1111
|
+
async isAppRunning(): Promise<boolean> {
|
|
1112
|
+
const services = await this.simctl(['spawn', this.udid, 'launchctl', 'list']);
|
|
1113
|
+
return services.split('\n').some((l) => l.includes(`UIKitApplication:${this.bundleId}[`) && /^\d+\s/.test(l));
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
/**
|
|
1117
|
+
* The app's crash report (`.ips`), written by ReportCrash about a second after the crash: waits up to
|
|
1118
|
+
* `crashReportWaitMs` for it.
|
|
1119
|
+
*/
|
|
1120
|
+
async crashReport(sinceMs: number): Promise<CrashReport | null> {
|
|
1121
|
+
const dir = this.options.crashReportDir ?? path.join(os.homedir(), 'Library', 'Logs', 'DiagnosticReports');
|
|
1122
|
+
const deadline = Date.now() + (this.options.crashReportWaitMs ?? 5_000);
|
|
1123
|
+
for (;;) {
|
|
1124
|
+
const report = await newestIosCrash(dir, this.bundleId, sinceMs);
|
|
1125
|
+
if (report !== null || Date.now() >= deadline) return report;
|
|
1126
|
+
await new Promise((r) => setTimeout(r, 250));
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1034
1130
|
async diagnose(params: LaunchParams): Promise<string[]> {
|
|
1035
1131
|
const lines = [`The simulator shares the Mac's network: the app connects to ws://localhost:${params.port} directly.`];
|
|
1036
1132
|
const services = await this.simctl(['spawn', this.udid, 'launchctl', 'list']).catch(() => '');
|