hinge

An Agent Skill and CLI that folds, unfolds and rotates the iPhone Duo Simulator. It confirms the hinge angle, names the active display and screenshots the display showing the UI.

View on GitHub ↗
Stars
★ 43
Last commit
4 Nov 2026
Maintenance
Active
Licence
MIT
Category
Agent Skills
GitHub
artemnovichkov/hinge

Overview

hinge lets coding agents such as Claude Code and Codex fold the iPhone Duo Simulator while they build and check an app. Xcode's Device Hub has a hinge slider, but nothing scriptable can fold the device, so an agent has no way to test the inner display. Worse, the closest tools exit 0 and change nothing, so an agent carries on as if they worked.

hinge waits until CoreMotion reports the angle before it succeeds, names which display is active with hinge posture, and captures that display with hinge screenshot, because plain simctl io screenshot fails with Invalid argument on a foldable unless you name the display.

hinge is licensed under the MIT licence.

Features

  • Set the hinge angle from 0 (closed) to 180 (flat) with hinge <degrees>, open, close, half or sweep.
  • Confirm the fold: setting an angle waits until CoreMotion reports it, and fails if it does not.
  • hinge posture prints the angle, orientation and which display hosts the UI (cover LCD or inner LCD-1 on iPhone Duo).
  • hinge screenshot captures the display that hosts the UI, waiting briefly if the backlight is still off.
  • hinge rotate and hinge orient send Device Hub's own orientation event, because devicectl device orientation set reports success on a foldable but changes nothing.
  • Picks the only booted iPhone Duo by default, and refuses to guess when several are booted. Override with -d or HINGE_DEVICE.
  • JSON output with --json for get, posture, orientation and screenshot.
  • Works from a terminal, scripts and CI as well as through the skill.
  • Limitations the README states: simulator only; the protocol is private and may break with future Xcode releases; the Device Hub slider does not move when the angle changes from hinge; which display becomes active is left to the simulator and should be checked with posture.

Requirements

  • macOS with Xcode 27.1 or later and a foldable iOS Simulator runtime.
  • A booted foldable simulator, such as iPhone Duo.

Install

  1. skills.sh (Claude Code, Codex, Cursor and other agents). Run:

    npx skills add artemnovichkov/hinge
  2. OpenSkills. Run:

    npx openskills install artemnovichkov/hinge
    npx openskills sync
  3. Claude Code plugin.

    /plugin marketplace add artemnovichkov/hinge
    /plugin install hinge@hinge
  4. Manually. Clone the repo and copy skills/hinge into your agent's skills directory (for example ~/.claude/skills/ or ~/.codex/skills/).

  5. CLI with Homebrew. Run brew install artemnovichkov/tap/hinge. When hinge is on PATH, the skill can use it instead of its bundled copy.

  6. CLI from source. Clone the repo and symlink bin/hinge onto your PATH.

  7. The first run compiles a small helper with Xcode's clang and caches it in ~/.cache/hinge.

Example

Ask your agent:

"Fold the simulator to 90° and take a screenshot of each display."

Or from a shell: hinge open, wait a couple of seconds for the display switch, then hinge screenshot unfolded.png, then hinge close and hinge screenshot folded.png.

Works with

Claude CodeCodexCursor

Listed in

Read the code before you install anything. SwiftAgents doesn't review or endorse the tools listed here. Active: a commit in the last 90 days. Slowing: last commit within the past year. Stale: older than a year, or archived.

Report a correction

More in this category