After three months of weekend development, our Unity 3D game is ready to be released and deployed to the App Store. However, the process was far from straightforward. I spent an entire night figuring it out. After many trials and errors, I decided to document some of the key steps here:
1. Unity Build Settings
In Unity, go to "File" > "Build Settings" > "Platform: PC, Mac & Linux Standalone" > "Target Platform: Mac OS".
Click "Player Settings..." and configure the following options:
Default is Full Screen = true Default is Native Resolution = true Capture Single Screen = false Display Resolution Dialog = false Mac App Store Validation = true
In Finder, right-click on the game app and select 'Show Package Content'. Inside the Content folder, edit the Info.plist file. Ensure:
- CFBundleGetInfoString is a valid string.
- CFBundleIdentifier and CFBundleSignature have values that match the bundle id (explained later).
- CFBundleShortVersionString and CFBundleVersion are in x.x.x format, e.g., 1.0.0.
- Add a new
Example shown below:
<?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> <!-- ... your keys and values here ... --> </dict> </plist>
In your Build folder, create a file named
GAMENAME.entitlements with a sandbox key, like this:
<?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/> </dict> </plist>
4. Apple Developer Account
Assuming you already have a paid Apple Developer account, visit Apple Developer Account. Then, go to Certificates and choose the dropdown with "OS X". Click the "+" button to create new certificates. You will need to complete the process twice to get a "Mac App Distribution" and a "Mac Installer Distribution" certificate. Save them to your keychain for later use.
Next, go to "Identifiers" and choose the "App IDs" tab. Create a Wildcard App ID, but make sure it matches the bundle ID values from the previous step. For example, mine is unity.victorleungtw.*
5. iTunes Connect
Log in to iTunes Connect, go to My Apps > "+" > "New Mac App", and fill in the required fields. Make sure the Bundle ID matches the one from the previous step. The Prefix field should be the game name, such as ufo in my case.
You'll also need to take screenshots and crop them to the correct sizes. Only the following sizes are allowed:
- 1280 x 800 pixels
- 1440 x 900 pixels
- 2560 x 1600 pixels
- 2880 x 1800 pixels
6. Application Loader
Download and install the latest Application Loader to submit the app. Complete the following steps:
Fix the content permissions via a terminal command:
chmod -R a+xr "/path/to/GAMENAME.app"
Sign the app with the entitlements document created in step 3:
codesign -f -s '3rd Party Mac Developer Application: DEVELOPER NAME' --entitlements "GAMENAME.entitlements" "/AppPath/GAMENAME.app"
You're likely to encounter the error:
code object is not signed at all
This occurs because subcomponents are not signed. You could sign them individually, including
libMonoPosixHelper.dylib, but an easier way is to use the deep-sign command like this:
codesign -f -s '3rd Party Mac Developer Application: DEVELOPER NAME' --entitlements "GAMENAME.entitlements " "/AppPath/GAMENAME.app" --deep
Next, build the
productbuild --component GAMENAME.app /Applications --sign "3rd Party Mac Developer Installer: DEVELOPER NAME" GAMENAME.pkg
Remove any existing instances of the game app from your machine. Then, you can verify the install with:
sudo installer -store -pkg GAMENAME.pkg -target /
Finally, open the Application Loader and choose 'Deliver Your App', selecting the
GAMENAME.pkg. If everything goes well, the upload should succeed. Otherwise, address any specific errors accordingly. The process will take some time.
7. Select the Build
If you receive an email citing issues such as:
> **Invalid Signature** — The main app bundle game at path GAMENAME.app has the following signing errors: invalid Info.plist (the plist or signature has been modified) in architecture: i386.
It's likely that one of your subcomponents wasn't signed correctly. You may need to consult Apple's documentation for further guidance.
Otherwise, return to iTunes Connect, select the uploaded build, and change the status from "Preparing for Review" to "Waiting For Review" > "Review" > "Ready for Sale."
I hope this blog post is helpful and saves you some time! :)