Submit Unity 3D Game to Mac App Store

Victor Leung
May 28, 2016 · 3 min read

After 3 months of development on the weekends, our unity 3D game is ready to release and deploy to App Store. However, it was not straight forward at all, and I spent a whole night to figure it out. So I decided to document some of the key steps hereafter many trial and error:

1. Unity Build Settings

In Unity, choose “File” > “Build Settings” > Platform “PC, Mac & Linux Standalone” > Choose target platform “Mac OS”.

Click “Player Settings…” select your default icon and config with:

Default is Full Screen = trueDefault is Native Resolution = trueCapture Single Screen = falseDisplay Resolution Dialog = falseMac App Store Validation = true

2. Info.plist

In Finder, right-click on the game app to ‘Show Package Content’. Inside the Content folder, edit the Info.plist file. Make sure

  1. CFBundleGetInfoString is a valid string
  2. CFBundleIdentifier and CFBundleSignature has values match with bundle id (will explain later)
  3. CFBundleShortVersionString and CFBundleVersion are in the version number x.x.x, e.g. 1.0.0
  4. Add a new <key>LSApplicationCategoryType</key> with values <string>public.app-category.games</string>

Example is 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>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>ufo</string>
<key>CFBundleGetInfoString</key>
<string>Victor Leung 2016. All rights reserved.</string>
<key>CFBundleIconFile</key>
<string>PlayerIcon.icns</string>
<key>CFBundleIdentifier</key>
<string>unity.victorleungtw.ufo</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>ufo</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.4.0</string>
<key>CFBundleSignature</key>
<string>unity.victorleungtw.ufo</string>
<key>CFBundleVersion</key>
<string>1.4.0</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.games</string>
</dict>
</plist>

3. Entitlement

In your Build folder, create a file GAMENAME.entitlements, with a sand-box 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

Assume you have already paid and got an Apple developer account. Visit https://developer.apple.com/account/ , then go to certificates, choose the dropdown with “OS X” and click the “+” button for creating a new certificate. You will need to go through the process twice to get a type of “Mac App Distribution” and “Mac Installer Distribution”. Save them to a key chain, which will be used later.

Next, go to “Identifiers” and choose “App IDs” tab, you can create a Wildcard App ID, but make sure it matches with the previous step bundle id values. For example, mine is unity.victorleungtw.*

5. iTunes Connect

Log in to iTunes Connect, choose My Apps > “+” > “New Mac App”, fill in the values and choose the bundle ID matches with the previous step. The prefix field would be the game name, such us ufo in my case.

After filling in the form, you will also need to spend some time to take screenshots, and crop them in the right size. 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. There are a couple to steps to go through first:

Fix the permission of the content via a command in terminal:

chmod -R a+xr “/path/to/GAMENAME.app”

Sign the app with the created document in step 3.

codesign -f -s '3rd Party Mac Developer Application: DEVELOPER NAME' --entitlements "GAMENAME.entitlements" "/AppPath/GAMENAME.app"

However, you’re likely to get the error:

code object is not signed at all

This is because the subcomponent is not signed. You could sign the subcomponents one by one, including libmono.0.dylib and libMonoPosixHelper.dylib etc, but easier way just use the deep sign command, like this:

codesign -f -s '3rd Party Mac Developer Application: DEVELOPER NAME' --entitlements "GAME.entitlements" “GAMENAME.app" --deep

Next build the .pkg file:

productbuild --component GAMENAME.app /Applications --sign "3rd Party Mac Developer Installer: DEVELOPER NAME" GAMENAME.pkg

Remove any existing game.app in your machine then you can verify the install by:

sudo installer -store -pkg GAMENAME.pkg -target /

Finally, open the Application Loader and ‘Deliver Your App’ by choosing the GAMENAME.pkg. If things go well, then you should be able to upload it. Otherwise, fix the specific errors accordingly. It will take a while to go through.

7. Select the build

If you got an email with issues,

Invalid Signature — The main app bundle game at path GAMENAME.app has following signing error(s): invalid Info.plist (plist or signature have been modified) In architecture: i386 .

It is probably one of your subcomponents didn’t sign correctly, which you may need to spend some time on Apple documentation to understand how it works.

Otherwise, head back to iTunes Connect, select the uploaded build, and change the status “Preparing for review” > “Waiting For Review” > “Review” > “Ready for Sale”!

Hope this blog is helpful and could save you some time :)

Victor Leung

Written by

I’m a keen traveler to see every country in the world, passionate about cutting edge technologies.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade