Skip to content
Skills Library
Programming · Testing

hinge

/hinge

Control the hinge (fold) angle of a foldable iPhone Simulator such as iPhone Duo. Use when you need to fold, unfold, half-open, or animate the fold of a running simulator, read its current hinge angle, or test how an app reacts to hinge and display changes.

Repository
hinge ↗
Licence
MIT
Last repository change
26.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
3
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Control the hinge (fold) angle of a foldable iPhone Simulator such as iPhone Duo. Use when you need to fold, unfold, half-open, or animate the fold of a running simulator, read its current hinge angle, or test how an app reacts to hinge and display changes.

Original author description

Control the hinge (fold) angle of a foldable iPhone Simulator such as iPhone Duo. Use when you need to fold, unfold, half-open, or animate the fold of a running simulator, read its current hinge angle, or test how an app reacts to hinge and display changes.

How it works

  1. Commands
  2. Workflow
  3. Notes
Original SKILL.md headings · 49 lines, 694 words
SKILL.md preview
---
name: hinge
description: Control the hinge (fold) angle of a foldable iPhone Simulator such as iPhone Duo. Use when you need to fold, unfold, half-open, or animate the fold of a running simulator, read its current hinge angle, or test how an app reacts to hinge and display changes.
---

# hinge

Set and read the hinge angle of a booted foldable iPhone Simulator from the command line. It posts the same HID event as the hidden hinge slider in Xcode's Device Hub (hold Option).

Run the bundled script at `scripts/hinge`, relative to this skill's directory. A `hinge` on `PATH` works too when `hinge -v` prints the same version as `scripts/hinge -v`; an older install lacks `screenshot` and `--json`.

## Commands

```bash
scripts/hinge 120                # set angle: 0 = closed, 180 = flat
scripts/hinge open               # 180°
scripts/hinge close              # 0°
scripts/hinge half               # 90°
scripts/hinge sweep 180 0 2      # animate from 180° to 0° over 2 seconds
scripts/hinge get                # print current angle, e.g. 130.0
scripts/hinge posture            # angle, orientation, and which integrated display is active
scripts/hinge posture --json     # the same as JSON; also works with get, orientation, screenshot
scripts/hinge screenshot out.png # capture the display that hosts the UI
scripts/hinge rotate left        # rotate 90°, like Device Hub's Controls > Rotate Left; prints the new orientation
scripts/hinge rotate right
scripts/hinge orient landscape-left  # portrait, landscape-left, landscape-right, or portrait-upside-down
scripts/hinge orientation        # print current orientation, e.g. landscape-left
scripts/hinge -d "iPhone Duo" 90 # target a simulator by name or UDID (default: $HINGE_DEVICE, else the only booted iPhone Duo)
scripts/hinge -t 0 90            # set without waiting for the angle to be confirmed
```

`open`, `close` and `half` also accept `unfolded`/`flat`, `closed`/`folded` and `half-open`.

## Workflow

1. Make sure a foldable simulator is booted: `xcrun simctl list devices booted`. Without `-d`, `hinge` picks the only booted iPhone Duo; with several, it lists them and exits — pass `-d <udid>` or set `HINGE_DEVICE` instead of guessing.
2. Set the angle. The command returns once the simulator reports the new angle, so a non-zero exit means the fold did not happen — don't poll `get` to check it.
3. Wait for the display to switch before you screenshot or read the UI: it takes 1-2.5 s after the angle changes.
4. `scripts/hinge posture` tells which display hosts the UI (`active`) after a fold. Use `--json` when you parse it: `activeDisplay` names that display.
5. Take screenshots with `scripts/hinge screenshot out.png`. It captures the active display, so the wait in step 3 still applies. Plain `simctl io … screenshot` fails with `Invalid argument` on a foldable unless it gets `--display=LCD` (cover) or `--display=LCD-1` (inner).

## Notes

- Simulator only. It does not work on physical devices.
- The first run compiles a tiny helper with Xcode's clang, caching it under `~/.cache/hinge`. It takes a few seconds.
- A `sweep` runs at 60 Hz in one process. For a smooth animation, use it instead of many `set` calls. It does not confirm the final angle.
- Setting the angle is not the same as switching the display. The angle is confirmed; the display switch is up to the simulator. 0° and 180° usually switch it, angles in between depend on the path the hinge took (a slow `sweep` can keep the previous display until the end), and sometimes the simulator stops following the hinge altogether while still reporting new angles. Always check with `posture` instead of assuming; a simulator that stopped following the hinge keeps reporting correct angles, and a shutdown and boot clears it.
- Which display hosts the UI is `active`, not the backlight: a folded Duo lights its cover as `inactiveOn`, and the backlight lags a fold by up to 3 s.
- Angles outside 0-180 are rejected. A simulator without a hinge fails with "this simulator reports no hinge".
- `orient`, `orientation` and `rotate` use device orientations (the `devicectl` names), not interface orientations: a device in `landscape-right` shows a `landscape-left` interface.
- Orientation on a foldable follows only Device Hub's own event; `xcrun devicectl device orientation set` reports success there but is reverted. `rotate`/`orient` send Device Hub's event and fall back to `devicectl` on simulators that ignore it.
- This uses a private, undocumented protocol. It was verified with Xcode 27.1 and 27.2 on iOS 27.1 and may break in other versions. If setting an angle fails with "the hinge angle did not reach ...", report that the protocol has likely changed.
Files in this package (3)
  • SKILL.md 5 KB
  • scripts/hinge 14 KB
  • scripts/hinge_helper.m 8 KB

Versions

The database has no other skills named hinge.

Database snapshot: 13.11.2026 · package version 0ddfffdac8d1 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90iphone-duo-hinge-and-scenes
    Use the iPhone Duo hinge angle for interactions and effects, support Split View multitasking and multiple app scenes, and pair UI across both displays with scene accessories including CameraCaptureAccessory. Use when building fold-driven effects, multi-window support, or dual-display experiences.
  • 100iphone-duo-readiness
    Audit and port an iOS app to iPhone Duo, Apple's first foldable iPhone. Use when asked to support, adapt, prepare, test, or review an app for iPhone Duo, foldable iPhone, the inner/outer display, device poses, or the fold. Entry point that routes to the layout, bars,…
  • 100duo-test
    Test an iOS app on iPhone Duo without owning one: drive the iPhone Duo simulator through Xcode 27.1 Device Hub (Closed / Partially Open / Open, Option-drag hinge slider, Rotate), run Apple's audit checklist in every pose, capture per-display simulator screenshots at App Store…
  • 90iphone-duo-support
    Add or audit iPhone Duo (foldable inner and outer display) support in an iOS app, using the iOS 27.1 SDK in Xcode 27.1. Use when the user mentions iPhone Duo, the foldable iPhone, inner or outer display, hinge, reserved regions, ArrangementView, vertical toolbars on iPhone, or…
  • 100iphone-duo-displays
    Use iPhone Duo's hinge, two displays, two front cameras and multiple windows in SwiftUI and UIKit apps. Use when a developer asks about the hinge angle or fold state, onHingeChange or UIHingeInteraction, interactions driven by folding, Split View multitasking or the stacked…
  • 100duo-start
    Entry point for iPhone Duo, Apple's foldable with an outer display, an inner display and a fold; use it first when someone asks to get an app ready for iPhone Duo, make it work on the foldable or survive fold and unfold, or doesn't know which Duology skill to load. It detects…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.