macos-spm-app-packaging

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

2|Updated Sep 8, 2026
One-click install
npx skills add https://github.com/hanshi-notes/hanshi --skill macos-spm-app-packaging-hanshi-notes
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: macos-spm-app-packaging
Source: https://github.com/hanshi-notes/hanshi/tree/main/.agents/skills/macos-spm-app-packaging
Command: npx skills add https://github.com/hanshi-notes/hanshi --skill macos-spm-app-packaging-hanshi-notes

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 SwiftPM-based apps have no built-in path to a proper .app bundle, code signing, notarization, or update distribution. This Skill provides the templates, scripts, and reference docs to go from an empty folder to a signed, notarized macOS app entirely from the command line. ## Core Features & Use Cases - Project Bootstrapping: Copy a minimal SwiftPM macOS app skeleton (Package.swift, Sources/, version.env) and rename it to start a new app without Xcode. - Packaging & Signing Scripts: Template scripts assemble the .app bundle, generate Info.plist, embed resources and frameworks, create universal binaries with lipo, and apply ad-hoc or Developer ID code signing. - Release & Distribution: Scripts handle notarization via notarytool, stapling, zipping, Sparkle appcast generation, and GitHub release publishing. - Use Case: You have a SwiftUI menu bar app built with SwiftPM and need to ship it. Use this Skill to package it with MENU_BAR_APP=1, sign it with your Developer ID, notarize it, and generate a Sparkle appcast for automatic updates. ## Quick Start Use the macos-spm-app-packaging skill to scaffold a new SwiftPM macOS app called HelloApp and package it into a signed .app bundle.

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 without an Xcode project?▼

Use SwiftPM to define an executable target in Package.swift, then run a packaging script that builds the binary, creates the .app bundle structure, generates Info.plist, and copies resources. This Skill provides template scripts that automate the entire process.

How to notarize a macOS app from the command line?▼

Sign the app with a Developer ID identity using codesign with --options runtime, zip it with ditto, then submit via xcrun notarytool with App Store Connect API credentials. Finish with xcrun stapler staple and verify using spctl and stapler validate.

Can I create a universal binary macOS app with SwiftPM?▼

Yes. Build separately for arm64 and x86_64 using swift build --arch for each architecture, then combine the outputs with lipo -create. The packaging template handles this automatically when you set ARCHES="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. Edit the signing script to add --options runtime to all codesign calls, then re-sign and resubmit.

How do I set up Sparkle auto-updates for a SwiftPM macOS app?▼

Generate an appcast.xml using Sparkle's generate_appcast tool with your ed25519 private key and the zipped release. Sparkle compares CFBundleVersion, so increment BUILD_NUMBER in version.env for every release you publish.

How do I make a menu bar app with SwiftPM?▼

Set MENU_BAR_APP=1 when running the packaging script, which adds LSUIElement to the generated Info.plist so the app runs without a Dock icon. Use an AppKit entry point with NSApplication and set the activation policy as needed.