Index of every page on this site: llms.txt
All skills
kimeur avatar

/duo-setup

@cffd95d
by Gazouzi Marouanekimeur/duology46 stars
2
Run it yourself

Sets up a Mac to build, run and test apps for iPhone Duo, the foldable iPhone with an outer display and an inner display, covering Xcode 27.1 next to an older Xcode with DEVELOPER_DIR (no sudo xcode-select), xcodebuild -version, the iOS 27.1 SDK and runtime, the iPhone Duo simulator in Device Hub (xcrun simctl create/bootstatus, a screenshot of each display, the Closed / Partially Open / Open poses and the fold angle), Xcode's MCP server for Claude Code (xcrun mcpbridge, MCP_XCODE_PID, xcrun agent skills export) and project settings (IPHONEOS_DEPLOYMENT_TARGET, SWIFT_VERSION 6, SWIFT_DEFAULT_ACTOR_ISOLATION MainActor, SWIFT_APPROACHABLE_CONCURRENCY, synchronized folders). Use it when the Mac or project isn't ready for iPhone Duo work (duo-start or /duo-doctor sends you here), when /duo-doctor fails, when xcodebuild picks the wrong Xcode, when the Duo simulator, iOS 27.1 runtime or hinge pose is missing, or when Claude Code can't reach Xcode.

Use this Skill: https://skilld.dev/gh/kimeur/duology/duo-setup

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesxcode-side-by-side.md

≈1.6k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Xcode 27.1 next to an older Xcode

Many Macs keep an older Xcode for shipping work and add Xcode 27.1 for iPhone Duo. This page shows how to use 27.1 for Duo work without changing the Mac-wide default.

Checked on 16 October 2026 on a Mac with Xcode 26.5 (17F42) at /Applications/Xcode.app and Xcode 27.1 (27A9275) at /Applications/Xcode-27.1.app, macOS 27.0.1.

How the Mac picks an Xcode

xcrun and xcodebuild look for a developer directory in this order:

  1. The DEVELOPER_DIR environment variable, if it is set.
  2. The path saved by xcode-select --switch, which is Mac-wide.

So DEVELOPER_DIR wins for one command or one shell, and touches nothing else (man xcrun, man xcode-select). We confirmed that xcode-select -p itself prints DEVELOPER_DIR when the variable is set:

DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer xcode-select -p
# /Applications/Xcode.app/Contents/Developer
env -u DEVELOPER_DIR xcode-select -p
# the Mac-wide default, even when your shell exports DEVELOPER_DIR

So plain xcode-select -p can't tell you the Mac-wide default while the variable is set. Use the env -u DEVELOPER_DIR form for that.

Three ways to use Xcode 27.1

One command:

DEVELOPER_DIR=/Applications/Xcode-27.1.app/Contents/Developer xcodebuild -version

One shell session:

export DEVELOPER_DIR=/Applications/Xcode-27.1.app/Contents/Developer
xcodebuild -version
xcrun --show-sdk-version --sdk iphonesimulator

Agent shells often reset between calls. In that case, prefix every call. Don't rely on an export from an earlier call.

A build or test script. Put this guard at the top. It keeps a DEVELOPER_DIR the caller already set, falls back to the 27.1 path, and stops unless it finds a working Xcode 27.1 or later:

#!/bin/sh
# Put this at the top of any build or test script.
set -eu
: "${DEVELOPER_DIR:=/Applications/Xcode-27.1.app/Contents/Developer}"
export DEVELOPER_DIR

# Fail closed: a wrong path or the Command Line Tools give no version.
if ! out=$(xcodebuild -version 2>/dev/null); then
  echo "No usable Xcode at $DEVELOPER_DIR" >&2
  exit 1
fi
version=$(echo "$out" | awk 'NR == 1 { print $2 }')
case $version in
  [0-9]*.[0-9]*) ;;
  *) echo "Can't read the Xcode version at $DEVELOPER_DIR" >&2; exit 1 ;;
esac
major=$(echo "$version" | cut -d. -f1)
minor=$(echo "$version" | cut -d. -f2)

