Tiny Mac Utilities Done Right: Packaging, Signing, and Safe Defaults
Small desktop tools are easy to write and easy to ship badly. A few packaging decisions make the difference between a useful utility and a support burden.
Step 1: Keep defaults reversible
struct AppDefaults {
static let shouldHideDesktop = false
}
Step 2: Separate privileged actions from UI process
protocol CommandExecutor {
func run(_ command: String) throws
}
Step 3: Package with code signing checks
codesign --verify --deep --strict MyUtility.app
spctl --assess --type execute MyUtility.app
Pitfalls
- Hard-coding risky defaults users cannot undo quickly.
- Bundling shell scripts with unchecked parameter input.
- Skipping signature verification before release.
Validation
- First launch uses safe defaults and clear toggles.
- Privilege boundaries are testable in isolation.
- Signed app passes local Gatekeeper assessment.