The iPhone Duo simulator and Device Hub
Everything an agent can do with the iPhone Duo simulator from the shell, and what only the user can do in Device Hub.
Checked on 16 October 2026 with Xcode 27.1 (27A9275) and the iOS 27.1 runtime (24A94425). Every command on this page ran on that Mac unless the text says otherwise. Put DEVELOPER_DIR=/Applications/Xcode-27.1.app/Contents/Developer in front of each xcrun call below. An agent's shell may not keep an export from an earlier call; export it only in an interactive terminal.
Find the device
xcrun simctl list devicetypes | grep "iPhone Duo"
# iPhone Duo (com.apple.CoreSimulator.SimDeviceType.iPhone-Duo)
xcrun simctl list runtimes | grep "iOS 27"
xcrun simctl list devices available | grep "iPhone Duo"
# iPhone Duo (9F89DDE7-...) (Booted)For scripts, read the JSON form. This prints the UDID of each "iPhone Duo" on the iOS 27.1 runtime:
xcrun simctl list --json devices available | python3 -I -c 'import json,sys; d=json.load(sys.stdin)["devices"]; print("\n".join(x["udid"] for k,v in d.items() if k.endswith("iOS-27-1") for x in v if x["name"]=="iPhone Duo"))'The Duo device type needs the iOS 27.1 runtime or later. Simulators are shared by every Xcode on the Mac: Xcode 26.5's simctl lists the same Duo device.
Create, boot, delete
Reuse the iPhone Duo simulator the Mac already has. Create one only when list shows none, and only after the user agrees. Each simulator takes about 4-6 GB of disk once it has booted (measured on 18 October 2026: 3.9 GB for a Duo simulator in use). Never create a second one for tests, and never clone one. Pass -parallel-testing-enabled NO to xcodebuild test, or it may clone the simulator for you.
# create (ask the user first, and say it takes about 4-6 GB): prints the new UDID; the runtime is optional (newest compatible if left out)
xcrun simctl create "iPhone Duo" com.apple.CoreSimulator.SimDeviceType.iPhone-Duo com.apple.CoreSimulator.SimRuntime.iOS-27-1
# boot if needed, then wait until it is ready
xcrun simctl bootstatus <UDID or name> -b
# delete a simulator you created, by its UDID; never one you didn't create
xcrun simctl delete <UDID>bootstatus -bon a booted device prints "Device already booted, nothing to do." It usually returns in about a second. Once it took many minutes on a busy Mac, so agents should run it in the background and poll.xcrun simctl booton a booted device fails: code 405, "Unable to boot device in current state: Booted", exit 149. Treat that as success.- Pass a UDID, not a name, when two devices share a name.
- Several agents or terminals may share one booted simulator. Don't shut it down, erase it or change its settings unless you started it.
bootedpicks any booted device when more than one runs.
Device Hub
Xcode 27.1 runs simulators in Device Hub. It ships DeviceHub.app and no Simulator.app.
open /Applications/Xcode-27.1.app/Contents/Applications/DeviceHub.appUse the full path. "$DEVELOPER_DIR/..." turns into /../Applications/... when the variable isn't set, and a DEVELOPER_DIR=... open prefix doesn't help, because the shell expands the path before it sets the variable.
Or, in Xcode, choose Manage Devices from the run destination menu, or Xcode > Open Developer Tool > Device Hub. Running an app on a simulator opens a compact Device Hub window; expand it to see the sidebar, canvas and inspector. The sidebar lists only simulators you added or used as run destinations; add one with the + button (Apple: managing devices, Apple: Device Hub).
Poses: only in Device Hub
xcrun simctl help and xcrun devicectl help device in Xcode 27.1 list no pose, hinge or fold subcommand. The pose controls sit under the bezel in Device Hub (Apple: interacting in Device Hub):
- Closed: the button to the right of Rotate Right. The app moves to the outer display.
- Partially Open: the middle of the three pose buttons. The fold becomes a division region.
- Open: the button on the far right. The app fills the inner display.
- Any angle: hold Option and drag the slider that appears below the bezel.
- Rotate: the rotate button (Option-click rotates right), or Device > Orientation.
Words like "book" or "tabletop" are not Apple names. Apple's controls say Closed, Partially Open and Open. In code, the hinge status is closed, partiallyOpen or fullyOpen (see reference/device-facts.md).
simctl io <device> screenConfig can power a screen off or change its geometry. It is not a pose control. We tried power on on the inner display: its backlight came on, but it stayed inactive and the outer display stayed active. Don't use it to fake a pose.
When a task needs several poses, list them for the user, ask them to click each one, and take a screenshot after each click.
Script the pose buttons
A small Mac program can press Device Hub's pose buttons through the macOS Accessibility API. We set all four poses this way with no one at the keyboard (Xcode 27.1, macOS 27.0.1, 17 and 18 October 2026). duo-pose-matrix (duology-ship, v0.2) ships this as duo-pose and duo-pose-matrix. Still ask the user to press the pose by default, unless they ask you to script it.
How it works:
- Device Hub is open, with the iPhone Duo selected. Get its process ID with
pgrep -x DeviceHub. - Check trust without a prompt: call
AXIsProcessTrustedWithOptionswithkAXTrustedCheckOptionPromptset to false. If it returns false, stop and ask the user to press the button. - Walk the accessibility tree from
AXUIElementCreateApplication(pid). Find theAXButtonwhose description (kAXDescriptionAttribute) isClosed,Partially Open,OpenorRotate Right. The pose buttons have no identifier. - Call
AXUIElementPerformAction(button, kAXPressAction). Then wait: Open and Partially Open settled in 4 to 6 seconds. Closed once took between 5 and 9.
| Pose | Press |
|---|---|
| Closed | Closed |
| Open | Open |
| Partly folded like a book | Partially Open |
| Partly folded across (tabletop) | Partially Open, then Rotate Right once. Three more Rotate Right presses bring it back to portrait. |
Limits:
- It needs Accessibility permission for the app that runs you (Terminal, iTerm, the Claude app). Only the user can give it, in System Settings > Privacy & Security > Accessibility. Never try to change it.
- It is UI scripting. It drives Device Hub's window, depends on its English labels and its layout, and can break in any Xcode update. When the buttons aren't found, fall back to asking the user.
- The pose belongs to the whole simulator. On a shared simulator it changes the screen for every agent and UI test using it. Check that nothing else is running first, and leave the simulator Closed, in portrait, when you finish.
- Device Hub doesn't report the pose. Its sidebar image still said Closed after we pressed Open.
xcrun devicectl device info displays -d <UDID>marks the active display: LCD when closed, LCD-1 when open or partly open. Only the app can tell open, book and tabletop apart: readreservedRegions(kind: .division, options: .includeInactive)and checkisActiveand the region's shape. - We found no other route: no pose command in
simctlordevicectl, no AppleScript dictionary, no URL route and no Darwin notification.devicectl device orientation setprinted a new orientation, but the partly open phone didn't rotate.
Split View
On the inner display, the user drags the app by its home indicator to one side, then to the other (Tech Talk 111461). Two apps share the display 50/50 (Tech Talk 111466), and each app puts its bars on its outer edge (HIG: Designing for iPhone Duo).
Screenshots and video of each display
simctl io reads the screen and changes nothing:
xcrun simctl io booted enumerate # lists the display ports
xcrun simctl io booted screenshot --display=primary outer.png # outer display
xcrun simctl io booted screenshot --display=primary-1 inner.png # inner display
xcrun simctl io booted recordVideo --display=primary-1 --force inner.mov # stop with Ctrl-C (SIGINT)- With the phone open and held wide,
outer.pngcame out 2034 × 1398 and black, andinner.png2853 × 2007. The size follows the current orientation. - These match Apple's App Store sizes for iPhone Duo: 1398 × 2034 (outer) and 2007 × 2853 (inner), portrait or landscape (screenshot specifications).
- Device Hub's own screenshot button saves at full device resolution to the Desktop (Apple: capturing screenshots).
- In a script, start
recordVideoin the background and stop it withkill -INT <pid>; it then writes the file.
Install, launch, read output, clean up
xcrun simctl install booted path/to/MyApp.app
xcrun simctl launch --terminate-running-process booted com.example.MyApp
xcrun simctl terminate booted com.example.MyApp
xcrun simctl uninstall booted com.example.MyApplaunch --stdout=<file>sendsprintoutput to a file, but the app buffers it. In our run the file stayed empty while the app ran. To see output live, runlaunch --console-ptyas a background job and send its output to a file. It blocks until the app ends, andsimctl terminateends it. In our run, the setup check's twoDUO-SETUPlines appeared within seconds.- Pass launch arguments after the bundle ID. Set environment variables for the app with a
SIMCTL_CHILD_prefix (xcrun simctl help launch). - Uninstall test apps when you finish, so the shared simulator stays clean.
Settings you can read (and change with care)
xcrun simctl ui booted appearance # light or dark
xcrun simctl ui booted content_size # e.g. largeBoth also take a value to change it, for example appearance dark. Put the old value back when you finish.
Known limits
From the Xcode 27.1 release notes and Xcode 27 release notes:
- The first simulator launch can take several minutes.
- StandBy isn't available in the iPhone Duo runtime.
- Most app extensions can't run or be debugged in the iPhone Duo runtime.
- An app using
CameraCaptureAccessorycan use both displays without a capture session. A real device needs one. - Device Hub can't send a two-finger touch. Trackpad pinch and rotate reach standard UIKit components as pointer events, which is not the same as two fingers on glass. Test multi-touch gestures on a device.
- The simulator reports 60 frames per second at most. Test 120 Hz behaviour on a device (
reference/device-facts.md).
Other ways to test resizing
Apple also suggests the resizable iOS simulator in Device Hub and iPhone Mirroring on macOS 27, resized to extreme sizes. It calls the iPhone Duo simulator the best way to test the full native experience (Apple: Three steps). In Xcode Previews, the canvas overrides picker has a Display group for the device's other display (Xcode 27.1 release notes).