@appium/coresim 1.5.0 → 1.6.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.
Files changed (47) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +14 -0
  3. package/binding.gyp +7 -0
  4. package/lib/src/commands/video-recording.d.ts +14 -7
  5. package/lib/src/commands/video-recording.d.ts.map +1 -1
  6. package/lib/src/commands/video-recording.js +36 -11
  7. package/lib/src/commands/video-recording.js.map +1 -1
  8. package/lib/src/commands/video-stream.d.ts +55 -7
  9. package/lib/src/commands/video-stream.d.ts.map +1 -1
  10. package/lib/src/commands/video-stream.js +37 -35
  11. package/lib/src/commands/video-stream.js.map +1 -1
  12. package/lib/src/native-simctl.js +12 -1
  13. package/lib/src/native-simctl.js.map +1 -1
  14. package/lib/src/types.d.ts +72 -10
  15. package/lib/src/types.d.ts.map +1 -1
  16. package/lib/src/utils/index.d.ts +1 -1
  17. package/lib/src/utils/index.d.ts.map +1 -1
  18. package/lib/src/utils/index.js +1 -1
  19. package/lib/src/utils/index.js.map +1 -1
  20. package/lib/src/utils/run-catching.d.ts +4 -0
  21. package/lib/src/utils/run-catching.d.ts.map +1 -1
  22. package/lib/src/utils/run-catching.js +11 -0
  23. package/lib/src/utils/run-catching.js.map +1 -1
  24. package/package.json +1 -1
  25. package/prebuilds/darwin-arm64/@appium+coresim.node +0 -0
  26. package/src/commands/video-recording.ts +49 -19
  27. package/src/commands/video-stream.ts +48 -39
  28. package/src/coresim.mm +547 -118
  29. package/src/native/audio_encoder.h +65 -0
  30. package/src/native/audio_encoder.mm +270 -0
  31. package/src/native/av_recording.h +52 -0
  32. package/src/native/av_recording.mm +424 -0
  33. package/src/native/av_stream.h +70 -0
  34. package/src/native/av_stream.mm +217 -0
  35. package/src/native/monotonic_clock.h +20 -0
  36. package/src/native/sim_audio_tap.h +67 -0
  37. package/src/native/sim_audio_tap.mm +350 -0
  38. package/src/native/sim_process.h +10 -0
  39. package/src/native/sim_process.mm +81 -18
  40. package/src/native/sim_video_stream.h +14 -11
  41. package/src/native/sim_video_stream.mm +27 -383
  42. package/src/native/video_encoder.h +76 -0
  43. package/src/native/video_encoder.mm +417 -0
  44. package/src/native-simctl.ts +12 -1
  45. package/src/types.ts +84 -11
  46. package/src/utils/index.ts +1 -1
  47. package/src/utils/run-catching.ts +11 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [1.6.0](https://github.com/appium/coresim/compare/v1.5.0...v1.6.0) (2026-09-23)
2
+
3
+ ### Features
4
+
5
+ * add optional audio capture to video recording and streaming ([#18](https://github.com/appium/coresim/issues/18)) ([e634078](https://github.com/appium/coresim/commit/e634078669db724a676bf95fa074a89d3ac5a9c8))
6
+
1
7
  ## [1.5.0](https://github.com/appium/coresim/compare/v1.4.0...v1.5.0) (2026-09-22)
2
8
 
3
9
  ### Features
package/README.md CHANGED
@@ -54,6 +54,20 @@ await sim.deleteDevice(device.udid);
54
54
  readiness with `getBootStatus()`/`waitForBoot()`.
55
55
  - **Apps** — install, remove, launch, terminate, and inspect apps.
56
56
  - **Processes** — spawn a process on the simulator and stream its stdout/stderr live.
57
+ - **Screen capture** — screenshots, video recording to a file, and a real-time encoded video
58
+ stream — optionally with the device's own audio, muxed into the recording or interleaved into
59
+ the stream (`audio: true` on `startVideoRecording`/`startVideoStream`). Audio capture requires:
60
+ - **macOS 14.2+** on the host (Core Audio process taps).
61
+ - The host's **"System Audio Recording Only"** privacy permission (System Settings > Privacy &
62
+ Security > Screen & System Audio Recording). This can't be granted programmatically, and a
63
+ denial isn't a thrown error — it silently produces an audio-less/near-silent track.
64
+ - A default audio output device on the host, and a booted simulator that has produced audio at
65
+ least once (e.g. a foreground app that plays sound) — an empty guest process set throws.
66
+ - Uses a host-side Core Audio API, not anything iOS-version-specific, so it's expected to work
67
+ on any simulator runtime; only Xcode 26.x has actually been exercised so far.
68
+
69
+ On some CI/headless hosts, starting an audio capture can block for a while before failing —
70
+ see [`CLAUDE.md`](./CLAUDE.md) for the known root cause and current workaround.
57
71
  - **Simulator settings** — appearance (light/dark), accessibility (increase contrast, content
58
72
  size), location, and permissions.
59
73
  - **Extras** — keychain certificates, push notifications, and Darwin notifications.
package/binding.gyp CHANGED
@@ -13,8 +13,13 @@
13
13
  "src/native/tcc_privacy.mm",
14
14
  "src/native/sim_pasteboard.mm",
15
15
  "src/native/sim_process.mm",
16
+ "src/native/sim_audio_tap.mm",
17
+ "src/native/audio_encoder.mm",
18
+ "src/native/av_recording.mm",
19
+ "src/native/av_stream.mm",
16
20
  "src/native/sim_screenshot.mm",
17
21
  "src/native/sim_video_recording.mm",
22
+ "src/native/video_encoder.mm",
18
23
  "src/native/sim_video_stream.mm"
19
24
  ],
20
25
  "include_dirs": [
@@ -44,7 +49,9 @@
44
49
  "OTHER_LDFLAGS": [
45
50
  "-framework", "Foundation",
46
51
  "-framework", "AppKit",
52
+ "-framework", "AudioToolbox",
47
53
  "-framework", "AVFoundation",
54
+ "-framework", "CoreAudio",
48
55
  "-framework", "CoreImage",
49
56
  "-framework", "CoreMedia",
50
57
  "-framework", "CoreVideo",
@@ -8,17 +8,24 @@ declare module '../native-simctl.js' {
8
8
  }
9
9
  }
10
10
  /**
11
- * Starts recording the device's display to `outputFile` — the native equivalent of `simctl io
12
- * <udid> recordVideo`. Resolves once the first frame has actually been recorded, so it's always
13
- * safe to call {@link stopVideoRecording} immediately after. Only one recording may be active per
14
- * device at a time; starting a second one while the first is still running rejects. Rejects with
15
- * `NativeSimUnavailableError` if this CoreSimulator predates the private capture API — confirmed
16
- * missing on Xcode 16.4's, present on Xcode 26.5+ (Apple documents no exact version floor).
11
+ * Starts recording the device's display (and, with `options.audio`, its audio too, muxed as a
12
+ * second track) to `outputFile` — the native equivalent of `simctl io <udid> recordVideo` when
13
+ * both `audio` and `fps` are unset. Resolves once the first frame has actually been recorded, so
14
+ * it's always safe to call {@link stopVideoRecording} immediately after. Only one recording may be
15
+ * active per device at a time; starting a second one while the first is still running rejects.
16
+ *
17
+ * Without `audio`/`fps`, rejects with `NativeSimUnavailableError` if this CoreSimulator predates
18
+ * the private capture API — confirmed missing on Xcode 16.4's, present on Xcode 26.5+ (Apple
19
+ * documents no exact version floor). With either set, see {@link VideoRecordingOptions.audio}'s
20
+ * own doc comment for the host-permission requirement that applies specifically to `audio`; a
21
+ * failure *after* this call has already resolved (e.g. the audio tap's guest process set vanishing
22
+ * mid-recording) doesn't reject it — it's logged here instead — call {@link stopVideoRecording} to
23
+ * observe it as a rejection and release the recording's resources.
17
24
  *
18
25
  * @param udid — UDID of the device to record; must be booted
19
26
  * @param outputFile — filesystem path to write the video to; resolved against `process.cwd()` if
20
27
  * relative, since the native layer requires an absolute path
21
- * @param options — `displayId`, `codec`, `mask` — see {@link VideoRecordingOptions}
28
+ * @param options — `displayId`, `codec`, `mask`, `audio`, `fps`, `bitrate` — see {@link VideoRecordingOptions}
22
29
  * @throws {Error} if a recording is already in progress for this device
23
30
  */
24
31
  export declare function startVideoRecording(this: NativeSimctl, udid: string, outputFile: string, options?: VideoRecordingOptions): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"video-recording.d.ts","sourceRoot":"","sources":["../../../src/commands/video-recording.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,aAAa,CAAC;AAGvD,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,YAAY;QACpB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QACtG,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAChD,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;KAClD;CACF;AAgBD;;;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I,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BxF;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEzF"}
@@ -1,29 +1,51 @@
1
1
  import path from 'node:path';
2
- import { runCatchingAsync } from '../utils/index.js';
2
+ import { logger } from '@appium/support';
3
+ import { runCatchingAsync, toTypedError } from '../utils/index.js';
4
+ const log = logger.getLogger('CoreSim');
3
5
  // Tracks which devices currently have an active recording — module-level since the constraint (at
4
6
  // most one per device) is CoreSimulator's own, not per-NativeSimctl-instance.
5
7
  const activeRecordings = new Map();
6
8
  /**
7
- * Starts recording the device's display to `outputFile` — the native equivalent of `simctl io
8
- * <udid> recordVideo`. Resolves once the first frame has actually been recorded, so it's always
9
- * safe to call {@link stopVideoRecording} immediately after. Only one recording may be active per
10
- * device at a time; starting a second one while the first is still running rejects. Rejects with
11
- * `NativeSimUnavailableError` if this CoreSimulator predates the private capture API — confirmed
12
- * missing on Xcode 16.4's, present on Xcode 26.5+ (Apple documents no exact version floor).
9
+ * Starts recording the device's display (and, with `options.audio`, its audio too, muxed as a
10
+ * second track) to `outputFile` — the native equivalent of `simctl io <udid> recordVideo` when
11
+ * both `audio` and `fps` are unset. Resolves once the first frame has actually been recorded, so
12
+ * it's always safe to call {@link stopVideoRecording} immediately after. Only one recording may be
13
+ * active per device at a time; starting a second one while the first is still running rejects.
14
+ *
15
+ * Without `audio`/`fps`, rejects with `NativeSimUnavailableError` if this CoreSimulator predates
16
+ * the private capture API — confirmed missing on Xcode 16.4's, present on Xcode 26.5+ (Apple
17
+ * documents no exact version floor). With either set, see {@link VideoRecordingOptions.audio}'s
18
+ * own doc comment for the host-permission requirement that applies specifically to `audio`; a
19
+ * failure *after* this call has already resolved (e.g. the audio tap's guest process set vanishing
20
+ * mid-recording) doesn't reject it — it's logged here instead — call {@link stopVideoRecording} to
21
+ * observe it as a rejection and release the recording's resources.
13
22
  *
14
23
  * @param udid — UDID of the device to record; must be booted
15
24
  * @param outputFile — filesystem path to write the video to; resolved against `process.cwd()` if
16
25
  * relative, since the native layer requires an absolute path
17
- * @param options — `displayId`, `codec`, `mask` — see {@link VideoRecordingOptions}
26
+ * @param options — `displayId`, `codec`, `mask`, `audio`, `fps`, `bitrate` — see {@link VideoRecordingOptions}
18
27
  * @throws {Error} if a recording is already in progress for this device
19
28
  */
20
29
  export async function startVideoRecording(udid, outputFile, options = {}) {
30
+ // Mirrors startVideoStream's identical validation — both reach the same native encoder path,
31
+ // which otherwise silently truncates an out-of-range value instead of rejecting it.
32
+ if (options.fps !== undefined && (!Number.isFinite(options.fps) || options.fps < 1)) {
33
+ throw new RangeError(`fps must be a finite number >= 1, got ${options.fps}`);
34
+ }
35
+ if (options.bitrate !== undefined &&
36
+ (!Number.isFinite(options.bitrate) || options.bitrate <= 0 || options.bitrate > 2 ** 31 - 1)) {
37
+ throw new RangeError(`bitrate must be a positive number no greater than ${2 ** 31 - 1}, got ${options.bitrate}`);
38
+ }
21
39
  const key = udid.toLowerCase();
22
40
  if (activeRecordings.has(key)) {
23
41
  throw new Error(`A video recording is already in progress for device '${udid}'`);
24
42
  }
25
43
  const absoluteOutputFile = path.resolve(outputFile);
26
- const startPromise = runCatchingAsync(async () => (await this._findDevice(udid)).startVideoRecording(absoluteOutputFile, options));
44
+ const startPromise = runCatchingAsync(async () => (await this._findDevice(udid)).startVideoRecording(absoluteOutputFile, options, (err) => {
45
+ // Only ever invoked on the `audio`/`fps` (own-encoder) path — see its own doc comment above.
46
+ // No live consumer to report to (this call already resolved), so logged instead of lost.
47
+ log.error(`Unhandled video recording error for device '${udid}': ${toTypedError(err).stack ?? err}`);
48
+ }));
27
49
  // Marked before the native call resolves, not after, so a concurrent startVideoRecording for the
28
50
  // same device is rejected immediately instead of racing this one — rolled back below on failure.
29
51
  const state = { start: startPromise };
@@ -62,14 +84,17 @@ export async function stopVideoRecording(udid) {
62
84
  if (!state) {
63
85
  throw new Error(`No video recording is in progress for device '${udid}'`);
64
86
  }
87
+ let handle;
65
88
  try {
66
- await state.start;
89
+ handle = await state.start;
67
90
  }
68
91
  catch {
69
92
  // start itself failed — its own catch already cleaned up activeRecordings; nothing to stop.
70
93
  throw new Error(`No video recording is in progress for device '${udid}'`);
71
94
  }
72
- const stopPromise = (state.stop ??= runCatchingAsync(async () => (await this._findDevice(udid)).stopVideoRecording()));
95
+ const stopPromise = (state.stop ??= runCatchingAsync(async () => {
96
+ await handle.stop();
97
+ }));
73
98
  try {
74
99
  await stopPromise;
75
100
  }
@@ -1 +1 @@
1
- {"version":3,"file":"video-recording.js","sourceRoot":"","sources":["../../../src/commands/video-recording.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,OAAO,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AAoBnD,kGAAkG;AAClG,8EAA8E;AAC9E,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAA0B,CAAC;AAE3D;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAEvC,IAAY,EACZ,UAAkB,EAClB,UAAiC,EAAE;IAEnC,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAC/B,IAAI,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,wDAAwD,IAAI,GAAG,CAAC,CAAC;IACnF,CAAC;IACD,MAAM,kBAAkB,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACpD,MAAM,YAAY,GAAG,gBAAgB,CAAC,KAAK,IAAI,EAAE,CAC/C,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAChF,CAAC;IACF,iGAAiG;IACj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/B,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAqB,IAAY;IACrE,OAAO,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;AAClD,CAAC"}
@@ -6,9 +6,56 @@ declare module '../native-simctl.js' {
6
6
  startVideoStream(udid: string, options?: VideoStreamOptions): Promise<VideoStream>;
7
7
  }
8
8
  }
9
+ export declare const MAX_BUFFERED_UNITS = 60;
9
10
  /**
10
- * A live video stream from `NativeSimctl.startVideoStream` — encodes the device's display in real
11
- * time via VideoToolbox, unlike `startVideoRecording`, which drives CoreSimulator's own private,
11
+ * Single-consumer FIFO between native's per-frame callback and `accessUnits()`. Unlike routing
12
+ * through `EventEmitter`, a unit pushed before any consumer has started iterating is retained
13
+ * (fixing the encoder's own first-frame/keyframe otherwise being lost to a startup race) rather
14
+ * than silently dropped.
15
+ *
16
+ * Bounded at `MAX_BUFFERED_UNITS`, but resync-aware about *how* it sheds load once a slow consumer
17
+ * falls behind: since interframes only reference earlier frames they were encoded against (no
18
+ * `AllowFrameReordering`), dropping an arbitrary one would orphan every later one from its
19
+ * reference chain, corrupting decode from that point on even though delivery looks unbroken.
20
+ * Overflow instead clears the backlog entirely and enters a resync state — `dropsDuringResync`
21
+ * decides which further units to discard (not buffer) until `endsResync` sees a self-decodable
22
+ * point to resume clean delivery from. Generic (not hardcoded to video's own reference-chain
23
+ * concern) so `VideoStream` can reuse this same machinery when it's carrying interleaved audio
24
+ * too (`VideoStreamOptions.audio`) — an audio unit is always independently decodable, so it's
25
+ * configured to never be dropped and never itself end a resync; only video interframes are.
26
+ */
27
+ export declare class AccessUnitQueue<T> {
28
+ private readonly opts;
29
+ private readonly buffer;
30
+ private waiter;
31
+ private ended;
32
+ private error;
33
+ private resyncing;
34
+ constructor(opts: {
35
+ /** Whether `unit` should be discarded (not buffered) while resyncing. */
36
+ dropsDuringResync: (unit: T) => boolean;
37
+ /** Whether `unit` is a self-decodable point resync can resume clean delivery from. */
38
+ endsResync: (unit: T) => boolean;
39
+ /** Called once when overflow first forces a resync, e.g. to request a fresh keyframe. */
40
+ onOverflow?: () => void;
41
+ });
42
+ push(unit: T): void;
43
+ /** Ends the queue with an error — any pending or future `next()` rejects with it. */
44
+ fail(err: unknown): void;
45
+ /** Ends the queue cleanly — any pending or future `next()` resolves `done`. */
46
+ end(): void;
47
+ /**
48
+ * Resolves `done` (not rejects) if `signal` aborts while waiting, mirroring `events.on()`.
49
+ * Checks cancellation/end *before* dequeuing, so an already-aborted signal or an already-ended
50
+ * queue never hands out a stale buffered unit — an aborted consumer, or a fresh iterator started
51
+ * after `stop()`, must see the boundary immediately rather than draining leftovers first.
52
+ */
53
+ next(signal: AbortSignal): Promise<IteratorResult<T>>;
54
+ }
55
+ /**
56
+ * A live video stream from `NativeSimctl.startVideoStream` — encodes the device's display (and,
57
+ * with `options.audio`, its audio too — see {@link VideoStreamOptions}) in real time via
58
+ * VideoToolbox/Core Audio, unlike `startVideoRecording`, which drives CoreSimulator's own private,
12
59
  * file-only recorder. Mirrors `appium-ios-remotexpc`'s `ScreenStreamCapture` shape
13
60
  * (`accessUnits()`/`stop()`) for API consistency; the transport is otherwise unrelated.
14
61
  */
@@ -32,13 +79,14 @@ export declare class VideoStream extends EventEmitter {
32
79
  stop(): Promise<void>;
33
80
  }
34
81
  /**
35
- * Starts encoding the device's display in real time. Resolves once the encoder has actually
36
- * started; the returned {@link VideoStream}'s `accessUnits()` then yields each frame as it
37
- * arrives. Independent of `startVideoRecording`/`stopVideoRecording` — both, and any number of
38
- * concurrent streams, can run on the same device at once.
82
+ * Starts encoding the device's display (and, with `options.audio`, its audio) in real time.
83
+ * Resolves once the encoder(s) have actually started; the returned {@link VideoStream}'s
84
+ * `accessUnits()` then yields each unit as it arrives. Independent of
85
+ * `startVideoRecording`/`stopVideoRecording` — both, and any number of concurrent streams, can
86
+ * run on the same device at once.
39
87
  *
40
88
  * @param udid — UDID of the device to stream; must be booted
41
- * @param options — `displayId`, `codec`, `fps`, `bitrate` — see {@link VideoStreamOptions}
89
+ * @param options — `displayId`, `codec`, `fps`, `bitrate`, `audio` — see {@link VideoStreamOptions}
42
90
  */
43
91
  export declare function startVideoStream(this: NativeSimctl, udid: string, options?: VideoStreamOptions): Promise<VideoStream>;
44
92
  //# sourceMappingURL=video-stream.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"video-stream.d.ts","sourceRoot":"","sources":["../../../src/commands/video-stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AAKzC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAA0B,eAAe,EAAE,kBAAkB,EAAC,MAAM,aAAa,CAAC;AAG9F,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,YAAY;QACpB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;KACpF;CACF;AA2ID;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,YAAY;aAWf,KAAK,EAAE,MAAM,GAAG,MAAM;IAVlD,OAAO,CAAC,MAAM,CAAsC;IACpD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAyB;IACxD,OAAO,CAAC,WAAW,CAA4B;IAI/C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA6D;IACnF,OAAO,CAAC,eAAe,CAAK;IAiC5B;;;;;;;OAOG;IACI,WAAW,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,cAAc,CAAC,eAAe,CAAC;IAmBzE,gGAAgG;IAC1F,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ5B;AAED;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,kBAAuB,GAC/B,OAAO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AAC,CAAC,CAAC;CA6BtD;AAED;;;;;;GAMG;AACH,qBAAa,WAAY,SAAQ,YAAY;aAiBf,KAAK,EAAE,MAAM,GAAG,MAAM;IAhBlD,OAAO,CAAC,MAAM,CAAsC;IACpD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAyB;IACxD,OAAO,CAAC,WAAW,CAA4B;IAM/C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAInB;IACH,OAAO,CAAC,eAAe,CAAK;IAiC5B;;;;;;;OAOG;IACI,WAAW,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,cAAc,CAAC,eAAe,CAAC;IAmBzE,gGAAgG;IAC1F,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ5B;AAED;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,WAAW,CAAC,CAuBtB"}
@@ -1,58 +1,52 @@
1
1
  import { EventEmitter } from 'node:events';
2
2
  import { logger } from '@appium/support';
3
- import { wrapNativeError } from '../errors.js';
4
- import { runCatchingAsync } from '../utils/index.js';
3
+ import { runCatchingAsync, toTypedError } from '../utils/index.js';
5
4
  const log = logger.getLogger('CoreSim');
6
5
  // Matches the native side's own ThreadSafeFunction queue bound (see coresim.mm's
7
6
  // kAccessUnitQueueSize) — kept here too since the native bound alone provides no real
8
7
  // backpressure: _handleAccessUnit's emit-equivalent push always returns immediately, regardless of
9
8
  // how slow the actual accessUnits() consumer is, so without a bound of its own this queue could
10
9
  // otherwise grow without limit while a slow consumer falls behind.
11
- const MAX_BUFFERED_UNITS = 60;
10
+ export const MAX_BUFFERED_UNITS = 60;
12
11
  const SINGLE_CONSUMER_ERROR = 'VideoStream.accessUnits() supports only one active consumer at a time — a second concurrent call rejects.';
13
- /** `wrapNativeError` always throws — this just gets its thrown value back as a plain return, to emit rather than raise it. */
14
- function toTypedError(err) {
15
- try {
16
- wrapNativeError(err);
17
- }
18
- catch (wrapped) {
19
- return wrapped;
20
- }
21
- }
22
12
  /**
23
13
  * Single-consumer FIFO between native's per-frame callback and `accessUnits()`. Unlike routing
24
14
  * through `EventEmitter`, a unit pushed before any consumer has started iterating is retained
25
15
  * (fixing the encoder's own first-frame/keyframe otherwise being lost to a startup race) rather
26
16
  * than silently dropped.
27
17
  *
28
- * Bounded at `MAX_BUFFERED_UNITS`, but codec-aware about *how* it sheds load once a slow consumer
29
- * falls behind: since frames only reference earlier frames they were encoded against (no
30
- * `AllowFrameReordering`), dropping an arbitrary interframe would orphan every later one from its
18
+ * Bounded at `MAX_BUFFERED_UNITS`, but resync-aware about *how* it sheds load once a slow consumer
19
+ * falls behind: since interframes only reference earlier frames they were encoded against (no
20
+ * `AllowFrameReordering`), dropping an arbitrary one would orphan every later one from its
31
21
  * reference chain, corrupting decode from that point on even though delivery looks unbroken.
32
- * Overflow instead clears the backlog entirely and enters a resync state, discarding every
33
- * further interframe (not buffering them) until the next keyframe — self-decodable on its own —
34
- * lets delivery resume cleanly.
22
+ * Overflow instead clears the backlog entirely and enters a resync state — `dropsDuringResync`
23
+ * decides which further units to discard (not buffer) until `endsResync` sees a self-decodable
24
+ * point to resume clean delivery from. Generic (not hardcoded to video's own reference-chain
25
+ * concern) so `VideoStream` can reuse this same machinery when it's carrying interleaved audio
26
+ * too (`VideoStreamOptions.audio`) — an audio unit is always independently decodable, so it's
27
+ * configured to never be dropped and never itself end a resync; only video interframes are.
35
28
  */
36
- class AccessUnitQueue {
37
- onOverflow;
29
+ export class AccessUnitQueue {
30
+ opts;
38
31
  buffer = [];
39
32
  waiter;
40
33
  ended = false;
41
34
  error;
42
35
  resyncing = false;
43
- /** @param onOverflow — called once when overflow first forces a resync, e.g. to request a fresh keyframe. */
44
- constructor(onOverflow) {
45
- this.onOverflow = onOverflow;
36
+ constructor(opts) {
37
+ this.opts = opts;
46
38
  }
47
39
  push(unit) {
48
40
  if (this.ended) {
49
41
  return;
50
42
  }
51
43
  if (this.resyncing) {
52
- if (!unit.isKeyFrame) {
44
+ if (this.opts.dropsDuringResync(unit)) {
53
45
  return; // still waiting for a self-decodable point to resume delivery from
54
46
  }
55
- this.resyncing = false;
47
+ if (this.opts.endsResync(unit)) {
48
+ this.resyncing = false;
49
+ }
56
50
  }
57
51
  if (this.waiter) {
58
52
  const { resolve } = this.waiter;
@@ -64,7 +58,7 @@ class AccessUnitQueue {
64
58
  if (this.buffer.length > MAX_BUFFERED_UNITS) {
65
59
  this.buffer.length = 0;
66
60
  this.resyncing = true;
67
- this.onOverflow?.();
61
+ this.opts.onOverflow?.();
68
62
  }
69
63
  }
70
64
  /** Ends the queue with an error — any pending or future `next()` rejects with it. */
@@ -131,8 +125,9 @@ class AccessUnitQueue {
131
125
  }
132
126
  }
133
127
  /**
134
- * A live video stream from `NativeSimctl.startVideoStream` — encodes the device's display in real
135
- * time via VideoToolbox, unlike `startVideoRecording`, which drives CoreSimulator's own private,
128
+ * A live video stream from `NativeSimctl.startVideoStream` — encodes the device's display (and,
129
+ * with `options.audio`, its audio too — see {@link VideoStreamOptions}) in real time via
130
+ * VideoToolbox/Core Audio, unlike `startVideoRecording`, which drives CoreSimulator's own private,
136
131
  * file-only recorder. Mirrors `appium-ios-remotexpc`'s `ScreenStreamCapture` shape
137
132
  * (`accessUnits()`/`stop()`) for API consistency; the transport is otherwise unrelated.
138
133
  */
@@ -143,8 +138,14 @@ export class VideoStream extends EventEmitter {
143
138
  stopPromise;
144
139
  // Requests a fresh keyframe on resync so delivery can resume immediately rather than waiting
145
140
  // for the next periodic one — `handle` may not be attached yet on a startup-time overflow
146
- // (vanishingly unlikely given MAX_BUFFERED_UNITS), in which case this is just a no-op.
147
- queue = new AccessUnitQueue(() => this.handle?.requestKeyFrame());
141
+ // (vanishingly unlikely given MAX_BUFFERED_UNITS), in which case this is just a no-op. Only a
142
+ // video keyframe ends/is exempt from resync — an audio unit (when present) is always
143
+ // independently decodable, so it's never dropped and never itself ends a resync.
144
+ queue = new AccessUnitQueue({
145
+ dropsDuringResync: (unit) => unit.track === 'video' && !unit.isKeyFrame,
146
+ endsResync: (unit) => unit.track === 'video' && unit.isKeyFrame,
147
+ onOverflow: () => this.handle?.requestKeyFrame(),
148
+ });
148
149
  activeConsumers = 0;
149
150
  /** @internal */
150
151
  constructor(codec) {
@@ -213,13 +214,14 @@ export class VideoStream extends EventEmitter {
213
214
  }
214
215
  }
215
216
  /**
216
- * Starts encoding the device's display in real time. Resolves once the encoder has actually
217
- * started; the returned {@link VideoStream}'s `accessUnits()` then yields each frame as it
218
- * arrives. Independent of `startVideoRecording`/`stopVideoRecording` — both, and any number of
219
- * concurrent streams, can run on the same device at once.
217
+ * Starts encoding the device's display (and, with `options.audio`, its audio) in real time.
218
+ * Resolves once the encoder(s) have actually started; the returned {@link VideoStream}'s
219
+ * `accessUnits()` then yields each unit as it arrives. Independent of
220
+ * `startVideoRecording`/`stopVideoRecording` — both, and any number of concurrent streams, can
221
+ * run on the same device at once.
220
222
  *
221
223
  * @param udid — UDID of the device to stream; must be booted
222
- * @param options — `displayId`, `codec`, `fps`, `bitrate` — see {@link VideoStreamOptions}
224
+ * @param options — `displayId`, `codec`, `fps`, `bitrate`, `audio` — see {@link VideoStreamOptions}
223
225
  */
224
226
  export async function startVideoStream(udid, options = {}) {
225
227
  // The native poller clamps below 1 fps to 1 fps rather than actually polling that slowly, so a
@@ -1 +1 @@
1
- {"version":3,"file":"video-stream.js","sourceRoot":"","sources":["../../../src/commands/video-stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AAQnD,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;AAExC,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C;IAC7B,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -208,7 +208,18 @@ const loadNative = util.memoize(function loadNative() {
208
208
  if (process.platform !== 'darwin') {
209
209
  throw new NativeSimUnavailableError(`${PACKAGE_NAME} requires macOS — CoreSimulator.framework does not exist on ${process.platform}`, 'platform', process.platform, 'n/a');
210
210
  }
211
- return require('node-gyp-build')(getPkgRoot());
211
+ const native = require('node-gyp-build')(getPkgRoot());
212
+ // A forgotten (never explicitly stopped) AV recording/stream otherwise silently loses data —
213
+ // or just leaks a live encoder — the instant a caller force-exits via `process.exit()`, since
214
+ // Node's own cleanup hooks (coresim.mm's CleanupActiveSessions, registered against the exact
215
+ // same condition) are confirmed to NOT run in that path, only on a natural empty-event-loop
216
+ // exit or a Worker's own termination. `process.on('exit', ...)` does fire for `process.exit()`
217
+ // too, and (per Node's own contract) may run synchronous code — flushActiveSessions() qualifies:
218
+ // it's a single blocking native call, not new async JS work. Registered once, lazily, here
219
+ // rather than at module import time, so merely importing this package on a non-macOS platform
220
+ // never touches `process` for something it'll never need.
221
+ process.on('exit', () => native.flushActiveSessions());
222
+ return native;
212
223
  });
213
224
  const DEFAULT_DEVELOPER_DIR_TIMEOUT_MS = 15_000;
214
225
  function defaultDeveloperDir() {
@@ -1 +1 @@
1
- {"version":3,"file":"native-simctl.js","sourceRoot":"","sources":["../../src/native-simctl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAC,IAAI,EAAC,MAAM,iBAAiB,CAAC;AAErC,OAAO,EACL,OAAO,EACP,eAAe,EACf,UAAU,EACV,aAAa,EACb,cAAc,EACd,SAAS,EACT,SAAS,EACT,YAAY,GACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAC,eAAe,EAAE,mBAAmB,EAAE,kBAAkB,EAAC,MAAM,yBAAyB,CAAC;AACjG,OAAO,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