Building and Shipping Mac and iOS Apps Without Ever Opening Xcode
A fully headless Apple-app workflow can build, sign, notarize, staple, install, and deploy apps using Xcode’s command-line toolchain. After one-time credential setup, a generated project and release script let developers or coding agents ship without opening Xcode.
Building and Shipping Mac and iOS Apps Without Ever Opening Xcode
Author: Scott Willsey | Published: 2026-07-11 | Generated: 2026-07-14 | Domain: scottwillsey.com
Tags: ‘#macOS’ ‘#iOS’ ‘#Xcode’ ‘#codesigning’ ‘#notarization’ ‘#automation’
TLDR
Xcode.app remains necessary because it contains Apple’s full SDK and release tools, but its GUI is not required for day-to-day development or shipping. With XcodeGen, keychain-backed signing and notarization credentials, a
release.shpipeline can regenerate projects, archive, Developer ID-sign, notarize, staple, verify, and install a Mac app entirely from the shell; iOS device deployment similarly usesxcodebuildanddevicectl. The only unavoidable interactive work is initial Apple-account, certificate, and notarization-credential setup.
Key Takeaways
- Use the full Xcode toolchain:
xcode-select -pshould resolve to/Applications/Xcode.app/Contents/Developer, not standalone/Library/Developer/CommandLineTools, which lacks the iOS SDK,notarytool, anddevicectl. - Generate projects instead of committing them: XcodeGen recreates the
.xcodeprojfrom a version-controlledproject.yml, avoiding Xcode project-file churn in Git. - Separate fast builds from shippable builds:
CODE_SIGNING_ALLOWED=NOsupports quick local/CI compilation and simulator use, but Gatekeeper rejects the output and team-bound entitlements such as iCloud KVS and App Groups do not bind. - Automate the Mac release chain: A script can run
xcodegen generate,xcodebuild archive,xcodebuild -exportArchivewithdeveloper-id,notarytool submit --wait,stapler staple,spctlverification, and installation to/Applications;set -euo pipefailensures it stops at the first failure. - Keep credentials out of source control: Developer ID certificates and private keys live in the login keychain, while an app-specific password is stored once in a
notarytoolkeychain profile. The private key cannot be re-downloaded, so it should be backed up. - Deploy iOS devices headlessly: Build with an Apple Development identity and provisioning via
xcodebuild -allowProvisioningUpdates, then install the resulting app withxcrun devicectl device install app.
Images & Media
- Scott Willsey avatar — Author avatar in the site header.
Referenced Links
- XcodeGen — Project generator that creates
.xcodeprojfiles fromproject.yml. - XcodeGen on GitHub — Source code and installation information for XcodeGen.
- Apple ID account management — Location for generating app-specific passwords used by
notarytool. - Apple Developer Program — Paid membership required for distribution and notarization.