Skip to content

Add terminal Apple authentication and Xcode downloads for Linux - #358

Merged
hyzyla merged 2 commits into
mainfrom
codex/linux-xcode-download
Nov 13, 2026
Merged

hyzyla merged 2 commits into
mainfrom
codex/linux-xcode-download

Conversation

@hyzyla

@hyzyla hyzyla commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Linux users can sign in from a terminal, download an exact Xcode release, and configure the SDK without first downloading the archive on a Mac:

sweetpad auth login --apple-id EMAIL
sweetpad sdk download --xcode VERSION
sweetpad setup --xcode VERSION
sweetpad auth logout

Passwords and two-factor codes use hidden TTY input. The implementation follows XcodesLoginKit's SRP, hashcash, session-validation, and two-factor protocol using Python's standard library. The Swift reference cannot build directly on Linux because it unconditionally imports CommonCrypto and Apple's os module; Linux compiler probes confirmed both missing modules.

Sessions use private versioned JSON files. --session-file and SWEETPAD_APPLE_SESSION_FILE support non-interactive CI without password storage. Downloads use Apple's current catalog and authorization endpoint, handle gzip responses, validate resume ranges and entity validators, and verify cached archives against their local SHA-256 receipts. setup --sdk remains available. Documentation covers login, CI, cache permissions, and unsupported authentication methods.

Validation:

  • Real terminal Apple password and trusted-device two-factor authentication completed, with subsequent non-interactive session reuse on macOS, native ARM64 Linux, and emulated x64 Linux.
  • Both Linux hosts authorized and resumed the final 1 MiB of the real Xcode 27.3 beta archive. Full-file SHA-256 matches the existing authenticated 2,153,485,502-byte Apple download. The previous archive supplied the resume prefix; a full network download was not repeated.
  • 27 protocol and HTTP download tests pass on both Linux hosts, including hidden TTY input, gzip, session isolation, permissions under umask 0000, interruption, range restart, and read-only CI sessions. All fixtures are synthetic and contain no Apple inputs or credentials.
  • All 834 CLI unit tests and clippy with warnings denied pass. Documentation builds successfully with minification disabled.
  • Native ARM64/x64 package CI and Ubuntu/Debian/Arch host CI now run the authentication and download fixtures without an Apple SDK or real account.

Native ARM64 and x64 package CI passes, including clean-install checks for the embedded authentication/download helpers and non-interactive missing-session errors. Both native package binaries completed setup --xcode against the existing validated SDK/toolchain caches and built the packaged Mach-O ARM64 iPhone sample with iphoneos27.3 / Xcode build 27C5020n. Both original SDK environment files were preserved; x64 doctor reports zero problems. A fresh SDK extraction was not repeated.

All local validation and all 17 hosted checks pass. Xcode 26 hot reload passed after one isolated fresh-runner retry of the existing 120-second simctl install timeout.

@hyzyla
hyzyla marked this pull request as ready for review November 13, 2026 00:19
@hyzyla
hyzyla merged commit 6597ac8 into main Nov 13, 2026
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant