$ show XcodesOrg/XcodesApp
XcodesApp is a native macOS SwiftUI application for discovering, downloading, installing, selecting, and uninstalling multiple versions of Apple's Xcode, including management of the iOS simulator runtimes that ship with them. The app surfaces a list of available Xcode versions (from the Xcode Releases API or the Apple Developer portal), drives the full install pipeline (download via URLSession or the bundled aria2c, verify code signature, unxip archive, move into /Applications, run elevated post-install steps), switches the active developer directory, and supports Apple ID sign-in with 2FA, SMS, security keys, and federated authentication. This repository is the app shell and privileged-helper layer; core domain logic and authentication live in the separate XcodesKit and XcodesLoginKit packages. The architecture is a clean three-part split. Xcodes/Backend holds a central observable AppState coordinator and small subsystems (downloader, helper client, process runner, dependency-injection environment); Xcodes/Frontend is a SwiftUI view layer organized into list, info pane, sign-in, and preferences modules; com.xcodesorg.xcodesapp.Helper is a separate privileged XPC service installed via SMJobBless, with peer connections verified by code-signing designated requirements and audit-token comparison before any xcode-select, license-accept, or file-operation work is performed. Update delivery uses Sparkle with a Jekyll-generated appcast hosted on GitHub Pages. The codebase is well engineered for a GUI app: the Environment/Current dependency-injection seam makes nearly all side effects mockable, and the test suite is unusually thorough, covering SRP authentication vectors from real Apple ID sessions, stale-async-task race conditions, new-version notifications, and download/install state transitions. The main weaknesses are the reliance on the private NSXPCConnection.auditToken API, several SPM dependencies pinned to main branches, some duplicated view helpers and stale branding text (RobotsAndPencils references, a hardcoded WWDC 2022 status message), and a manual multi-step release process. Maintenance is active: recent commits, CI running on the latest macOS/Xcode runners, Dependabot config, release-drafter workflow, and xcstrings localization validation. Technical drift is low — the code aggressively tracks current Apple platforms (macOS 26 branches, Xcode 26.5 CI), though the private-API usage and main-branch dependency pins remain chronic medium-term risks.
The LLM identified 3 files worth highlighting for reuse:
Verifies the identity of an XPC peer before the privileged helper performs any elevated work, using code-signing designated requirements and audit-token comparison. This is the security gate that prevents unprivileged callers from invoking xcode-select or file operations. The pattern — extract the peer's audit token, require a specific signing identity, then validate entitlements — is directly transferable to any macOS app that needs a SMJobBless-style privileged helper.
Point-Free-style Environment struct exposed through a lock-protected mutable Current global. Every external subsystem — filesystem, network, shell, keychain, user defaults, date, helper connection — flows through this single seam, and tests swap in a mock implementation. Demonstrates a clean testing boundary for a macOS app with many side-effectful dependencies and is a solid reference implementation of the pattern for any Swift codebase.
Shared XPC contract file compiled into both the main app and the privileged helper, keeping the request/response types and file-operation payloads in lockstep across the process boundary. Defining the inter-process interface in a shared target instead of duplicating definitions is a simple, effective pattern for any multi-process macOS application and prevents subtle drift between client and service.