@appium/coresim 1.13.2 → 1.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.14.1](https://github.com/appium/appium-ios/compare/@appium/coresim@1.14.0...@appium/coresim@1.14.1) (2026-11-06)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **coresim:** include the failure reason and underlying errors in operation errors ([#163](https://github.com/appium/appium-ios/issues/163)) ([0032a91](https://github.com/appium/appium-ios/commit/0032a918d11d6d883f2896b907b0fbca2a734353))
11
+
12
+
13
+ ## [1.14.0](https://github.com/appium/appium-ios/compare/@appium/coresim@1.13.2...@appium/coresim@1.14.0) (2026-10-24)
14
+
15
+ ### Features
16
+
17
+ * **coresim:** add host-side simulator HID and Duo controls ([#109](https://github.com/appium/appium-ios/issues/109)) ([15f1dd1](https://github.com/appium/appium-ios/commit/15f1dd164f15f243e4a88889964bc2b6b7d2adc9))
18
+
19
+
6
20
  ## [1.13.2](https://github.com/appium/appium-ios/compare/@appium/coresim@1.13.1...@appium/coresim@1.13.2) (2026-10-23)
7
21
 
8
22
  ### Miscellaneous Chores
package/binding.gyp CHANGED
@@ -11,6 +11,8 @@
11
11
  "src/native/sim_device_set.mm",
12
12
  "src/native/sim_device.mm",
13
13
  "src/native/sim_orientation.mm",
14
+ "src/native/sim_hid.mm",
15
+ "src/native/sim_duo.mm",
14
16
  "src/native/tcc_privacy.mm",
15
17
  "src/native/sim_pasteboard.mm",
16
18
  "src/native/sim_process.mm",
@@ -0,0 +1,43 @@
1
+ import type { NativeSimctl } from '../native-simctl.js';
2
+ import type { DeviceOrientation } from '../types.js';
3
+ declare module '../native-simctl.js' {
4
+ interface NativeSimctl {
5
+ isDuo(udid: string): Promise<boolean>;
6
+ setSimulatedHingeAngle(udid: string, angle: number): Promise<void>;
7
+ setHidOrientation(udid: string, orientation: DeviceOrientation, isMainDisplay: boolean): Promise<void>;
8
+ }
9
+ }
10
+ /**
11
+ * Identifies iPhone Duo by its CoreSimulator device type, without booting or sending events.
12
+ * Does not imply HID service availability or infer Duo from hinge/multiple-display support.
13
+ * @param udid - Target simulator identifier.
14
+ * @returns Whether the device type is iPhone Duo; false if its type is no longer installed.
15
+ */
16
+ export declare function isDuo(this: NativeSimctl, udid: string): Promise<boolean>;
17
+ /**
18
+ * Requests a simulated fold through the target simulator's CoreDevice HID service.
19
+ *
20
+ * Requires an iPhone Duo device type and a hinge-capable runtime. Runs in the Mac process using private XPC transport
21
+ * symbols; missing symbols or services produce an error. No guest helper or WDA entitlement
22
+ * is required. Completion confirms submission only: check hinge readings and wait for the
23
+ * expected application layout separately.
24
+ *
25
+ * @param udid - Target simulator identifier.
26
+ * @param angle - Finite hinge angle from 0 (closed) to 180 (fully open), inclusive.
27
+ */
28
+ export declare function setSimulatedHingeAngle(this: NativeSimctl, udid: string, angle: number): Promise<void>;
29
+ /**
30
+ * Sends Duo's vendor orientation control for the selected display through CoreDevice HID.
31
+ * The ordinary `setOrientation` API is unchanged.
32
+ *
33
+ * Runs in the Mac process using private XPC transport symbols; missing symbols or services
34
+ * produce an error. No guest helper or WDA entitlement is required.
35
+ * Completion confirms submission only; verify the app scene separately. This does not update
36
+ * XCTest's cached device orientation, which may remain unknown or retain an earlier value.
37
+ *
38
+ * @param udid - Target simulator identifier.
39
+ * @param orientation - CoreSimulator DeviceOrientation value; landscape numbering differs from UIDeviceOrientation.
40
+ * @param isMainDisplay - Whether the selected panel is the main display; controls the inner-panel orientation mapping.
41
+ */
42
+ export declare function setHidOrientation(this: NativeSimctl, udid: string, orientation: DeviceOrientation, isMainDisplay: boolean): Promise<void>;
43
+ //# sourceMappingURL=duo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duo.d.ts","sourceRoot":"","sources":["../../../src/commands/duo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,aAAa,CAAC;AAGnD,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,YAAY;QACpB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QACtC,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QACnE,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;KACxG;CACF;AAED;;;;;GAKG;AACH,wBAAsB,KAAK,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAE9E;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3G;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,iBAAiB,EAC9B,aAAa,EAAE,OAAO,GACrB,OAAO,CAAC,IAAI,CAAC,CAEf"}
@@ -0,0 +1,41 @@
1
+ import { runCatchingAsync } from '../utils/index.js';
2
+ /**
3
+ * Identifies iPhone Duo by its CoreSimulator device type, without booting or sending events.
4
+ * Does not imply HID service availability or infer Duo from hinge/multiple-display support.
5
+ * @param udid - Target simulator identifier.
6
+ * @returns Whether the device type is iPhone Duo; false if its type is no longer installed.
7
+ */
8
+ export async function isDuo(udid) {
9
+ return runCatchingAsync(async () => (await this._findDevice(udid)).isDuo());
10
+ }
11
+ /**
12
+ * Requests a simulated fold through the target simulator's CoreDevice HID service.
13
+ *
14
+ * Requires an iPhone Duo device type and a hinge-capable runtime. Runs in the Mac process using private XPC transport
15
+ * symbols; missing symbols or services produce an error. No guest helper or WDA entitlement
16
+ * is required. Completion confirms submission only: check hinge readings and wait for the
17
+ * expected application layout separately.
18
+ *
19
+ * @param udid - Target simulator identifier.
20
+ * @param angle - Finite hinge angle from 0 (closed) to 180 (fully open), inclusive.
21
+ */
22
+ export async function setSimulatedHingeAngle(udid, angle) {
23
+ return runCatchingAsync(async () => (await this._findDevice(udid)).setSimulatedHingeAngle(angle));
24
+ }
25
+ /**
26
+ * Sends Duo's vendor orientation control for the selected display through CoreDevice HID.
27
+ * The ordinary `setOrientation` API is unchanged.
28
+ *
29
+ * Runs in the Mac process using private XPC transport symbols; missing symbols or services
30
+ * produce an error. No guest helper or WDA entitlement is required.
31
+ * Completion confirms submission only; verify the app scene separately. This does not update
32
+ * XCTest's cached device orientation, which may remain unknown or retain an earlier value.
33
+ *
34
+ * @param udid - Target simulator identifier.
35
+ * @param orientation - CoreSimulator DeviceOrientation value; landscape numbering differs from UIDeviceOrientation.
36
+ * @param isMainDisplay - Whether the selected panel is the main display; controls the inner-panel orientation mapping.
37
+ */
38
+ export async function setHidOrientation(udid, orientation, isMainDisplay) {
39
+ return runCatchingAsync(async () => (await this._findDevice(udid)).setHidOrientation(orientation, isMainDisplay));
40
+ }
41
+ //# sourceMappingURL=duo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duo.js","sourceRoot":"","sources":["../../../src/commands/duo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AAUnD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,KAAK,CAAqB,IAAY;IAC1D,OAAO,gBAAgB,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;AAC9E,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAqB,IAAY,EAAE,KAAa;IAC1F,OAAO,gBAAgB,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;AACpG,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAErC,IAAY,EACZ,WAA8B,EAC9B,aAAsB;IAEtB,OAAO,gBAAgB,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC;AACpH,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { NativeSimctl } from '../native-simctl.js';
2
+ declare module '../native-simctl.js' {
3
+ interface NativeSimctl {
4
+ pressHidButton(udid: string, page: number, usage: number, duration?: number): Promise<void>;
5
+ }
6
+ }
7
+ /**
8
+ * Sends a paired button press/release through the target simulator's CoreDevice HID service.
9
+ *
10
+ * Runs in the Mac process using private XPC transport symbols; missing symbols or services
11
+ * produce an error. No guest helper or WDA entitlement is required.
12
+ * Completion confirms submission only. Check the resulting lock or application state separately.
13
+ *
14
+ * @param udid - Target simulator identifier.
15
+ * @param page - Unsigned 16-bit HID usage page (`kHIDPage_*` in the linked Apple header).
16
+ * @param usage - Unsigned 16-bit HID usage within the page (`kHIDUsage_*` in the linked Apple header).
17
+ * @param duration - Hold time in seconds, from 0 to 60 inclusive. Defaults to 0.1.
18
+ * @see https://github.com/apple-oss-distributions/IOHIDFamily/blob/main/IOHIDFamily/IOHIDUsageTables.h
19
+ */
20
+ export declare function pressHidButton(this: NativeSimctl, udid: string, page: number, usage: number, duration?: number): Promise<void>;
21
+ //# sourceMappingURL=hid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hid.d.ts","sourceRoot":"","sources":["../../../src/commands/hid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,qBAAqB,CAAC;AAGtD,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,YAAY;QACpB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;KAC7F;CACF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,QAAQ,SAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAEf"}
@@ -0,0 +1,18 @@
1
+ import { runCatchingAsync } from '../utils/index.js';
2
+ /**
3
+ * Sends a paired button press/release through the target simulator's CoreDevice HID service.
4
+ *
5
+ * Runs in the Mac process using private XPC transport symbols; missing symbols or services
6
+ * produce an error. No guest helper or WDA entitlement is required.
7
+ * Completion confirms submission only. Check the resulting lock or application state separately.
8
+ *
9
+ * @param udid - Target simulator identifier.
10
+ * @param page - Unsigned 16-bit HID usage page (`kHIDPage_*` in the linked Apple header).
11
+ * @param usage - Unsigned 16-bit HID usage within the page (`kHIDUsage_*` in the linked Apple header).
12
+ * @param duration - Hold time in seconds, from 0 to 60 inclusive. Defaults to 0.1.
13
+ * @see https://github.com/apple-oss-distributions/IOHIDFamily/blob/main/IOHIDFamily/IOHIDUsageTables.h
14
+ */
15
+ export async function pressHidButton(udid, page, usage, duration = 0.1) {
16
+ return runCatchingAsync(async () => (await this._findDevice(udid)).pressHidButton(page, usage, duration));
17
+ }
18
+ //# sourceMappingURL=hid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hid.js","sourceRoot":"","sources":["../../../src/commands/hid.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AAQnD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAElC,IAAY,EACZ,IAAY,EACZ,KAAa,EACb,QAAQ,GAAG,GAAG;IAEd,OAAO,gBAAgB,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC5G,CAAC"}
@@ -40,7 +40,7 @@ export declare class NativeSimOperationError extends NativeSimError {
40
40
  readonly code: number;
41
41
  name: string;
42
42
  /**
43
- * @param message — `NSError.localizedDescription`
43
+ * @param message — `NSError.localizedDescription`, followed by its failure reason and underlying errors
44
44
  * @param domain — `NSError.domain`
45
45
  * @param code — `NSError.code`
46
46
  */
package/lib/src/errors.js CHANGED
@@ -51,7 +51,7 @@ export class NativeSimOperationError extends NativeSimError {
51
51
  code;
52
52
  name = 'NativeSimOperationError';
53
53
  /**
54
- * @param message — `NSError.localizedDescription`
54
+ * @param message — `NSError.localizedDescription`, followed by its failure reason and underlying errors
55
55
  * @param domain — `NSError.domain`
56
56
  * @param code — `NSError.code`
57
57
  */
@@ -1,6 +1,8 @@
1
1
  import './commands/app.js';
2
2
  import './commands/biometric.js';
3
3
  import './commands/darwin-notification.js';
4
+ import './commands/duo.js';
5
+ import './commands/hid.js';
4
6
  import './commands/interaction.js';
5
7
  import './commands/jpeg-stream.js';
6
8
  import './commands/keychain.js';
@@ -19,6 +21,7 @@ import './commands/webinspector.js';
19
21
  import './commands/app.js';
20
22
  import './commands/biometric.js';
21
23
  import './commands/darwin-notification.js';
24
+ import './commands/hid.js';
22
25
  import './commands/interaction.js';
23
26
  import './commands/jpeg-stream.js';
24
27
  import './commands/keychain.js';
@@ -1 +1 @@
1
- {"version":3,"file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AO,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;AAKpC,MAAM,WAAW,mBAAmB;IAClC,wEAAwE;IACxE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3C;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,oBAAoB,CAAkD;IAK9E;;;;;;OAMG;gBACS,OAAO,CAAC,EAAE,mBAAmB;IACzC;;;;OAIG;gBACS,YAAY,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM;IAOzD,4FAA4F;WAC/E,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC;CAkDjD"}
@@ -4,6 +4,8 @@ import { util } from '@appium/support';
4
4
  import { appInfo, getAppContainer, installApp, installedApps, isAppInstalled, launchApp, removeApp, terminateApp, } from './commands/app.js';
5
5
  import { enrollBiometric, isBiometricEnrolled, sendBiometricMatch } from './commands/biometric.js';
6
6
  import { getDarwinNotificationState, postDarwinNotification, setDarwinNotificationState, } from './commands/darwin-notification.js';
7
+ import { isDuo, setSimulatedHingeAngle, setHidOrientation } from './commands/duo.js';
8
+ import { pressHidButton } from './commands/hid.js';
7
9
  import { clearLocation, getEnv, openUrl, pushNotification, setLocation } from './commands/interaction.js';
8
10
  import { startJpegStream } from './commands/jpeg-stream.js';
9
11
  import { addCertificate, addRootCertificate, resetKeychain } from './commands/keychain.js';
@@ -27,6 +29,7 @@ import { NativeSimUnavailableError } from './errors.js';
27
29
  import './commands/app.js';
28
30
  import './commands/biometric.js';
29
31
  import './commands/darwin-notification.js';
32
+ import './commands/hid.js';
30
33
  import './commands/interaction.js';
31
34
  import './commands/jpeg-stream.js';
32
35
  import './commands/keychain.js';
@@ -194,6 +197,12 @@ Object.assign(NativeSimctl.prototype, {
194
197
  getWebInspectorSocket,
195
198
  // spawn
196
199
  spawnProcess,
200
+ // To handle Duo specific features
201
+ isDuo,
202
+ setSimulatedHingeAngle,
203
+ setHidOrientation,
204
+ // General HID event sending
205
+ pressHidButton,
197
206
  });
198
207
  // Loaded lazily (not at module import time) so merely depending on/importing @appium/coresim —
199
208
  // e.g. for its error classes or types — works on any platform; only actually using it (booting a
@@ -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,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAC,cAAc,EAAE,kBAAkB,EAAE,aAAa,EAAC,MAAM,wBAAwB,CAAC;AACzF,OAAO,EACL,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,EACb,UAAU,EACV,uBAAuB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,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC,EAAE;YAC1C,QAAQ,EAAE,MAAM;YAChB,OAAO,EAAE,gCAAgC;SAC1C,CAAC,CAAC,IAAI,EAAE,CAAC;IACZ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,4FAA4F;QAC5F,sFAAsF;QACtF,iGAAiG;QACjG,IAAK,GAA6B,EAAE,IAAI,KAAK,QAAQ,EAAE,CAAC;YACtD,MAAM,IAAI,KAAK,CAAC,gFAAgF,EAAE;gBAChG,KAAK,EAAE,GAAG;aACX,CAAC,CAAC;QACL,CAAC;QACD,IAAK,GAA6B,EAAE,IAAI,KAAK,WAAW,EAAE,CAAC;YACzD,MAAM,IAAI,KAAK,CAAC,0CAA0C,gCAAgC,IAAI,EAAE,EAAC,KAAK,EAAE,GAAG,EAAC,CAAC,CAAC;QAChH,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -388,6 +388,10 @@ export interface NativeDeviceHandle {
388
388
  openUrl(url: string): Promise<void>;
389
389
  setLocation(latitude: number, longitude: number): Promise<void>;
390
390
  clearLocation(): Promise<void>;
391
+ isDuo(): Promise<boolean>;
392
+ pressHidButton(page: number, usage: number, duration: number): Promise<void>;
393
+ setSimulatedHingeAngle(angle: number): Promise<void>;
394
+ setHidOrientation(orientation: number, isMainDisplay: boolean): Promise<void>;
391
395
  setOrientation(orientation: number): Promise<void>;
392
396
  getOrientation(): Promise<number>;
393
397
  sendPushNotification(bundleId: string, payload: PushNotificationPayload): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,oBAAY,cAAc;IACxB,QAAQ,IAAI;IACZ,QAAQ,IAAI;IACZ,OAAO,IAAI;IACX,MAAM,IAAI;IACV,YAAY,IAAI;CACjB;AAED,kGAAkG;AAClG,oBAAY,iBAAiB;IAC3B,QAAQ,IAAI;IACZ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;CACzD;AAED,+EAA+E;AAC/E,MAAM,WAAW,0BAA0B;IACzC,gBAAgB,IAAI,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACnD,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAChE,oBAAoB,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC;IACrD,iBAAiB,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;CAChD;AAED,uHAAuH;AACvH,MAAM,WAAW,mBAAmB;IAClC,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAChF,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACpC;;;;;OAKG;IACH,mBAAmB,IAAI,IAAI,CAAC;CAC7B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appium/coresim",
3
- "version": "1.13.2",
3
+ "version": "1.14.1",
4
4
  "description": "Native bindings to CoreSimulator.framework for Apple platform simulator control",
5
5
  "bugs": {
6
6
  "url": "https://github.com/appium/appium-ios/issues"
@@ -62,5 +62,5 @@
62
62
  "npm": ">=10"
63
63
  },
64
64
  "gypfile": true,
65
- "gitHead": "81fb72dc3b3f23f23c804f1969f0c1eb19c8a7a2"
65
+ "gitHead": "90882926f5dd3e4d34a056312f05787d513d0fd5"
66
66
  }
@@ -0,0 +1,58 @@
1
+ import type {NativeSimctl} from '../native-simctl.js';
2
+ import type {DeviceOrientation} from '../types.js';
3
+ import {runCatchingAsync} from '../utils/index.js';
4
+
5
+ declare module '../native-simctl.js' {
6
+ interface NativeSimctl {
7
+ isDuo(udid: string): Promise<boolean>;
8
+ setSimulatedHingeAngle(udid: string, angle: number): Promise<void>;
9
+ setHidOrientation(udid: string, orientation: DeviceOrientation, isMainDisplay: boolean): Promise<void>;
10
+ }
11
+ }
12
+
13
+ /**
14
+ * Identifies iPhone Duo by its CoreSimulator device type, without booting or sending events.
15
+ * Does not imply HID service availability or infer Duo from hinge/multiple-display support.
16
+ * @param udid - Target simulator identifier.
17
+ * @returns Whether the device type is iPhone Duo; false if its type is no longer installed.
18
+ */
19
+ export async function isDuo(this: NativeSimctl, udid: string): Promise<boolean> {
20
+ return runCatchingAsync(async () => (await this._findDevice(udid)).isDuo());
21
+ }
22
+
23
+ /**
24
+ * Requests a simulated fold through the target simulator's CoreDevice HID service.
25
+ *
26
+ * Requires an iPhone Duo device type and a hinge-capable runtime. Runs in the Mac process using private XPC transport
27
+ * symbols; missing symbols or services produce an error. No guest helper or WDA entitlement
28
+ * is required. Completion confirms submission only: check hinge readings and wait for the
29
+ * expected application layout separately.
30
+ *
31
+ * @param udid - Target simulator identifier.
32
+ * @param angle - Finite hinge angle from 0 (closed) to 180 (fully open), inclusive.
33
+ */
34
+ export async function setSimulatedHingeAngle(this: NativeSimctl, udid: string, angle: number): Promise<void> {
35
+ return runCatchingAsync(async () => (await this._findDevice(udid)).setSimulatedHingeAngle(angle));
36
+ }
37
+
38
+ /**
39
+ * Sends Duo's vendor orientation control for the selected display through CoreDevice HID.
40
+ * The ordinary `setOrientation` API is unchanged.
41
+ *
42
+ * Runs in the Mac process using private XPC transport symbols; missing symbols or services
43
+ * produce an error. No guest helper or WDA entitlement is required.
44
+ * Completion confirms submission only; verify the app scene separately. This does not update
45
+ * XCTest's cached device orientation, which may remain unknown or retain an earlier value.
46
+ *
47
+ * @param udid - Target simulator identifier.
48
+ * @param orientation - CoreSimulator DeviceOrientation value; landscape numbering differs from UIDeviceOrientation.
49
+ * @param isMainDisplay - Whether the selected panel is the main display; controls the inner-panel orientation mapping.
50
+ */
51
+ export async function setHidOrientation(
52
+ this: NativeSimctl,
53
+ udid: string,
54
+ orientation: DeviceOrientation,
55
+ isMainDisplay: boolean,
56
+ ): Promise<void> {
57
+ return runCatchingAsync(async () => (await this._findDevice(udid)).setHidOrientation(orientation, isMainDisplay));
58
+ }
@@ -0,0 +1,31 @@
1
+ import type {NativeSimctl} from '../native-simctl.js';
2
+ import {runCatchingAsync} from '../utils/index.js';
3
+
4
+ declare module '../native-simctl.js' {
5
+ interface NativeSimctl {
6
+ pressHidButton(udid: string, page: number, usage: number, duration?: number): Promise<void>;
7
+ }
8
+ }
9
+
10
+ /**
11
+ * Sends a paired button press/release through the target simulator's CoreDevice HID service.
12
+ *
13
+ * Runs in the Mac process using private XPC transport symbols; missing symbols or services
14
+ * produce an error. No guest helper or WDA entitlement is required.
15
+ * Completion confirms submission only. Check the resulting lock or application state separately.
16
+ *
17
+ * @param udid - Target simulator identifier.
18
+ * @param page - Unsigned 16-bit HID usage page (`kHIDPage_*` in the linked Apple header).
19
+ * @param usage - Unsigned 16-bit HID usage within the page (`kHIDUsage_*` in the linked Apple header).
20
+ * @param duration - Hold time in seconds, from 0 to 60 inclusive. Defaults to 0.1.
21
+ * @see https://github.com/apple-oss-distributions/IOHIDFamily/blob/main/IOHIDFamily/IOHIDUsageTables.h
22
+ */
23
+ export async function pressHidButton(
24
+ this: NativeSimctl,
25
+ udid: string,
26
+ page: number,
27
+ usage: number,
28
+ duration = 0.1,
29
+ ): Promise<void> {
30
+ return runCatchingAsync(async () => (await this._findDevice(udid)).pressHidButton(page, usage, duration));
31
+ }
package/src/coresim.mm CHANGED
@@ -18,6 +18,7 @@
18
18
 
19
19
  #include <algorithm>
20
20
  #include <cerrno>
21
+ #include <cmath>
21
22
  #include <cstring>
22
23
  #include <mutex>
23
24
  #include <stdexcept>
@@ -31,6 +32,8 @@
31
32
  #include "native/objc_runtime.h"
32
33
  #include "native/sim_device.h"
33
34
  #include "native/sim_device_set.h"
35
+ #include "native/sim_duo.h"
36
+ #include "native/sim_hid.h"
34
37
  #include "native/sim_jpeg_stream.h"
35
38
  #include "native/sim_orientation.h"
36
39
  #include "native/sim_pasteboard.h"
@@ -64,6 +67,19 @@ NSDictionary* OptionsArg(const Napi::CallbackInfo& info, size_t index) {
64
67
  return (NSDictionary*)JsValueToNSObject(info.Env(), info[index]);
65
68
  }
66
69
 
70
+ // Validate before integer conversion: N-API's Uint32Value/Int32Value would truncate or wrap.
71
+ double HIDNumberArg(const Napi::CallbackInfo& info, size_t index, const char* name, double min, double max,
72
+ bool integer = false) {
73
+ if (index >= info.Length() || !info[index].IsNumber()) {
74
+ throw Napi::TypeError::New(info.Env(), std::string(name) + " must be a number");
75
+ }
76
+ double value = info[index].As<Napi::Number>().DoubleValue();
77
+ if (!std::isfinite(value) || value < min || value > max || (integer && std::trunc(value) != value)) {
78
+ throw Napi::TypeError::New(info.Env(), std::string(name) + " is outside the supported range");
79
+ }
80
+ return value;
81
+ }
82
+
67
83
  // Throws if `!ok && error`, for the common BOOL-returning NSError**-out-param shape — called from
68
84
  // inside a RunAsync/RunAsyncVoid work lambda (background thread), never from the main thread.
69
85
  void ThrowIfFailed(BOOL ok, NSError* error) {
@@ -814,6 +830,36 @@ class NativeDevice : public Napi::ObjectWrap<NativeDevice> {
814
830
  });
815
831
  }
816
832
 
833
+ Napi::Value PressHIDButton(const Napi::CallbackInfo& info) {
834
+ id device = device_;
835
+ uint32_t page = static_cast<uint32_t>(HIDNumberArg(info, 0, "page", 0, 65535, true));
836
+ uint32_t usage = static_cast<uint32_t>(HIDNumberArg(info, 1, "usage", 0, 65535, true));
837
+ double duration = HIDNumberArg(info, 2, "duration", 0, 60);
838
+ return RunAsyncVoid(info.Env(),
839
+ [device, page, usage, duration]() { coresim::PressHIDButton(device, page, usage, duration); });
840
+ }
841
+ Napi::Value SetSimulatedHingeAngle(const Napi::CallbackInfo& info) {
842
+ id device = device_;
843
+ double angle = HIDNumberArg(info, 0, "angle", 0, 180);
844
+ return RunAsyncVoid(info.Env(), [device, angle]() { coresim::SetSimulatedHingeAngle(device, angle); });
845
+ }
846
+ Napi::Value SetHIDOrientation(const Napi::CallbackInfo& info) {
847
+ id device = device_;
848
+ int32_t orientation = static_cast<int32_t>(HIDNumberArg(info, 0, "orientation", 1, 4, true));
849
+ if (info.Length() < 2 || !info[1].IsBoolean()) {
850
+ throw Napi::TypeError::New(info.Env(), "isMainDisplay must be a boolean");
851
+ }
852
+ bool isMainDisplay = info[1].As<Napi::Boolean>().Value();
853
+ return RunAsyncVoid(info.Env(), [device, orientation, isMainDisplay]() {
854
+ coresim::SetHIDOrientation(device, orientation, isMainDisplay);
855
+ });
856
+ }
857
+ Napi::Value IsDuo(const Napi::CallbackInfo& info) {
858
+ id device = device_;
859
+ return RunAsync<bool>(
860
+ info.Env(), [device]() { return coresim::IsDuoDevice(device); },
861
+ [](Napi::Env env, bool result) -> Napi::Value { return Napi::Boolean::New(env, result); });
862
+ }
817
863
  Napi::Value SetOrientation(const Napi::CallbackInfo& info) {
818
864
  id device = device_;
819
865
  int32_t orientation = info[0].As<Napi::Number>().Int32Value();
@@ -1747,6 +1793,10 @@ void NativeDevice::Init(Napi::Env env) {
1747
1793
  InstanceMethod<&NativeDevice::SetLocation>("setLocation"),
1748
1794
  InstanceMethod<&NativeDevice::ClearLocation>("clearLocation"),
1749
1795
  InstanceMethod<&NativeDevice::SetOrientation>("setOrientation"),
1796
+ InstanceMethod<&NativeDevice::PressHIDButton>("pressHidButton"),
1797
+ InstanceMethod<&NativeDevice::IsDuo>("isDuo"),
1798
+ InstanceMethod<&NativeDevice::SetSimulatedHingeAngle>("setSimulatedHingeAngle"),
1799
+ InstanceMethod<&NativeDevice::SetHIDOrientation>("setHidOrientation"),
1750
1800
  InstanceMethod<&NativeDevice::SendPushNotification>("sendPushNotification"),
1751
1801
  InstanceMethod<&NativeDevice::AddCertificate>("addCertificate"),
1752
1802
  InstanceMethod<&NativeDevice::ResetKeychain>("resetKeychain"),
package/src/errors.ts CHANGED
@@ -55,7 +55,7 @@ export class NativeSimOperationError extends NativeSimError {
55
55
  public override name = 'NativeSimOperationError';
56
56
 
57
57
  /**
58
- * @param message — `NSError.localizedDescription`
58
+ * @param message — `NSError.localizedDescription`, followed by its failure reason and underlying errors
59
59
  * @param domain — `NSError.domain`
60
60
  * @param code — `NSError.code`
61
61
  */
@@ -11,6 +11,10 @@
11
11
 
12
12
  namespace coresim {
13
13
 
14
+ // localizedDescription is often generic ("Simulator device failed to install the application."), so
15
+ // the failure reason and the NSUnderlyingErrorKey chain are appended.
16
+ std::string DescribeNSError(NSError* error);
17
+
14
18
  // Thrown by async work lambdas (see async_bridge.h) when a native call fails via an NSError**
15
19
  // out-param rather than raising. domain/code/message are captured immediately at throw time
16
20
  // (never the NSError* itself), since this only ever needs to survive within the same background
@@ -18,7 +22,7 @@ namespace coresim {
18
22
  class NSErrorException : public std::runtime_error {
19
23
  public:
20
24
  explicit NSErrorException(NSError* error)
21
- : std::runtime_error(error.localizedDescription ? error.localizedDescription.UTF8String : "Operation failed"),
25
+ : std::runtime_error(DescribeNSError(error)),
22
26
  domain(error.domain ? error.domain.UTF8String : ""),
23
27
  code(error.code) {}
24
28
 
@@ -2,6 +2,36 @@
2
2
 
3
3
  namespace coresim {
4
4
 
5
+ std::string DescribeNSError(NSError* error) {
6
+ constexpr NSUInteger kMaxErrorDepth = 10;
7
+ NSMutableArray<NSString*>* parts = [NSMutableArray array];
8
+ NSError* current = error;
9
+ for (NSUInteger depth = 0; current != nil && depth < kMaxErrorDepth; ++depth) {
10
+ for (NSString* text in @[ current.localizedDescription ?: @"", current.localizedFailureReason ?: @"" ]) {
11
+ NSString* trimmed = [text stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceAndNewlineCharacterSet];
12
+ NSUInteger known = [parts indexOfObjectPassingTest:^BOOL(NSString* part, NSUInteger, BOOL*) {
13
+ return [part containsString:trimmed];
14
+ }];
15
+ if (trimmed.length == 0 || known != NSNotFound) {
16
+ continue;
17
+ }
18
+ NSIndexSet* covered = [parts indexesOfObjectsPassingTest:^BOOL(NSString* part, NSUInteger, BOOL*) {
19
+ return [trimmed containsString:part];
20
+ }];
21
+ [parts removeObjectsAtIndexes:covered];
22
+ [parts addObject:trimmed];
23
+ }
24
+ id underlying = current.userInfo[NSUnderlyingErrorKey];
25
+ current = [underlying isKindOfClass:NSError.class] ? underlying : nil;
26
+ }
27
+ NSMutableArray<NSString*>* sentences = [NSMutableArray arrayWithCapacity:parts.count];
28
+ for (NSString* part in parts) {
29
+ BOOL terminated = [part hasSuffix:@"."] || [part hasSuffix:@"!"] || [part hasSuffix:@"?"];
30
+ [sentences addObject:terminated ? part : [part stringByAppendingString:@"."]];
31
+ }
32
+ return sentences.count > 0 ? [sentences componentsJoinedByString:@" "].UTF8String : "Operation failed";
33
+ }
34
+
5
35
  Napi::Error NSErrorExceptionToJsError(Napi::Env env, const NSErrorException& error) {
6
36
  Napi::Error jsError = Napi::Error::New(env, error.what());
7
37
  jsError.Set("name", "NativeSimOperationError");
@@ -0,0 +1,9 @@
1
+ #pragma once
2
+ #import <Foundation/Foundation.h>
3
+
4
+ #include <cstdint>
5
+ namespace coresim {
6
+ bool IsDuoDevice(id device);
7
+ void SetSimulatedHingeAngle(id device, double angle);
8
+ void SetHIDOrientation(id device, int32_t orientation, bool isMainDisplay);
9
+ } // namespace coresim
@@ -0,0 +1,65 @@
1
+ #include "sim_duo.h"
2
+ #import <dlfcn.h>
3
+ #include "nserror_bridge.h"
4
+ #include "objc_runtime.h"
5
+ #include "sim_device.h"
6
+ #include "sim_hid.h"
7
+ #include "sim_service_context.h"
8
+ namespace coresim {
9
+ namespace {
10
+ NSError* HIDError(NSString* message) {
11
+ return [NSError errorWithDomain:@"io.appium.coresim.Duo" code:1 userInfo:@{NSLocalizedDescriptionKey : message}];
12
+ }
13
+ void SendVendorControl(id device, NSString* source, NSString* type, id value) {
14
+ if (!IsDuoDevice(device)) {
15
+ throw NativeSimUnavailableError("deviceType", "iPhone-Duo", "This control requires an iPhone Duo simulator");
16
+ }
17
+ // IOCF binary serialization (option 1), not a binary property list. Preserve
18
+ // the payload verified by the former WDA implementation on Duo / iOS 27.1.
19
+ static void* iokit = dlopen("/System/Library/Frameworks/IOKit.framework/IOKit", RTLD_LAZY | RTLD_GLOBAL);
20
+ if (!iokit) throw NativeSimUnavailableError("framework", "IOKit", "Cannot load IOKit");
21
+ auto serialize = reinterpret_cast<CFDataRef (*)(CFTypeRef, CFOptionFlags)>(dlsym(iokit, "IOCFSerialize"));
22
+ if (!serialize) throw NativeSimUnavailableError("symbol", "IOCFSerialize", "Cannot serialize Duo HID control");
23
+ NSDictionary* control = @{
24
+ @"provider" : @"com.apple.Virtualization.VirtualMachines",
25
+ @"source" : source,
26
+ @"type" : type,
27
+ @"value" : value
28
+ };
29
+ CFDataRef data = serialize((__bridge CFTypeRef)control, 1);
30
+ if (!data) throw NSErrorException(HIDError(@"Cannot serialize simulator HID control"));
31
+ SendVendorHIDEvent(device, 0xff61, 0x5b, 0, CFBridgingRelease(data));
32
+ }
33
+ } // namespace
34
+
35
+ bool IsDuoDevice(id device) {
36
+ id type = DeviceDeviceType(device);
37
+ return type != nil &&
38
+ [DeviceTypeIdentifier(type) isEqualToString:@"com.apple.CoreSimulator.SimDeviceType.iPhone-Duo"];
39
+ }
40
+ void SetSimulatedHingeAngle(id device, double angle) {
41
+ SendVendorControl(device, @"hinge-slider-control", @"range", @(angle));
42
+ }
43
+ void SetHIDOrientation(id device, int32_t orientation, bool isMainDisplay) {
44
+ NSString* value;
45
+ switch (orientation) {
46
+ case 1:
47
+ value = isMainDisplay ? @"portrait" : @"landscape-left";
48
+ break;
49
+ case 2:
50
+ value = isMainDisplay ? @"pud" : @"landscape-right";
51
+ break;
52
+ // CoreSimulator DeviceOrientation uses UIInterfaceOrientation numbering:
53
+ // landscape-right is 3, landscape-left is 4 (the reverse of UIDeviceOrientation).
54
+ case 3:
55
+ value = isMainDisplay ? @"landscape-right" : @"portrait";
56
+ break;
57
+ case 4:
58
+ value = isMainDisplay ? @"landscape-left" : @"pud";
59
+ break;
60
+ default:
61
+ throw NSErrorException(HIDError(@"Unsupported interface orientation"));
62
+ }
63
+ SendVendorControl(device, @"orientation-picker-control", @"enum", value);
64
+ }
65
+ } // namespace coresim
@@ -0,0 +1,8 @@
1
+ #pragma once
2
+ #import <Foundation/Foundation.h>
3
+ #include <cstdint>
4
+ namespace coresim {
5
+ // Generic simulator HID transport. Availability depends on host symbols and guest services.
6
+ void PressHIDButton(id device, uint32_t page, uint32_t usage, double duration);
7
+ void SendVendorHIDEvent(id device, uint32_t page, uint32_t usage, uint64_t version, NSData* data);
8
+ } // namespace coresim
@@ -0,0 +1,116 @@
1
+ #include "sim_hid.h"
2
+
3
+ #import <dlfcn.h>
4
+ #import <mach/mach.h>
5
+ #import <xpc/xpc.h>
6
+ #include <memory>
7
+ #include <mutex>
8
+ #include "nserror_bridge.h"
9
+ #include "objc_runtime.h"
10
+ #include "sim_device.h"
11
+
12
+ namespace coresim {
13
+ namespace {
14
+ NSError* HIDError(NSString* message) {
15
+ return [NSError errorWithDomain:@"io.appium.coresim.HID" code:1 userInfo:@{NSLocalizedDescriptionKey : message}];
16
+ }
17
+
18
+ template <typename T>
19
+ T Resolve(const char* name) {
20
+ auto symbol = reinterpret_cast<T>(dlsym(RTLD_DEFAULT, name));
21
+ if (!symbol) throw NativeSimUnavailableError("symbol", name, "Simulator HID transport is unavailable");
22
+ return symbol;
23
+ }
24
+
25
+ // dtuhidd exposes the same button/vendor services used by Xcode's device controls.
26
+ // Resolve the Mach port in the target simulator, never in the host's namespace.
27
+ // These events are one-way: a send barrier confirms transport submission only.
28
+ class HIDConnection {
29
+ public:
30
+ explicit HIDConnection(id device, NSString* service) : state_(std::make_shared<State>()) {
31
+ auto endpointFromPort = Resolve<xpc_endpoint_t (*)(mach_port_t)>("xpc_endpoint_create_mach_port_4sim");
32
+ auto enableSimulator = Resolve<void (*)(xpc_connection_t)>("xpc_connection_enable_sim2host_4sim");
33
+ NSError* error = nil;
34
+ mach_port_t port = LookupMachPort(device, service, &error);
35
+ if (port == MACH_PORT_NULL) throw NSErrorException(error ?: HIDError(@"Simulator HID service is unavailable"));
36
+ xpc_endpoint_t endpoint = endpointFromPort(port);
37
+ mach_port_deallocate(mach_task_self(), port);
38
+ if (!endpoint) throw NSErrorException(HIDError(@"Cannot create simulator HID endpoint"));
39
+ connection_ = xpc_connection_create_from_endpoint(endpoint);
40
+ if (!connection_) throw NSErrorException(HIDError(@"Cannot create simulator HID connection"));
41
+ enableSimulator(connection_);
42
+ auto state = state_;
43
+ xpc_connection_set_event_handler(connection_, ^(xpc_object_t event) {
44
+ if (xpc_get_type(event) != XPC_TYPE_ERROR) return;
45
+ std::lock_guard<std::mutex> lock(state->mutex);
46
+ const char* description = xpc_dictionary_get_string(event, XPC_ERROR_KEY_DESCRIPTION);
47
+ state->error = HIDError(description ? @(description) : @"Simulator HID connection failed");
48
+ });
49
+ xpc_connection_resume(connection_);
50
+ }
51
+ ~HIDConnection() { xpc_connection_cancel(connection_); }
52
+ void Send(NSString* type, NSString* service, xpc_object_t payload) {
53
+ xpc_object_t message = xpc_dictionary_create(nullptr, nullptr, 0);
54
+ xpc_dictionary_set_string(message, "messageType", type.UTF8String);
55
+ xpc_dictionary_set_string(message, "featureIdentifier", service.UTF8String);
56
+ xpc_dictionary_set_value(message, "payload", payload);
57
+ xpc_connection_send_message(connection_, message);
58
+ }
59
+ void Flush() {
60
+ dispatch_semaphore_t sent = dispatch_semaphore_create(0);
61
+ xpc_connection_send_barrier(connection_, ^{
62
+ dispatch_semaphore_signal(sent);
63
+ });
64
+ if (dispatch_semaphore_wait(sent, dispatch_time(DISPATCH_TIME_NOW, 5 * NSEC_PER_SEC))) {
65
+ throw NSErrorException(HIDError(@"Timed out submitting simulator HID events"));
66
+ }
67
+ }
68
+ void Finish() {
69
+ Flush();
70
+ // The service queues events until its virtual HID device opens. Retain the
71
+ // connection briefly after submission, as the CoreDevice HID client does.
72
+ [NSThread sleepForTimeInterval:0.1];
73
+ std::lock_guard<std::mutex> lock(state_->mutex);
74
+ if (state_->error) throw NSErrorException(state_->error);
75
+ }
76
+
77
+ private:
78
+ struct State {
79
+ std::mutex mutex;
80
+ NSError* error = nil;
81
+ };
82
+ std::shared_ptr<State> state_;
83
+ xpc_connection_t connection_;
84
+ };
85
+
86
+ } // namespace
87
+
88
+ void SendVendorHIDEvent(id device, uint32_t page, uint32_t usage, uint64_t version, NSData* data) {
89
+ xpc_object_t payload = xpc_dictionary_create(nullptr, nullptr, 0);
90
+ xpc_dictionary_set_uint64(payload, "usagePage", page);
91
+ xpc_dictionary_set_uint64(payload, "usage", usage);
92
+ xpc_dictionary_set_uint64(payload, "version", version);
93
+ xpc_dictionary_set_data(payload, "data", data.bytes, data.length);
94
+ NSString* service = @"com.apple.coredevice.feature.remote.hid.vendordefined";
95
+ HIDConnection connection(device, service);
96
+ connection.Send(@"IndigoVendorDefinedEvent", service, payload);
97
+ connection.Finish();
98
+ }
99
+ void PressHIDButton(id device, uint32_t page, uint32_t usage, double duration) {
100
+ NSString* service = @"com.apple.coredevice.feature.remote.hid.button";
101
+ HIDConnection connection(device, service);
102
+ for (uint64_t state : {1ULL, 2ULL}) {
103
+ xpc_object_t payload = xpc_dictionary_create(nullptr, nullptr, 0);
104
+ xpc_dictionary_set_uint64(payload, "usagePage", page);
105
+ xpc_dictionary_set_uint64(payload, "usageCode", usage);
106
+ xpc_dictionary_set_uint64(payload, "state", state);
107
+ connection.Send(@"IndigoButtonEvent", service, payload);
108
+ if (state == 1) {
109
+ // Start the hold interval only after XPC has submitted the down event.
110
+ connection.Flush();
111
+ [NSThread sleepForTimeInterval:duration];
112
+ }
113
+ }
114
+ connection.Finish();
115
+ }
116
+ } // namespace coresim
@@ -19,6 +19,8 @@ import {
19
19
  postDarwinNotification,
20
20
  setDarwinNotificationState,
21
21
  } from './commands/darwin-notification.js';
22
+ import {isDuo, setSimulatedHingeAngle, setHidOrientation} from './commands/duo.js';
23
+ import {pressHidButton} from './commands/hid.js';
22
24
  import {clearLocation, getEnv, openUrl, pushNotification, setLocation} from './commands/interaction.js';
23
25
  import {startJpegStream} from './commands/jpeg-stream.js';
24
26
  import {addCertificate, addRootCertificate, resetKeychain} from './commands/keychain.js';
@@ -70,6 +72,7 @@ import type {
70
72
  import './commands/app.js';
71
73
  import './commands/biometric.js';
72
74
  import './commands/darwin-notification.js';
75
+ import './commands/hid.js';
73
76
  import './commands/interaction.js';
74
77
  import './commands/jpeg-stream.js';
75
78
  import './commands/keychain.js';
@@ -297,6 +300,14 @@ Object.assign(NativeSimctl.prototype, {
297
300
 
298
301
  // spawn
299
302
  spawnProcess,
303
+
304
+ // To handle Duo specific features
305
+ isDuo,
306
+ setSimulatedHingeAngle,
307
+ setHidOrientation,
308
+
309
+ // General HID event sending
310
+ pressHidButton,
300
311
  });
301
312
 
302
313
  // Loaded lazily (not at module import time) so merely depending on/importing @appium/coresim —
package/src/types.ts CHANGED
@@ -442,6 +442,10 @@ export interface NativeDeviceHandle {
442
442
  openUrl(url: string): Promise<void>;
443
443
  setLocation(latitude: number, longitude: number): Promise<void>;
444
444
  clearLocation(): Promise<void>;
445
+ isDuo(): Promise<boolean>;
446
+ pressHidButton(page: number, usage: number, duration: number): Promise<void>;
447
+ setSimulatedHingeAngle(angle: number): Promise<void>;
448
+ setHidOrientation(orientation: number, isMainDisplay: boolean): Promise<void>;
445
449
  setOrientation(orientation: number): Promise<void>;
446
450
  getOrientation(): Promise<number>;
447
451
  sendPushNotification(bundleId: string, payload: PushNotificationPayload): Promise<void>;