@appium/coresim 1.6.0 → 1.8.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 (42) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +5 -3
  3. package/binding.gyp +2 -1
  4. package/lib/src/commands/jpeg-stream.d.ts +44 -0
  5. package/lib/src/commands/jpeg-stream.d.ts.map +1 -0
  6. package/lib/src/commands/jpeg-stream.js +198 -0
  7. package/lib/src/commands/jpeg-stream.js.map +1 -0
  8. package/lib/src/commands/video-recording.d.ts +12 -3
  9. package/lib/src/commands/video-recording.d.ts.map +1 -1
  10. package/lib/src/commands/video-recording.js +19 -5
  11. package/lib/src/commands/video-recording.js.map +1 -1
  12. package/lib/src/index.d.ts +2 -1
  13. package/lib/src/index.d.ts.map +1 -1
  14. package/lib/src/index.js +1 -0
  15. package/lib/src/index.js.map +1 -1
  16. package/lib/src/native-simctl.d.ts +2 -0
  17. package/lib/src/native-simctl.d.ts.map +1 -1
  18. package/lib/src/native-simctl.js +3 -0
  19. package/lib/src/native-simctl.js.map +1 -1
  20. package/lib/src/types.d.ts +65 -2
  21. package/lib/src/types.d.ts.map +1 -1
  22. package/package.json +1 -1
  23. package/prebuilds/darwin-arm64/@appium+coresim.node +0 -0
  24. package/src/commands/jpeg-stream.ts +233 -0
  25. package/src/commands/video-recording.ts +27 -7
  26. package/src/coresim.mm +170 -6
  27. package/src/index.ts +4 -0
  28. package/src/native/audio_encoder.mm +1 -1
  29. package/src/native/av_recording.mm +1 -1
  30. package/src/native/sim_audio_tap.mm +3 -3
  31. package/src/native/sim_jpeg_stream.h +69 -0
  32. package/src/native/sim_jpeg_stream.mm +322 -0
  33. package/src/native/sim_pasteboard.mm +3 -3
  34. package/src/native/sim_process.mm +1 -1
  35. package/src/native/sim_screenshot.h +8 -0
  36. package/src/native/sim_screenshot.mm +29 -25
  37. package/src/native/sim_video_recording.mm +1 -1
  38. package/src/native/tcc_privacy.mm +1 -1
  39. package/src/native/video_encoder.h +2 -2
  40. package/src/native/video_encoder.mm +2 -2
  41. package/src/native-simctl.ts +3 -0
  42. package/src/types.ts +70 -2
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## [1.8.0](https://github.com/appium/coresim/compare/v1.7.0...v1.8.0) (2026-09-25)
2
+
3
+ ### Features
4
+
5
+ * add real-time JPEG frame streaming (startJpegStream) ([#20](https://github.com/appium/coresim/issues/20)) ([7a73c0a](https://github.com/appium/coresim/commit/7a73c0a46a5ce72afeb435fb9209e75d7a21df79))
6
+
7
+ ## [1.7.0](https://github.com/appium/coresim/compare/v1.6.0...v1.7.0) (2026-09-23)
8
+
9
+ ### Features
10
+
11
+ * add force option to stopVideoRecording ([#19](https://github.com/appium/coresim/issues/19)) ([1b756ce](https://github.com/appium/coresim/commit/1b756ce3d41ad35dca0f7448de82715570e6ce60))
12
+
1
13
  ## [1.6.0](https://github.com/appium/coresim/compare/v1.5.0...v1.6.0) (2026-09-23)
2
14
 
3
15
  ### Features
package/README.md CHANGED
@@ -54,9 +54,11 @@ 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:
57
+ - **Screen capture** — screenshots, video recording to a file, a real-time encoded video stream,
58
+ and a real-time JPEG frame stream (`startJpegStream` — configurable fps/quality, no video codec
59
+ involved, meant for callers building their own MJPEG stream out of the frame sequence) —
60
+ optionally with the device's own audio, muxed into the recording or interleaved into the video
61
+ stream (`audio: true` on `startVideoRecording`/`startVideoStream`). Audio capture requires:
60
62
  - **macOS 14.2+** on the host (Core Audio process taps).
61
63
  - The host's **"System Audio Recording Only"** privacy permission (System Settings > Privacy &
62
64
  Security > Screen & System Audio Recording). This can't be granted programmatically, and a
package/binding.gyp CHANGED
@@ -20,7 +20,8 @@
20
20
  "src/native/sim_screenshot.mm",
21
21
  "src/native/sim_video_recording.mm",
22
22
  "src/native/video_encoder.mm",
23
- "src/native/sim_video_stream.mm"
23
+ "src/native/sim_video_stream.mm",
24
+ "src/native/sim_jpeg_stream.mm"
24
25
  ],
25
26
  "include_dirs": [
26
27
  "<!@(node -p \"require('node-addon-api').include\")"
@@ -0,0 +1,44 @@
1
+ import { EventEmitter } from 'node:events';
2
+ import type { NativeSimctl } from '../native-simctl.js';
3
+ import type { JpegFrame, JpegStreamOptions } from '../types.js';
4
+ declare module '../native-simctl.js' {
5
+ interface NativeSimctl {
6
+ startJpegStream(udid: string, options?: JpegStreamOptions): Promise<JpegStream>;
7
+ }
8
+ }
9
+ /**
10
+ * A live JPEG frame stream from `NativeSimctl.startJpegStream` — polls the device's display and
11
+ * delivers each changed frame as a standalone JPEG image, at a configurable fps/quality. Unlike
12
+ * `startVideoStream`, this produces no video codec bitstream — it's meant for callers that want to
13
+ * build their own MJPEG (`multipart/x-mixed-replace`) HTTP stream, or otherwise just want a plain
14
+ * sequence of images, out of `frames()` themselves.
15
+ */
16
+ export declare class JpegStream extends EventEmitter {
17
+ private handle;
18
+ private readonly stopController;
19
+ private stopPromise;
20
+ private readonly queue;
21
+ private activeConsumers;
22
+ /**
23
+ * Yields each JPEG frame as it's produced, until {@link stop} is called or the stream errors (in
24
+ * which case the error is thrown out of the loop). Pass `signal` to stop iterating without
25
+ * treating that as an error.
26
+ *
27
+ * Only one active consumer is supported at a time — a second concurrent call rejects rather than
28
+ * silently sharing (and corrupting) the first one's single internal waiter slot.
29
+ */
30
+ frames(signal?: AbortSignal): AsyncGenerator<JpegFrame>;
31
+ /** Stops the stream and releases the underlying encoder. Idempotent, including concurrently. */
32
+ stop(): Promise<void>;
33
+ }
34
+ /**
35
+ * Starts polling the device's display and JPEG-encoding each changed frame in real time. Resolves
36
+ * once the encoder has actually started; the returned {@link JpegStream}'s `frames()` then yields
37
+ * each frame as it arrives. Independent of `startVideoStream`/`startVideoRecording` — any number of
38
+ * concurrent streams/recordings can run on the same device at once.
39
+ *
40
+ * @param udid — UDID of the device to stream; must be booted
41
+ * @param options — `displayId`, `fps`, `quality`, `scale` — see {@link JpegStreamOptions}
42
+ */
43
+ export declare function startJpegStream(this: NativeSimctl, udid: string, options?: JpegStreamOptions): Promise<JpegStream>;
44
+ //# sourceMappingURL=jpeg-stream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jpeg-stream.d.ts","sourceRoot":"","sources":["../../../src/commands/jpeg-stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AAIzC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAC,SAAS,EAAE,iBAAiB,EAAyB,MAAM,aAAa,CAAC;AAGtF,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,YAAY;QACpB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;KACjF;CACF;AAuGD;;;;;;GAMG;AACH,qBAAa,UAAW,SAAQ,YAAY;IAC1C,OAAO,CAAC,MAAM,CAAqC;IACnD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAyB;IACxD,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAwB;IAC9C,OAAO,CAAC,eAAe,CAAK;IA4B5B;;;;;;;OAOG;IACI,MAAM,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,cAAc,CAAC,SAAS,CAAC;IAmB9D,gGAAgG;IAC1F,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ5B;AAED;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,UAAU,CAAC,CA0BrB"}
@@ -0,0 +1,198 @@
1
+ import { EventEmitter } from 'node:events';
2
+ import { logger } from '@appium/support';
3
+ import { runCatchingAsync, toTypedError } from '../utils/index.js';
4
+ const log = logger.getLogger('CoreSim');
5
+ // Matches the native side's own ThreadSafeFunction queue bound (see coresim.mm's kFrameQueueSize).
6
+ const MAX_BUFFERED_FRAMES = 60;
7
+ const SINGLE_CONSUMER_ERROR = 'JpegStream.frames() supports only one active consumer at a time — a second concurrent call rejects.';
8
+ /**
9
+ * Single-consumer FIFO between native's per-frame callback and `frames()`. Simpler than
10
+ * `AccessUnitQueue` (video-stream.ts): every JPEG frame is independently decodable, so there's no
11
+ * reference chain to protect — overflow just drops the oldest buffered frame(s), keeping delivery
12
+ * as close to real time as possible instead of falling further behind.
13
+ */
14
+ class JpegFrameQueue {
15
+ buffer = [];
16
+ waiter;
17
+ ended = false;
18
+ error;
19
+ push(frame) {
20
+ if (this.ended) {
21
+ return;
22
+ }
23
+ if (this.waiter) {
24
+ const { resolve } = this.waiter;
25
+ this.waiter = undefined;
26
+ resolve({ value: frame, done: false });
27
+ return;
28
+ }
29
+ this.buffer.push(frame);
30
+ if (this.buffer.length > MAX_BUFFERED_FRAMES) {
31
+ this.buffer.shift();
32
+ }
33
+ }
34
+ /** Ends the queue with an error — any pending or future `next()` rejects with it. */
35
+ fail(err) {
36
+ if (this.ended) {
37
+ return;
38
+ }
39
+ this.ended = true;
40
+ this.error = err;
41
+ this.buffer.length = 0;
42
+ if (this.waiter) {
43
+ const { reject } = this.waiter;
44
+ this.waiter = undefined;
45
+ reject(err);
46
+ }
47
+ }
48
+ /** Ends the queue cleanly — any pending or future `next()` resolves `done`. */
49
+ end() {
50
+ if (this.ended) {
51
+ return;
52
+ }
53
+ this.ended = true;
54
+ this.buffer.length = 0;
55
+ if (this.waiter) {
56
+ const { resolve } = this.waiter;
57
+ this.waiter = undefined;
58
+ resolve({ value: undefined, done: true });
59
+ }
60
+ }
61
+ /**
62
+ * Resolves `done` (not rejects) if `signal` aborts while waiting, mirroring `events.on()`.
63
+ * Checks cancellation/end *before* dequeuing, so an already-aborted signal or an already-ended
64
+ * queue never hands out a stale buffered frame.
65
+ */
66
+ next(signal) {
67
+ if (signal.aborted) {
68
+ return Promise.resolve({ value: undefined, done: true });
69
+ }
70
+ if (this.ended) {
71
+ return this.error ? Promise.reject(this.error) : Promise.resolve({ value: undefined, done: true });
72
+ }
73
+ const buffered = this.buffer.shift();
74
+ if (buffered !== undefined) {
75
+ return Promise.resolve({ value: buffered, done: false });
76
+ }
77
+ return new Promise((resolve, reject) => {
78
+ const onAbort = () => {
79
+ this.waiter = undefined;
80
+ resolve({ value: undefined, done: true });
81
+ };
82
+ signal.addEventListener('abort', onAbort, { once: true });
83
+ this.waiter = {
84
+ resolve: (result) => {
85
+ signal.removeEventListener('abort', onAbort);
86
+ resolve(result);
87
+ },
88
+ reject: (err) => {
89
+ signal.removeEventListener('abort', onAbort);
90
+ reject(err);
91
+ },
92
+ };
93
+ });
94
+ }
95
+ }
96
+ /**
97
+ * A live JPEG frame stream from `NativeSimctl.startJpegStream` — polls the device's display and
98
+ * delivers each changed frame as a standalone JPEG image, at a configurable fps/quality. Unlike
99
+ * `startVideoStream`, this produces no video codec bitstream — it's meant for callers that want to
100
+ * build their own MJPEG (`multipart/x-mixed-replace`) HTTP stream, or otherwise just want a plain
101
+ * sequence of images, out of `frames()` themselves.
102
+ */
103
+ export class JpegStream extends EventEmitter {
104
+ handle;
105
+ stopController = new AbortController();
106
+ stopPromise;
107
+ queue = new JpegFrameQueue();
108
+ activeConsumers = 0;
109
+ /** @internal */
110
+ _handleFrame(frame) {
111
+ this.queue.push(frame);
112
+ }
113
+ /**
114
+ * @internal
115
+ * An active `frames()` consumer receives the error via the queue itself (thrown out of its
116
+ * `for await` loop, per that method's contract) rather than the `'error'` event, so `emit` is
117
+ * only used for an explicit external listener; with neither, it's logged instead of lost.
118
+ */
119
+ _handleError(err) {
120
+ const error = toTypedError(err);
121
+ this.queue.fail(error);
122
+ if (this.listenerCount('error') > 0) {
123
+ this.emit('error', error);
124
+ }
125
+ else if (this.activeConsumers === 0) {
126
+ log.error(`Unhandled JpegStream error: ${error.stack ?? error}`);
127
+ }
128
+ }
129
+ /** @internal */
130
+ _attachHandle(handle) {
131
+ this.handle = handle;
132
+ }
133
+ /**
134
+ * Yields each JPEG frame as it's produced, until {@link stop} is called or the stream errors (in
135
+ * which case the error is thrown out of the loop). Pass `signal` to stop iterating without
136
+ * treating that as an error.
137
+ *
138
+ * Only one active consumer is supported at a time — a second concurrent call rejects rather than
139
+ * silently sharing (and corrupting) the first one's single internal waiter slot.
140
+ */
141
+ async *frames(signal) {
142
+ if (this.activeConsumers > 0) {
143
+ throw new Error(SINGLE_CONSUMER_ERROR);
144
+ }
145
+ const combined = signal ? AbortSignal.any([signal, this.stopController.signal]) : this.stopController.signal;
146
+ this.activeConsumers++;
147
+ try {
148
+ for (;;) {
149
+ const result = await this.queue.next(combined);
150
+ if (result.done) {
151
+ return;
152
+ }
153
+ yield result.value;
154
+ }
155
+ }
156
+ finally {
157
+ this.activeConsumers--;
158
+ }
159
+ }
160
+ /** Stops the stream and releases the underlying encoder. Idempotent, including concurrently. */
161
+ async stop() {
162
+ this.stopPromise ??= (async () => {
163
+ this.stopController.abort();
164
+ this.queue.end();
165
+ await this.handle?.stop();
166
+ })();
167
+ return this.stopPromise;
168
+ }
169
+ }
170
+ /**
171
+ * Starts polling the device's display and JPEG-encoding each changed frame in real time. Resolves
172
+ * once the encoder has actually started; the returned {@link JpegStream}'s `frames()` then yields
173
+ * each frame as it arrives. Independent of `startVideoStream`/`startVideoRecording` — any number of
174
+ * concurrent streams/recordings can run on the same device at once.
175
+ *
176
+ * @param udid — UDID of the device to stream; must be booted
177
+ * @param options — `displayId`, `fps`, `quality`, `scale` — see {@link JpegStreamOptions}
178
+ */
179
+ export async function startJpegStream(udid, options = {}) {
180
+ // The native poller clamps below 1 fps to 1 fps rather than actually polling that slowly, so a
181
+ // sub-1 value here would silently poll far more often than requested — rejected instead.
182
+ if (options.fps !== undefined && (!Number.isFinite(options.fps) || options.fps < 1)) {
183
+ throw new RangeError(`fps must be a finite number >= 1, got ${options.fps}`);
184
+ }
185
+ if (options.quality !== undefined &&
186
+ (!Number.isFinite(options.quality) || options.quality < 0 || options.quality > 100)) {
187
+ throw new RangeError(`quality must be a number between 0 and 100, got ${options.quality}`);
188
+ }
189
+ if (options.scale !== undefined && (!Number.isFinite(options.scale) || options.scale <= 0 || options.scale > 100)) {
190
+ throw new RangeError(`scale must be a number greater than 0 and no greater than 100, got ${options.scale}`);
191
+ }
192
+ const device = await runCatchingAsync(() => this._findDevice(udid));
193
+ const stream = new JpegStream();
194
+ const handle = await runCatchingAsync(() => device.startJpegStream(options, (frame) => stream._handleFrame(frame), (err) => stream._handleError(err)));
195
+ stream._attachHandle(handle);
196
+ return stream;
197
+ }
198
+ //# sourceMappingURL=jpeg-stream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jpeg-stream.js","sourceRoot":"","sources":["../../../src/commands/jpeg-stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAC;AAIvC,OAAO,EAAC,gBAAgB,EAAE,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAQjE,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;AAExC,mGAAmG;AACnG,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAE/B,MAAM,qBAAqB,GACzB,qGAAqG,CAAC;AAExG;;;;;GAKG;AACH,MAAM,cAAc;IACD,MAAM,GAAgB,EAAE,CAAC;IAClC,MAAM,CAAqG;IAC3G,KAAK,GAAG,KAAK,CAAC;IACd,KAAK,CAAU;IAEvB,IAAI,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O,MAAM,CAAC;AAChB,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import type { NativeSimctl } from '../native-simctl.js';
2
- import type { VideoRecordingOptions } from '../types.js';
2
+ import type { StopVideoRecordingOptions, VideoRecordingOptions } from '../types.js';
3
3
  declare module '../native-simctl.js' {
4
4
  interface NativeSimctl {
5
5
  startVideoRecording(udid: string, outputFile: string, options?: VideoRecordingOptions): Promise<void>;
6
- stopVideoRecording(udid: string): Promise<void>;
6
+ stopVideoRecording(udid: string, options?: StopVideoRecordingOptions): Promise<void>;
7
7
  isVideoRecording(udid: string): Promise<boolean>;
8
8
  }
9
9
  }
@@ -43,10 +43,19 @@ export declare function startVideoRecording(this: NativeSimctl, udid: string, ou
43
43
  * device-lookup error — leaves the recording tracked as still active so a retry can reach the
44
44
  * native call rather than the caller losing the ability to stop it at all.
45
45
  *
46
+ * That retryability is a liability if nothing ever *does* retry — e.g. a best-effort teardown path
47
+ * that must not throw, so it logs a failed stop and moves on — since without `options.force` there
48
+ * is no other way to release the entry, permanently blocking a new `startVideoRecording` for this
49
+ * device. Pass `options.force: true` in that situation: it still attempts the native stop (so the
50
+ * encoder/file gets a chance to finalize cleanly) but releases the entry unconditionally afterward
51
+ * and never rejects, even if that attempt failed — understand that this can leave a native
52
+ * resource dangling if the stop genuinely never lands.
53
+ *
46
54
  * @param udid — UDID of the device to stop recording
55
+ * @param options — `force` (see above)
47
56
  * @throws {Error} if no recording is currently in progress for this device
48
57
  */
49
- export declare function stopVideoRecording(this: NativeSimctl, udid: string): Promise<void>;
58
+ export declare function stopVideoRecording(this: NativeSimctl, udid: string, options?: StopVideoRecordingOptions): Promise<void>;
50
59
  /**
51
60
  * Whether a recording started by {@link startVideoRecording} is currently active for this device.
52
61
  * Pure local state — no CoreSimulator dispatch — so this never rejects with a native error.
@@ -1 +1 @@
1
- {"version":3,"file":"video-recording.d.ts","sourceRoot":"","sources":["../../../src/commands/video-recording.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,Y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EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QACtG,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QACrF,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;KAClD;CACF;AAqBD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,IAAI,CAAC,CAqCf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,IAAI,CAAC,CAqCf;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEzF"}
@@ -75,10 +75,19 @@ export async function startVideoRecording(udid, outputFile, options = {}) {
75
75
  * device-lookup error — leaves the recording tracked as still active so a retry can reach the
76
76
  * native call rather than the caller losing the ability to stop it at all.
77
77
  *
78
+ * That retryability is a liability if nothing ever *does* retry — e.g. a best-effort teardown path
79
+ * that must not throw, so it logs a failed stop and moves on — since without `options.force` there
80
+ * is no other way to release the entry, permanently blocking a new `startVideoRecording` for this
81
+ * device. Pass `options.force: true` in that situation: it still attempts the native stop (so the
82
+ * encoder/file gets a chance to finalize cleanly) but releases the entry unconditionally afterward
83
+ * and never rejects, even if that attempt failed — understand that this can leave a native
84
+ * resource dangling if the stop genuinely never lands.
85
+ *
78
86
  * @param udid — UDID of the device to stop recording
87
+ * @param options — `force` (see above)
79
88
  * @throws {Error} if no recording is currently in progress for this device
80
89
  */
81
- export async function stopVideoRecording(udid) {
90
+ export async function stopVideoRecording(udid, options = {}) {
82
91
  const key = udid.toLowerCase();
83
92
  const state = activeRecordings.get(key);
84
93
  if (!state) {
@@ -99,13 +108,18 @@ export async function stopVideoRecording(udid) {
99
108
  await stopPromise;
100
109
  }
101
110
  catch (e) {
102
- // Only clear our own attempt, and only if it's still the current one — a future call must be
103
- // able to retry the native stop rather than replaying this same rejection forever, but must
104
- // not clobber a newer attempt another concurrent caller may have already started instead.
111
+ // Only clear our own attempt, and only if it's still the current one — a future (non-forced)
112
+ // call must be able to retry the native stop rather than replaying this same rejection
113
+ // forever, but must not clobber a newer attempt another concurrent caller may have already
114
+ // started instead.
105
115
  if (state.stop === stopPromise) {
106
116
  state.stop = undefined;
107
117
  }
108
- throw e;
118
+ if (!options.force) {
119
+ throw e;
120
+ }
121
+ log.warn(`Force-releasing video recording bookkeeping for device '${udid}' despite a failed native stop: ` +
122
+ `${toTypedError(e).stack ?? e}`);
109
123
  }
110
124
  if (activeRecordings.get(key) === state) {
111
125
  activeRecordings.delete(key);
@@ -1 +1 @@
1
- {"version":3,"file":"video-recording.js","sourceRoot":"","sources":["../../../src/commands/video-recording.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAC;AAIvC,OAAO,EAAC,gBAAgB,EAAE,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAUjE,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;AAexC,kGAAkG;AAClG,8EAA8E;AAC9E,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAA0B,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAEvC,IAAY,EACZ,UAAkB,EAClB,UAAiC,EAAE;IAEnC,6FAA6F;IAC7F,oFAAoF;IACpF,IAAI,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2DAA2D,IAAI,kCAAkC;YAC/F,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,EAAE,CAClC,CAAC;IACJ,CAAC;IACD,IAAI,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,KAAK,EAAE,CAAC;QACxC,gBAAgB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC/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"}
@@ -2,7 +2,8 @@ export { NativeSimError, NativeSimUnavailableError, NativeSimDispatchError, Nati
2
2
  export { NativeSimctl } from './native-simctl.js';
3
3
  export { SpawnedProcess } from './commands/spawn.js';
4
4
  export { VideoStream } from './commands/video-stream.js';
5
+ export { JpegStream } from './commands/jpeg-stream.js';
5
6
  export type { AppContainerType } from './commands/app.js';
6
7
  export type { BiometricName } from './commands/biometric.js';
7
- export { SimBootStatus, SimDeviceState, type ApnsAlert, type ApnsPayload, type ApnsSound, type PushNotificationPayload, type ScreenshotOptions, type SimBootInfo, type SimDeviceInfo, type SimDeviceTypeInfo, type SimDisplayInfo, type SimPermissionService, type SimPermissionStatus, type SimProcessInfo, type SimRuntimeInfo, type SpawnOptions, type VideoAccessUnit, type VideoRecordingOptions, type VideoStreamOptions, } from './types.js';
8
+ export { SimBootStatus, SimDeviceState, type ApnsAlert, type ApnsPayload, type ApnsSound, type JpegFrame, type JpegStreamOptions, type PushNotificationPayload, type ScreenshotOptions, type SimBootInfo, type SimDeviceInfo, type SimDeviceTypeInfo, type SimDisplayInfo, type SimPermissionService, type SimPermissionStatus, type SimProcessInfo, type SimRuntimeInfo, type SpawnOptions, type StopVideoRecordingOptions, type VideoAccessUnit, type VideoRecordingOptions, type VideoStreamOptions, } from './types.js';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,uBAAuB,EAAC,MAAM,aAAa,CAAC;AACvH,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AACvD,YAAY,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AACxD,YAAY,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,aAAa,EACb,cAAc,EACd,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,GACxB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,uBAAuB,EAAC,MAAM,aAAa,CAAC;AACvH,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAC,UAAU,EAAC,MAAM,2BAA2B,CAAC;AACrD,YAAY,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AACxD,YAAY,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,aAAa,EACb,cAAc,EACd,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC9B,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,GACxB,MAAM,YAAY,CAAC"}
package/lib/src/index.js CHANGED
@@ -2,5 +2,6 @@ export { NativeSimError, NativeSimUnavailableError, NativeSimDispatchError, Nati
2
2
  export { NativeSimctl } from './native-simctl.js';
3
3
  export { SpawnedProcess } from './commands/spawn.js';
4
4
  export { VideoStream } from './commands/video-stream.js';
5
+ export { JpegStream } from './commands/jpeg-stream.js';
5
6
  export { SimBootStatus, SimDeviceState, } from './types.js';
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,uBAAuB,EAAC,MAAM,aAAa,CAAC;AACvH,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AAGvD,OAAO,EACL,aAAa,EACb,cAAc,GAkBf,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,uBAAuB,EAAC,MAAM,aAAa,CAAC;AACvH,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAC,UAAU,EAAC,MAAM,2BAA2B,CAAC;AAGrD,OAAO,EACL,aAAa,EACb,cAAc,GAqBf,MAAM,YAAY,CAAC"}
@@ -2,6 +2,7 @@ import './commands/app.js';
2
2
  import './commands/biometric.js';
3
3
  import './commands/darwin-notification.js';
4
4
  import './commands/interaction.js';
5
+ import './commands/jpeg-stream.js';
5
6
  import './commands/keychain.js';
6
7
  import './commands/lifecycle.js';
7
8
  import './commands/media.js';
@@ -19,6 +20,7 @@ import './commands/app.js';
19
20
  import './commands/biometric.js';
20
21
  import './commands/darwin-notification.js';
21
22
  import './commands/interaction.js';
23
+ import './commands/jpeg-stream.js';
22
24
  import './commands/keychain.js';
23
25
  import './commands/lifecycle.js';
24
26
  import './commands/media.js';
@@ -1 +1 @@
1
- {"version":3,"file":"native-simctl.d.ts","sourceRoot":"","sources":["../../src/native-simctl.ts"],"names":[],"mappings":"AAKA,OASO,mBAAmB,CAAC;AAC3B,OAAuE,yBAAyB,CAAC;AACjG,OAIO,mCAAmC,CAAC;AAC3C,OAA4E,2BAA2B,CAAC;AACxG,OAAgE,wBAAwB,CAAC;AACzF,OAYO,yBAAyB,CAAC;AACjC,OAA2C,qBAAqB,CAAC;AACjE,OAAoB,oBAAoB,CAAC;AACzC,OAA2C,0BAA0B,CAAC;AACtE,OAAgF,2BAA2B,CAAC;AAC5G,OAAgD,uBAAuB,CAAC;AACxE,OAAyC,0BAA0B,CAAC;AACpE,OAA2B,qBAAqB,CAAC;AACjD,OAOO,kBAAkB,CAAC;AAC1B,OAAwE,+BAA+B,CAAC;AACxG,OAA+B,4BAA4B,CAAC;AA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AAC;AACxE,OAAyC,0BAA0B,CAAC;AACpE,OAA2B,qBAAqB,CAAC;AACjD,OAOO,kBAAkB,CAAC;AAC1B,OAAwE,+BAA+B,CAAC;AACxG,OAA+B,4BAA4B,CAAC;AAC5D,OAAoC,4BAA4B,CAAC;AAKjE,OAAO,mBAAmB,CAAC;AAC3B,OAAO,yBAAyB,CAAC;AACjC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,wBAAwB,CAAC;AAChC,OAAO,yBAAyB,CAAC;AACjC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,0BAA0B,CAAC;AAClC,OAAO,2BAA2B,CAAC;AACnC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,0BAA0B,CAAC;AAClC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,+BAA+B,CAAC;AACvC,OAAO,4BAA4B,CAAC;AACpC,OAAO,4BAA4B,CAAC;AAYpC;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,YAAY;IAYrB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;IAC9B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC;IAZjC,OAAO,CAAC,oBAAoB,CAAkD;IAE9E;;;;;;;OAOG;gBAEgB,YAAY,CAAC,EAAE,MAAM,YAAA,EACrB,aAAa,CAAC,EAAE,MAAM,YAAA;IAGzC,4FAA4F;WAC/E,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC;CAkDjD"}
@@ -5,6 +5,7 @@ import { appInfo, getAppContainer, installApp, installedApps, isAppInstalled, la
5
5
  import { enrollBiometric, isBiometricEnrolled, sendBiometricMatch } from './commands/biometric.js';
6
6
  import { getDarwinNotificationState, postDarwinNotification, setDarwinNotificationState, } from './commands/darwin-notification.js';
7
7
  import { clearLocation, getEnv, openUrl, pushNotification, setLocation } from './commands/interaction.js';
8
+ import { startJpegStream } from './commands/jpeg-stream.js';
8
9
  import { addCertificate, addRootCertificate, resetKeychain } from './commands/keychain.js';
9
10
  import { bootDevice, createDevice, deleteDevice, eraseDevice, getBootStatus, getDevices, getSupportedDeviceTypes, getSupportedRuntimes, shutdownAllDevices, shutdownDevice, waitForBoot, } from './commands/lifecycle.js';
10
11
  import { addMedia, addPhoto, addVideo } from './commands/media.js';
@@ -26,6 +27,7 @@ import './commands/app.js';
26
27
  import './commands/biometric.js';
27
28
  import './commands/darwin-notification.js';
28
29
  import './commands/interaction.js';
30
+ import './commands/jpeg-stream.js';
29
31
  import './commands/keychain.js';
30
32
  import './commands/lifecycle.js';
31
33
  import './commands/media.js';
@@ -191,6 +193,7 @@ Object.assign(NativeSimctl.prototype, {
191
193
  stopVideoRecording,
192
194
  isVideoRecording,
193
195
  startVideoStream,
196
+ startJpegStream,
194
197
  // webinspector
195
198
  getWebInspectorSocket,
196
199
  // spawn
@@ -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,EACL,0BAA0B,EAC1B,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAC,MAAM,2BAA2B,CAAC;AACxG,OAAO,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AAC;IACZ,CAAC;AACH,CAAC"}
@@ -144,6 +144,16 @@ export interface VideoRecordingOptions {
144
144
  /** Target average bitrate, in bits/sec. Respected on either implementation. */
145
145
  bitrate?: number;
146
146
  }
147
+ /** Options for `NativeSimctl.stopVideoRecording`. */
148
+ export interface StopVideoRecordingOptions {
149
+ /**
150
+ * Best-effort: still attempts the native stop, but releases this device's tracked-active-
151
+ * recording bookkeeping regardless of whether that attempt succeeds, instead of leaving it
152
+ * retryable — see the doc comment above `NativeSimctl.stopVideoRecording` for when a caller
153
+ * needs this over a plain retry.
154
+ */
155
+ force?: boolean;
156
+ }
147
157
  /** Options for `NativeSimctl.startVideoStream`. */
148
158
  export interface VideoStreamOptions {
149
159
  /**
@@ -155,10 +165,10 @@ export interface VideoStreamOptions {
155
165
  codec?: 'h264' | 'hevc';
156
166
  /**
157
167
  * Max frames/sec to poll the framebuffer at — an unchanged frame is never re-encoded, so this
158
- * is an upper bound, not a guarantee. Must be >= 1. Defaults to 15.
168
+ * is an upper bound, not a guarantee. Must be >= 1. Defaults to 60.
159
169
  */
160
170
  fps?: number;
161
- /** Target average bitrate, in bits/sec. Defaults to 2,000,000 (2 Mbps). */
171
+ /** Target average bitrate, in bits/sec. Defaults to 4,000,000 (4 Mbps). */
162
172
  bitrate?: number;
163
173
  /**
164
174
  * Also stream the device's audio, interleaved into the same `accessUnits()` sequence. Defaults
@@ -167,6 +177,42 @@ export interface VideoStreamOptions {
167
177
  */
168
178
  audio?: boolean;
169
179
  }
180
+ /** Options for `NativeSimctl.startJpegStream`. */
181
+ export interface JpegStreamOptions {
182
+ /**
183
+ * Which display to stream, by `id` from `getDisplays()`. Defaults to the primary display
184
+ * (falling back to the first renderable display if none is primary, e.g. tvOS).
185
+ */
186
+ displayId?: string;
187
+ /**
188
+ * Max frames/sec to poll the framebuffer at — an unchanged frame is never re-encoded, so this
189
+ * is an upper bound, not a guarantee. Must be >= 1. Defaults to 60.
190
+ */
191
+ fps?: number;
192
+ /**
193
+ * JPEG quality as a percentage (0 = smallest/most compressed, 100 = largest/least compressed).
194
+ * Defaults to 80 — noticeably smaller than {@link ScreenshotOptions.quality}'s own (near-
195
+ * lossless) default, more suitable for a continuous live stream than a one-off screenshot.
196
+ */
197
+ quality?: number;
198
+ /**
199
+ * Frame scale as a percentage of the original display resolution — 100 (default) performs no
200
+ * scaling; must be greater than 0 and no greater than 100.
201
+ */
202
+ scale?: number;
203
+ }
204
+ /**
205
+ * One JPEG-encoded frame from `JpegStream.frames()`. Unlike {@link VideoAccessUnit}, every frame
206
+ * is independently decodable — there's no keyframe/interframe distinction — so consumers (e.g. an
207
+ * MJPEG multipart HTTP stream built from this sequence) can start from, or drop, any frame freely.
208
+ */
209
+ export interface JpegFrame {
210
+ data: Buffer;
211
+ /** Monotonically increasing, starting at 0. */
212
+ sequence: number;
213
+ /** Microseconds since the stream started. */
214
+ timestampMicros: number;
215
+ }
170
216
  /**
171
217
  * One encoded unit from `VideoStream.accessUnits()`, discriminated by `track`: a video unit
172
218
  * (Annex-B NAL units — a keyframe's `data` has parameter sets, SPS/PPS or VPS/SPS/PPS for HEVC,
@@ -297,6 +343,17 @@ export interface NativeVideoStreamHandle {
297
343
  /** Forces the next encoded video frame to be a keyframe — trivial in-memory flag, so synchronous. */
298
344
  requestKeyFrame(): void;
299
345
  }
346
+ /** Raw shape of a JPEG frame as the native addon delivers it — see {@link JpegFrame}. */
347
+ export interface NativeJpegFrame {
348
+ data: Buffer;
349
+ sequence: number;
350
+ timestampMicros: number;
351
+ }
352
+ export type NativeJpegFrameCallback = (frame: NativeJpegFrame) => void;
353
+ /** A live `coresim::JpegStreamSession`, wrapped by `coresim.mm`'s `NativeJpegStream`. */
354
+ export interface NativeJpegStreamHandle {
355
+ stop(): Promise<void>;
356
+ }
300
357
  /**
301
358
  * A live recording, wrapped by `coresim.mm`'s `NativePrivateRecordingHandle` (video only,
302
359
  * addressing CoreSimulator's own internally-tracked private recorder) or `NativeAVRecording`
@@ -372,6 +429,12 @@ export interface NativeDeviceHandle {
372
429
  bitrate?: number;
373
430
  audio?: boolean;
374
431
  } | undefined, onAccessUnit: NativeVideoAccessUnitCallback, onError: NativeVideoErrorCallback): Promise<NativeVideoStreamHandle>;
432
+ startJpegStream(options: {
433
+ displayId?: string;
434
+ fps?: number;
435
+ quality?: number;
436
+ scale?: number;
437
+ } | undefined, onFrame: NativeJpegFrameCallback, onError: NativeVideoErrorCallback): Promise<NativeJpegStreamHandle>;
375
438
  spawn(path: string, options: SpawnOptions | undefined, onExit: NativeSpawnExitCallback): Promise<NativeSpawnResult>;
376
439
  }
377
440
  /** A `SimDeviceSet`, wrapped by `coresim.mm`'s `NativeDeviceSet`. */