macos-spm-app-packaging

Scaffold, build, and package SwiftPM-based macOS apps into signed .app bundles without Xcode projects.

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/RavitejaKarra24/dotfiles --skill macos-spm-app-packaging-ravitejakarra24
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: macos-spm-app-packaging
Source: https://github.com/RavitejaKarra24/dotfiles/tree/main/agents/.agents/skills/macos-spm-app-packaging
Command: npx skills add https://github.com/RavitejaKarra24/dotfiles --skill macos-spm-app-packaging-ravitejakarra24

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve? Building and distributing a macOS app normally requires an Xcode project, but many developers prefer pure SwiftPM workflows. This Skill provides the templates, scripts, and references to scaffold a SwiftPM macOS app from scratch, assemble a valid .app bundle, and handle signing, notarization, and Sparkle updates entirely outside Xcode. ## Core Features & Use Cases - Project Bootstrapping: Copy a ready-made SwiftPM macOS app skeleton (Package.swift, Sources/, version.env) and rename it to start a new app in minutes. - App Bundle Packaging: Use package_app.sh to compile universal binaries, generate Info.plist, embed resources and frameworks, and codesign the bundle with ad-hoc or Developer ID identities. - Release & Notarization: Sign with hardened runtime, submit to Apple notarytool, staple the ticket, and generate a Sparkle appcast for auto-updates. - Use Case: You are building a menu bar utility in SwiftUI and want to ship a notarized, auto-updating .app to users without ever opening Xcode—this Skill walks you from swift package init to a published GitHub release. ## Quick Start Ask the agent to scaffold a new SwiftPM macOS app named HelloApp, then package and launch it using the provided template scripts.

Frequently Asked Questions about macos-spm-app-packaging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a macOS app with SwiftPM without Xcode?

Initialize a package with swift package init --type executable, define an executable target in Package.swift, and add a SwiftUI or AppKit entry point. Then use a packaging script to assemble the .app bundle, generate Info.plist, and codesign the binary.

How do I notarize a macOS app built outside Xcode?

Sign the bundle with a Developer ID Application identity using codesign with --options runtime, zip it with ditto, and submit via xcrun notarytool using App Store Connect API credentials. After approval, run xcrun stapler staple to attach the ticket.

Can I create a universal binary for arm64 and x86_64 with SwiftPM?

Yes. Run swift build -c release --arch arm64 and --arch x86_64 separately, then merge the outputs with lipo -create. The packaging script automates this when ARCHES is set to "arm64 x86_64".

Why does notarization fail with hardened runtime errors?

The error occurs when codesign is invoked without the --options runtime flag, which is required for notarization. Add --options runtime to every codesign call, including embedded frameworks, and verify entitlements match Apple's allowed set.

How do I make a menu bar app with SwiftPM?

Set LSUIElement to true in Info.plist so the app runs without a Dock icon. In this workflow, set MENU_BAR_APP=1 when running the packaging script and use an AppKit entry point with NSApplication activation policy.

Does Sparkle auto-update work with SwiftPM-packaged apps?

Yes, if you bundle the Sparkle framework and generate an appcast with generate_appcast using an ed25519 private key. Sparkle compares CFBundleVersion, so you must increment BUILD_NUMBER in version.env for every release.