Can Xcode builds, tests and simulators run for a project user without a GUI login?
Answered 2026-10-08: yes, with conditions. Decided 2026-10-12: 1A and 2A. The decisions and their reasons are in the I20I20 (closed): X06-guest-xcode: Guest users and XcodeCan builds and simulators run for a guest user without a GUI login? comment that starts Decision (2026-10-12):, which sets two conditions on 2A. Decision 1 is in S06-04-vms-and-placementS06-04-vms-and-placement: VMs and PlacementThe work VM and the isolated VM, Xcode in them, and which VM a project's sessions run in., and the spec work for decision 2 is I196I196 (open): Simulators leave the session: per-user launchd domain and the Seatbelt profileFrom the X06-guest-xcode result (#20), for S13-guest-confinement layers 1 and 2.. Source: X06-guest-xcodeX06-guest-xcode: Guest users and XcodeCan builds and simulators run for a guest user without a GUI login? (I20I20 (closed): X06-guest-xcode: Guest users and XcodeCan builds and simulators run for a guest user without a GUI login?). Changes S13-01-process-hardeningS13-01-process-hardening: Layer 1: Process Hardening (v1)How wb-guestd hardens every process it starts for a project user, and how it stops and kills a project user's processes., S13-02-filesystem-profileS13-02-filesystem-profile: Layer 2: Seatbelt Filesystem Profile (v1)The Seatbelt profile each session's process tree runs under, where it comes from, its exceptions for Xcode builds, and its known gaps., S07-17-approvals-and-learningS07-17-approvals-and-learning: Approvals and LearningHow an unknown destination reaches the user as an approval request, what an approval grants, and how learn mode collects names. (“Leftover processes”), S06-04-vms-and-placementS06-04-vms-and-placement: VMs and PlacementThe work VM and the isolated VM, Xcode in them, and which VM a project's sessions run in. and X00-indexX00-index: SpikesThe open questions that must be answered by a throwaway prototype before work builds on them, in the order they are taken up.. Follow-ups: I194I194 (closed): Xcode image variant: getting Xcode and simulator runtimes into the imageFrom the X06-guest-xcode result (#20). (getting Xcode and the runtimes into the image), I195I195 (open): macOS app tests need a console session: decide the isolated-VM fallbackFrom the X06-guest-xcode result (#20). (a console session for macOS app tests), I196I196 (open): Simulators leave the session: per-user launchd domain and the Seatbelt profileFrom the X06-guest-xcode result (#20), for S13-guest-confinement layers 1 and 2. (simulators, the per-user launchd domain and the profile). I224I224 (closed): S06-vm-lifecycle: which process explains the testmanagerd failure in the guest (B20 decision 1A)S06-vm-lifecycle, "No GUI login session" (B20-guest-xcode decision 1A, #20, PR #221) says wb replaces the testmanagerd error from xcodebuild with a message that names the v1 limit (NFR06-explained-refusals). later changed decision 1’s error message: the guest instructions explain the limit, and no host process rewrites the error.
Figure 1. A session runs as the project user under its profile. Builds and simulators work, and iOS tests on the simulator finished only under the broad simulator profile. The simulator’s services run in launchd’s per-user domain, outside the session and its profile. Every xcodebuild test on macOS and launching a macOS app need a GUI session, which a project user doesn’t have (X06-guest-xcodeX06-guest-xcode: Guest users and XcodeCan builds and simulators run for a guest user without a GUI login?).
Decision 1: macOS tests through xcodebuild in v1?
Section titled “Decision 1: macOS tests through xcodebuild in v1?”Decision 2: simulators and the profile
Section titled “Decision 2: simulators and the profile”The simulator can’t be confined by the session’s profile, and xcodebuild test on it needed a profile that allows nearly everything. As specified now, no Layer 2 profile in S13-guest-confinementS13-guest-confinement: Guest ConfinementControls inside the guest that narrow what a project user's processes can do, and tell the host which program opened each connection. runs simulators: under the base and build profiles simctl can’t reach CoreSimulatorService, so simulators and iOS tests don’t run in a confined session. Option A would change that. I196I196 (open): Simulators leave the session: per-user launchd domain and the Seatbelt profileFrom the X06-guest-xcode result (#20), for S13-guest-confinement layers 1 and 2. holds the follow-up.
Impact
Section titled “Impact”Evidence
Section titled “Evidence”- verified Builds, SwiftPM, ad hoc and keychain signing,
simctland iOS unit and UI tests pass for a never-logged-in user, started withsetuidorlaunchctl asuser. Source: X06-guest-xcodeX06-guest-xcode: Guest users and XcodeCan builds and simulators run for a guest user without a GUI login?, “Answer”,results/final-matrix.txt. - verified macOS tests fail because
testmanagerdloads only inLoginWindowandAquasessions, and test hosts launch into a missinggui/<uid>domain. Source: “Answer” part 3. - verified A write the profile refused succeeded through
simctl spawn. Source: “The draft profile and its exceptions”,results/final-tasks.jsonl(escape). - verified With the p1 exceptions,
xcodebuild teston a simulator hung, and it finished with p2. Source:results/final-matrix.txt,results/g3-bisect-tasks.jsonl. - verified Xcode installs from a copy with no Apple ID, and the iOS runtime downloads with no Apple ID. Source: “Measurements”.
- assumed That a console session can be had without a password in the guest. Not measured: I195I195 (open): macOS app tests need a console session: decide the isolated-VM fallbackFrom the X06-guest-xcode result (#20)..
- assumed That the product image can get Xcode and the runtimes as the spike did. I194I194 (closed): Xcode image variant: getting Xcode and simulator runtimes into the imageFrom the X06-guest-xcode result (#20)..
What it unblocks
Section titled “What it unblocks”FR06-native-toolsFR06-native-tools: Native guest toolsAgent tool calls run tools native to the guest operating system (on macOS guests: Homebrew packages, Xcode command line tools, optionally full Xcode). for Xcode projects, the Xcode image variant (I194I194 (closed): Xcode image variant: getting Xcode and simulator runtimes into the imageFrom the X06-guest-xcode result (#20).), and the guest confinement work of S13-guest-confinementS13-guest-confinement: Guest ConfinementControls inside the guest that narrow what a project user's processes can do, and tell the host which program opened each connection. (I196I196 (open): Simulators leave the session: per-user launchd domain and the Seatbelt profileFrom the X06-guest-xcode result (#20), for S13-guest-confinement layers 1 and 2.). I43I43 (closed): S06-vm-lifecycle: VM slot admission for image builds, updates and GUI work (NFR05-two-macos-vms)NFR05-two-macos-vms allows two running macOS guests per host, and S06-vm-lifecycle uses both: the work VM and the isolated VM. (VM slots) no longer needs room for GUI work beyond macOS app tests.
Details and glossary
Why simulators work but macOS tests don’t. The simulator’s services are started by launchd in the user’s own background domain, which exists for any user that runs a process. The macOS test daemon is only allowed in a logged-in screen session, and macOS launches the app under test into that session too. A project user never has one.
Why the profile can’t hold the simulator. A Seatbelt profile applies to a process and its children. The simulator’s processes are started by launchd, not by the session, so they never get it.
- Seatbelt profile: macOS’s kernel sandbox rules for a process tree (S13-guest-confinementS13-guest-confinement: Guest ConfinementControls inside the guest that narrow what a project user's processes can do, and tell the host which program opened each connection., Layer 2).
- Console session: a user logged in at the screen (
Aqua), with WindowServer access. - launchd domain: the set of services launchd runs for the system, a user in the background, or a logged-in user’s screen session.
- Sign to run locally: an ad hoc signature, with no certificate, which is enough to run on the same Mac.