Version: 2019.4
macOS Player: C++ source code plugins for IL2CPP
Apple TV

Delivering your application to the Mac App Store

This page describes the process of delivering your application to the Mac App Store.

First, you need to make sure you have the correct provisioning profiles installed in your keychain: the “3rd Party Mac Developer Application” and “3rd Party Mac Developer Installer” profiles. See Apple’s developer documentation on Maintaining Your Signing Identities and Certificates to learn how to do this.

Go to Edit > Project SettingsA broad collection of settings which allow you to configure how Physics, Audio, Networking, Graphics, Input and many other areas of your Project behave. More info
See in Glossary
and select the Player category. Select the Standalone target, expand the Other Settings section and navigate to Mac App Store Options.

Unity automatically applies these settings to your app’s info.plist file as CF keys (see Apple’s developer documentation on Core Foundation Keys to learn more).

Mac App Store Options
Mac App Store Options
Property Function
Bundle Identifier Enter the Bundle Identifier of your iTunesConnect App. This appears as CFBundleIdentifier in the associated info.plist file.

See the Apple developer documentation on CFBundleIdentifier to learn more.
BuildThe process of compiling your Project into a format that is ready to run on a specific platform or platforms. More info
See in Glossary
Enter the build number for this version of your app. This appears as CFBundleVersion in the associated info.plist file.

See the Apple developer documentation on CFBundleVersion to learn more.
CategoryA Profiler category identifies the workload data for a Unity subsystem (for example, Rendering, Scripting and Animation categories). Unity applies colour-coding to categories to help visually distinguish the types of data in the Profiler window. More info
See in Glossary
Enter the string corresponding to the app’s type. The App Store uses this string to determine the appropriate categorization for the app. By default, this is set to the game category, public.app-category.games.

See the Apple developer documentation on LSApplicationCategoryType to see the list of category types available.
Mac App Store Validation Enable this to ensure that your app only runs when it contains a valid receipt from the Mac App Store. This prevents people from running the game on a different device to the one it was purchased on. Only disable this setting if you have implemented your own receipt validation.

Enable the Mac App Store Validation setting, then build your app (File > Build Settings… > Build).

Next, you need to create a GAMENAME.entitlements file and save it in any location. The easiest way to do this is to create an empty Mac app. To do this, open Xcode, create a new project with a macOS template, go to the Capabilities bar and enable App Sandbox. This automatically generates a basic .entitlements file.


 <?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>

Open the info.plist file in Xcode (or any text editor), and add the following keys:

<key>LSApplicationCategoryType</key>

<string>{VALID APP CATEGORY, e.g.: public.app-category.kids-games }</string>

<key>CFBundleSignature</key>

<string>{4 LETTER CREATOR CODE, e. g.:  GMAD }</string>

If you’re using Xcode 8.0+, you also need to add these fields to the info.plist file:

<key>CFBundleSupportedPlatforms</key>

    <array>
    
        <string>MacOSX</string>
        
    </array>

Next, fix read permissions on all the content in the .app. To do this, type the following into the macOS Terminal:

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

Sign the .App with the .entitlements you created earlier. To do this, type the following into the macOS Terminal:

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

Note: The -o runtime switch instructs the code sign to enable Hardened Runtime. This is a requirement for your app to pass verification for the App Store and Apple notary service since macOS 10.14.

Build the installer/pkg. To do this, type the following into the macOS Terminal:

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

Finally, use the Xcode ApplicationLoader to submit your app.

Notarization

Notarization is the process that Apple uses to check for malicious components. It is an automated system, and is not an App Review.

The Apple developer documentation states:

“Beginning in macOS 10.14.5, software signed with a new Developer ID certificate and all new or updated kernel extensions must be notarized to run. Beginning in macOS 10.15, all software built after June 1, 2019, and distributed with Developer ID must be notarized. However, you aren’t required to notarize software that you distribute through the Mac App Store because the App Store submission process already includes equivalent security checks.”

For further information see Apple’s developer documentation on Notarizing macOS Software Before Distribution.

Custom Icons

By default, Unity downsizes the icon image that you specified on the Icon panel of the Player settings (open Edit > Project Settings, then select the Player category) to generate an .icns file. This defines how your app’s icon appears in the macOS Finder and in the OS dock. However, you can replace it with a custom icon set if you want to.

  • Make a folder and name it UnityPlayer.iconset (or whichever name is set in your info.plist’s CFBundleIconFile/Icon File field) and place the following image names inside. Note that this folder must have the .iconset extension.
    icon_16x16.png

    icon_16x16@2x.png

    icon_32x32.png

    icon_32x32@2x.png

    icon_128x128.png

    icon_128x128@2x.png

    icon_256x256.png

    icon_256x256@2x.png

    icon_512x512.png

    icon_512x512@2x.png

Make sure that the @2x.png images are double the size stated in the file name. For example, the image 512x512@2x.png contains an image that is 1024x1024. From the macOS Terminal, navigate to the directory where the .iconset directory is located, and enter the following command:

    iconutil -c icns UnityPlayer.iconset

Finally, right-click the .app file and, select Show Contents, and replace the iconset.icns with the one you created earlier.


  • 2017–05–18 Page published

  • Updated features in 5.6

macOS Player: C++ source code plugins for IL2CPP
Apple TV