Packaging mac app
This post walks through the steps to export a macOS .app from Xcode and prepare it for sharing.
Export from Xcode
- In Xcode, go to Product > Archive.
- In the Organizer window, select your archive and click the Distribute App button on the right.
- In the dialog that appears, choose Custom > Copy App. This option exports a signed
.appinto a folder. - Select an export location and click Next. Xcode will export a folder containing the runnable
.appfile.
Ad-Hoc Signing (Recommended)
To ensure the .app can be opened on other Macs, it’s a good idea to apply an ad-hoc signature before distribution:
# 1. Locate your .app file (e.g., inside DerivedData)
# 2. Run forced signing in terminal
codesign --force --deep --sign - /path/to/YourApp.app
This command applies an ad-hoc signature (the - flag means self-signing) and does not require a paid Apple Developer account.
Package as ZIP
Once signed, compress the .app into a .zip file for uploading to GitHub or sharing:
zip -r YourApp.zip YourApp.app
