Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

hinge

/hinge

Steruje kątem zawiasu (zgięcia) składanego symulatora iPhone, takiego jak iPhone Duo: składa, rozkłada, otwiera do połowy, animuje zgięcie, odczytuje kąt i testuje reakcję aplikacji na zmiany zawiasu i wyświetlacza.

Repozytorium
hinge ↗
Licencja
MIT
Ostatnia zmiana repozytorium
26.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
3
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Steruje kątem zawiasu (zgięcia) składanego symulatora iPhone, takiego jak iPhone Duo: składa, rozkłada, otwiera do połowy, animuje zgięcie, odczytuje kąt i testuje reakcję aplikacji na zmiany zawiasu i wyświetlacza.

Oryginalny opis (EN)

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.

Jak działa

  1. Commands
  2. Workflow
  3. Notes
Sekcje z nagłówków SKILL.md, w oryginale · 49 linii, 694 słów
Podgląd SKILL.md
---
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.
Pliki w paczce (3)
  • SKILL.md 5 KB
  • scripts/hinge 14 KB
  • scripts/hinge_helper.m 8 KB

Wersje

W bazie nie ma innych skilli o nazwie hinge.

Migawka bazy z 13.11.2026 · wersja paczki 0ddfffdac8d1 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 90iphone-duo-hinge-and-scenes
    Wykorzystuje kąt zawiasu iPhone Duo w efektach, obsługuje Split View i łączy interfejs na obu ekranach.
  • 100iphone-duo-readiness
    Audytuje i przenosi aplikację iOS na iPhone Duo, pierwszego składanego iPhone'a Apple, i kieruje do skilli od układu, pasków, zawiasu i scen, kamery oraz projektu.
  • 100duo-test
    Testuje aplikację iOS na iPhone Duo bez fizycznego telefonu, w symulatorze Xcode 27.1, we wszystkich pozycjach, i wie, czego symulator nie sprawdzi.
  • 90iphone-duo-support
    Dodaje lub sprawdza obsługę składanego iPhone'a Duo w aplikacji iOS: wewnętrzny i zewnętrzny ekran, zawias i strefy zastrzeżone.
  • 100iphone-duo-displays
    Wykorzystuje w aplikacjach SwiftUI i UIKit zawias, dwa wyświetlacze, dwie przednie kamery i wiele okien iPhone Duo, w tym kąt zawiasu, onHingeChange, UIHingeInteraction i sceny.
  • 100duo-start
    Jest punktem wejścia dla iPhone Duo: wykrywa SwiftUI lub UIKit, nową lub istniejącą aplikację, wersję Xcode i SDK oraz cykl życia sceny, i wskazuje, który skill z serii Duology załadować.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.