if [ "$major" -lt 27 ] || { [ "$major" -eq 27 ] && [ "$minor" -lt 1 ]; }; then
  echo "Need Xcode 27.1 or later; $DEVELOPER_DIR is Xcode $version." >&2
  exit 1
fi
echo "Using Xcode $version at $DEVELOPER_DIR"

We ran it with sh, bash, zsh and dash, five ways each. With no variable it passed, because the script's own default is the 27.1 path; the Mac default is never read. Set to Xcode 27.1, it passed. Set to Xcode 26.5, to a mistyped path, or to /Library/Developer/CommandLineTools, it stopped with exit 1. A wrong path is a common CI mistake, for example a runner that installs Xcode at /Applications/Xcode_27.1.app.

In CI, set DEVELOPER_DIR in the job's environment to the path where the runner installs Xcode 27.1.

xcode-select --switch is the user's call

sudo xcode-select --switch <path> changes the default for every terminal, every script and every tool that runs xcrun, including Xcode's MCP bridge. It also needs an admin password. Only the user should decide to run it. If they do, xcode-select -p shows the result, and the same command with the other path switches back.

Open the project in the right Xcode

Double-clicking a project opens it in whichever Xcode macOS picks. To be sure, the user opens it from Xcode 27.1, or runs:

open -a /Applications/Xcode-27.1.app MyApp.xcodeproj

We didn't run this one here, because it launches Xcode on the user's screen.

What is shared between the two Xcodes

  • Simulators and runtimes are shared. Xcode 26.5's simctl lists the same "iPhone Duo" device and the same iOS 26.2 to 27.1 runtimes as Xcode 27.1's. So a simulator list doesn't tell you which Xcode is active. xcodebuild -version does.
  • The SDK is not shared. Xcode 26.5 builds with the iOS 26.5 SDK. On iPhone Duo, an app built with the iOS 26 SDK sits at a familiar iPhone size in the middle of the inner display (Apple: Three steps).
  • Each Xcode has its own tools. Xcode 27.1 ships DeviceHub.app in Contents/Applications and no Simulator.app. Xcode 26.5 still ships Simulator.app in Contents/Developer/Applications. Both ship mcpbridge.

First launch and components

Check whether Xcode 27.1 still needs its first-launch setup. Exit code 0 means nothing is pending:

DEVELOPER_DIR=/Applications/Xcode-27.1.app/Contents/Developer xcodebuild -checkFirstLaunchStatus; echo $?

If it is pending, ask the user to open Xcode 27.1 once, or to approve xcodebuild -runFirstLaunch. Its help says it installs packages and agrees to the license, so an agent must not run it on its own.

Missing the iOS 27.1 simulator runtime: the user installs it in Xcode > Settings > Components, or approves this download (Apple: installing components):

DEVELOPER_DIR=/Applications/Xcode-27.1.app/Contents/Developer xcodebuild -downloadPlatform iOS

We confirmed the option in xcodebuild -help but did not run it, because it downloads several gigabytes. Apple's page uses xcode-select -s before such commands; DEVELOPER_DIR selects the Xcode for that one call instead.

Versions to expect

Check Xcode 27.1 on our Mac
xcodebuild -version Xcode 27.1, Build version 27A9275
xcrun --show-sdk-version --sdk iphonesimulator 27.1
xcrun swift --version Apple Swift version 6.4
xcrun simctl list runtimes iOS 27.1 (27.1 - 24A94425)
macOS needed Tahoe 26.6 or later (release notes)

Apple's Software Releases page lists Xcode 27.1 (27A9275) on 15 October 2026. Check the build number, not a page's wording.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    This skill prepares a macOS environment for developing and testing applications for the foldable iPhone Duo. It handles Xcode 27.1 configuration, simulator setup, and the integration of Claude Code with Xcode via the Model Context Protocol (MCP). The skill follows security best practices by avoiding global system modifications (like sudo xcode-select) and requiring explicit user approval for downloads and configuration changes.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

Signed by skilld at cffd95d. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated last month
Other metadata
metadata
{
  "verified": "Xcode 27.1 (27A9275), iOS 27.1 simulator, device: no",
  "sources": "https://github.com/Kimeur/duology/blob/main/reference/sources.md"
}

README badge

README badge for kimeur/duology/duo-setup