- Home /
Did Unity 4 change how one can package an app for the Mac App Store?
Hi there.
We recently upgraded to Unity 4, and I am making a Mac App Store package for my project. I used the process I describe below to create the package (using sandboxing) and then test the installer. This worked great before Unity 4, but now, after I install it, the app closes immediately after startup. This makes me think that the packaging/sandboxing process isn't working the same way as it did before. Alternatively, it could be something wrong with the way I'm installing the package. I would like to test my app before I submit it to the app store, so any information would be helpful.
Here was my process:
In Unity, make sure the "Mac App Store Validation" flag is checked on my Player Settings
Build app
Put in the correct Info.plist file, as well as icon files and MainMenu.nib file.
Make an Entitlements file, allowing for sandboxing.
Open up a terminal and navigate to the folder that has the Unity build in it.
Type the following line: chmod -R a+xr AppName.app (This gives you permission to codesign files)
Type the following line: codesign -f -s "3rd Party Mac Developer Application: Company" --entitlements AppName.entitlements AppName.app (This codesigns the whole app with the permissions granted by the entitlements file and our own developer certificate)
Type the following line: codesign -f -s "3rd Party Mac Developer Application: Company" AppName.app/Contents/Frameworks/MonoEmbedRuntime/osx/libmono.0.dylib (For whatever reason, this file doesn't get modified properly. It has no need for the entitlements, but it does need to be targeted and codesigned directly)
Type the following line: productbuild --component AppName.app /Applications --sign "3rd Party Mac Developer Installer: Company" AppName.pkg (This creates the actual .pkg file that you will be uploading to the Mac AppStore. It creates it in the same folder as the build folder. To change the location, change the very last part of the command so that AppName.pkg is saved to somewhere else.)
App Store package now exists.
Testing the app:
Type sudo installer -store -pkg AppName.pkg -target /
Type in computer's password, if queried.
Start up app from the Applications folder
Type in username/password if queried.
Expected (and previous Unity version results): App runs. Actual result: App immediately closes.
Thanks all!
Answer by POLYGAMe · Jan 03, 2013 at 10:26 AM
I have been tearing my hair out over this, too... But look what I found!
http://wiki.unity3d.com/index.php?title=Mac_App_Store_PostProcessor
Your answer
![](https://koobas.hobune.stream/wayback/20220613085011im_/https://answers.unity.com/themes/thub/images/avi.jpg)