- Prerequisites
- Build to macOS from Unity
- Create certificates and entitlements
- Codesign and upload a macOS app for the App Store
- Notarize an app for other platforms
- Common Error Messages
>=
macOs 10.15 Catalina- Xcode
- Apple developer account
- Apple Id
- Build Settings
- Set target platform to
Mac OS
- DO NOT select Create an Xcode project. Instead, build a single executable, code sign and upload yourself using
SignGame.sh
(and instructions below)
- Set target platform to
- Player Settings
- Set a unique Bundle Identifier (e.g.
com.YourCompany.YourGame
) - DO NOT check "App Store Validation" (requires players enter their Apple password).
- Set a unique Bundle Identifier (e.g.
Certificates for code signing and/or packaging the build.
- In your Apple Developer account, view Certificates, Identifiers & Profiles and click + (add)
- Choose "Create a New Certificate", select add a "Developer ID Application" certificate.
- After clicking continue, follow instructions to create and upload a "Certificate Signing Request" using the Keychain Access app
- After you've uploaded the Certificate Signing Request file, you should then be able to download the Developer Id Application certificate.
- Once downloaded, click on the file to add it to Keychain Access where you'll see it under the certificates section. It will be called something like "Developer ID Applicate : YourCompanyName (0123456789)". Make sure to save a backup copy of your private and public keys somewhere secure.
- Repeat these steps for "Developer ID Application" and "Mac Installer Distribution"

Once you complete this step you should have a certificate in Keychain Access on your Mac, and you'll be able to see it saved in your Apple account here: https://developer.apple.com/account/resources/certificates/list
An xml file used to give executable permissions to the app when code signing. Here are the minimum entitlements needed for a Unity build:
- Save the below as
basic.entitlements
in the same folder where you place your Unity build.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>
</dict>
</plist>
These steps are covered automatically in CodeSign.sh
For the code signing to work in a later step, we need to change permissions for files within the app directory.
chmod -R a+xr "YourGame.app"
Next, in the command line, use the codesign tool on the permission changed file by using your Developer ID Application certificate (literally the name of the certificate in double quotes).
codesign --deep --force --verify --verbose --timestamp --options runtime --entitlements "$ENTITLEMENTS_FILE" --sign "$CODESIGN_CERT_NAME" "$APP_LOCATION"
If successful, you should see a message similar to:
YourGame.app: signed app bundle with Mach-O universal (x86_64 arm64) [com.YourCompany.YourGame]
To upload to the App Store you need to create a .pkg file and use a Mac Installer Distribution certificate too
Generate PKG
productbuild --component "$APP_LOCATION" /Applications --sign "$INSTALLER_CERT_NAME" "$PKG_LOCATION"
I recommend installing Apple Transporter. Just drag the app in to upload to the app store
Automated upload option
xcrun altool --upload-app -f YourGame.pkg -t macos -u "YOUR_APPLE_ID" --password "APP_SPECIFIC_PASSWORD"
You will see something like this if successful:
UPLOAD SUCCEEDED with 0 warnings, 0 messages
Additional steps for other platforms...
- As of January 2020, all apps running on
>=
macOS 10.15 Catalina are required to be notarized. - For Unity games distributed outside the Mac App Store, such as with Steam, itch.io, etc. the notarization process is done post build using a series of Xcode command line tools.
- The following steps assume your build and entitlements file are in the same directory.
Use an app-specific password to sign in to an app or service not provided by Apple. Required to upload a build to Apple servers, the password will look like
abcd-efgh-ijkl-mnop
- Login to your Apple account
- In "Sign-in and Security", click on "App-Specific Passwords"
- Click + and create one. Name it something relevant
- Store it somewhere secure.
Once the code is signed, we need to compress the application into a zip file for uploading. You can do this in the command line.
ditto -c -k --sequesterRsrc --keepParent "YourGame.app" "YourGame.zip"
Now that we have the compressed zip file, upload it to the Apple servers for notarization using the xcrun altool in the command line. In order to do this, you'll need
- your game's bundle id (defined in Unity Player Settings), something like
com.YourCompany.YourGame
- your Apple ID username (usually an email address)
- your Apple ID generated password (the one with the format
abcd-efgh-ijkl-mnop
) - your Apple Developer "Provider Short Name". Often this is your Team ID (ten digit alphanumeric id), you can find in the membership section of your Apple developer account
Note
If your "Provider Short Name" is not the same as your Team ID, you can find it by running: ``` xcrun iTMSTransporter -m provider -u YourAppleIDUsername -p abcd-efgh-ijkl-mnop ```First, sign in with your Apple ID (your email address):
xcrun notarytool store-credentials "my-profile" --apple-id "your-apple-id" --team-id "your-team-id"
You'll be prompted to enter your Apple ID password and an app-specific password (i.e. generated password).
OUTPUT
You will see something like this if successful:This process stores your credentials securely in the Keychain. You reference these credentials later using a profile name.
App-specific password for your-apple-id:
Validating your credentials...
Success. Credentials validated.
Credentials saved to Keychain.
To use them, specify `--keychain-profile "my-profile"`
Run the following command, replacing YourGame.zip with the file you want to notarize to upload the build to the notarization service:
--keychain-profile "my-profile"
refers to the stored credentials--wait
ensures the command waits for the notarization process to complete before returning.- Note that
xcrun altool --notarize-app
is no longer functional...
xcrun notarytool submit YourGame.zip --keychain-profile "my-profile" --wait
OUTPUT
Wait for the notarization service to process the upload. This can take anywhere from 1 minute to an hour or sometimes longer if the service is overloaded. If the upload was successful, you should see a message with a RequestUUID similar to:
Conducting pre-submission checks for YourGame.zip and initiating connection to the Apple notary service...
Submission ID received
id: abcdefgh-1234-5678-90ij-klmnopqrstuv
Upload progress: 100.00% (75.7 MB of 75.7 MB)
Successfully uploaded file
id: abcdefgh-1234-5678-90ij-klmnopqrstuv
path: /Users/.../Unity/_Builds/.../YourGame.zip
Waiting for processing to complete.
Current status: Accepted..........
Processing complete
id: abcdefgh-1234-5678-90ij-klmnopqrstuv
status: Accepted
Alternatively, you can ping the service for the current status of the upload using that RequestUUID:
xcrun notarytool log "<RequestUUID>" --keychain-profile "my-profile"
Once notarized, Apple creates a ticket that you need to "staple" to the app. Attach the ticket to your app:
xcrun stapler staple YourGame.app
OUTPUT
You will see something like this if successful:Processing: /Users/.../Unity/_Builds/.../YourGame.zip
The staple and validate action worked!
After everything is completed we can use the spctl tool to check if the app is recognized as having the proper notarization.
spctl --assess --verbose=4 YourGame.app
OUTPUT
If successful, you should see a message similar to:YourGame.app: accepted
source=Notarized Developer ID
Whether or not the notarization was successful, if you try and open the app on your local machine, everything will appear to work fine. A good way to double check everything is actually working is to upload the notarized build to somewhere on the web (e.g. Itch.io, or even Google Drive), download it, and then see if the app opens properly. If working correctly, then all you should see is a small warning that you downloaded it from the web and then it should open normally.
- You cannot upload an .app to the App Store. Convert to a .pkg first (see above)
xcrun altool --upload-app -f YourGame.app -t macos -u "email" --password "1234-1234-1234-1234"
> Error uploading 'YourGame.app'.
> [altool.6000026BC1C0] Unable to upload archive. Failed to get authorization for username 'username' and password.
- Make sure you have the right entitlements enabled (see above)
xcrun altool --upload-app -f YourGame.pkg -t macos -u "email" --password "1234-1234-1234-1234"
> Running altool at path '/Applications/Xcode.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Frameworks/AppStoreService.framework/Support/altool'...
> 2025-10-09 12:34:28.877 ERROR: [altool.600003E141C0] [ContentDelivery.Uploader.600003E141C0] Validation failed (409) App sandbox not enabled. The following executables must include the "com.apple.security.app-sandbox" entitlement ...
- You used the wrong certificates
90238: Invalid signature. The executable, at the YourGame.app/Contents/PlugIns/lib_burst_generated.bundleβ path, has the following signing error(s): [valid on disk. lib_burst_generated.bundle: satisfies its Designated Requirement. test-requirement: code failed to satisfy specified code requirement(s)]. For details about signing Mac code for distribution, visit: https://developer.apple.com/documentation/xcode/creating-distribution-signed-code-for-the-mac.
- Missing provisioning profile
Error message: ITMS-90889: Cannot be used with TestFlight because the bundle "YourGame.app" is missing a provisioning profile. Main bundles are expected to have provisioning profiles in order to be eligible for TestFlight.
- Building Unity Apps to macOS: The Ultimate Guide - Original source of this script (2021)
- Unity Manual: Code sign your application and Build a macOS application
- Unity3d How to Build and Release Unity Games to the Mac App Store? (2019)
- Demystifying Code Signing: Ensuring Security and Trust in Apple Development - Excellent overview (2024)
- Signing Mac App on OS X Mavericks (2014)
- Notarize a Command Line Tool with notarytool (2021)
- Update for Notarizing Mac Unity Apps (2023)
- Original source: How to notarize a Unity build for MacOs 10.15 Catalina (gist) (2020)
Incorporates comments from original https://gist.github.com/dpid/270bdb6c1011fe07211edf431b2d0fe4 as well as fork(s) https://gist.github.com/jleaney/d90ef99bfce7779112557d006ef0ac8b