- Home /
Signing a Mac App Correctly Problem
Hey folks,
I am having an issue getting the signing process to work with a Mac/OSX app I am trying to set up for the Mac App Store. I attempted to follow the instructions in the "Blurst Blog Post" (although I really don't know if I did it right), and also tried using a Postprocessor (I couldn't figure out how to use this, after I followed the instructions the resulting built app had the same exact same plist info and not the custom ones I set).
However, I don't believe any of that is the problem, I followed several manual signing tutorials using the terminal and everything works almost fine. I say "almost".
Originally when I try to codesign it says that the executable is not valid, etc. However, when I codesign it without this part, the codesign proceeds but afterward the resulting package produces a damaged app.
<key>CFBundleExecutable</key>
<string>GameName</string>
It will not let me proceed without changing ^this^ line.
This is my .plist file. Obviously the "gamename" and "company" are actually replaced with the correct information. All of my apple certificates, keychains, profiles, etc. are set up as well.
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.arcade-games</string>
<key>NSHumanReadableCopyright</key>
<string>(c) 2013 Company, LLC. All rights reserved.</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>GameName</string>
<key>CFBundleGetInfoString</key>
<string>Unity Player version 4.1.2f1 (911c7369eeac). (c) 2012 Unity Technologies ApS. All rights reserved.</string>
<key>CFBundleIconFile</key>
<string>UnityPlayer.icns</string>
<key>CFBundleIdentifier</key>
<string>com.company.gamename</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>gamename</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>Unity Player version 4.1.2f1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0.0</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>PlayerApplication</string>
<key>UnityBuildNumber</key>
<string>911c7369eeac</string>
This is what I am using in the Terminal to codesign, package, and test install:
Codesign:
codesign -f -v -s "3rd Party Mac Developer Application: Company, LLC" /path/GameName.app
Build:
productbuild --component /path/GameName.app "/Applications" --sign "3rd Party Mac Developer Installer: Company, LLC" /path/GameName.pkg
Test Install:
sudo installer -store -pkg /path/GameName.pkg -target /
Thanks all, for your help in advance, if the Postprocessor script works, please let me know how it does. I have been researching this for a while now, and it appears that nobody else has this problem.
If I am missing something silly, please point it out.
Thanks again, God bless!
Howey
Answer by Khakionion · May 17, 2013 at 04:00 AM
Okay, editing in response to your comment. Make sure that:
...your Xcode Command Line Tools are installed. (do that in Xcode, it's at Preferences -> Downloads -> Components)
...you have a CODESIGN_ALLOCATE variable set in your terminal shell.
If this command:
echo $CODESIGN_ALLOCATE
returns nothing, then you need to define that variable. If you won't be signing apps often, just run this before signing:
export CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/usr/bin/codesign_allocate"
Good luck!
Original Message: Make sure your CFBundleExecutable exactly matches; it's case-sensitive (and required, so deleting it won't work).
Could you paste the actual error?
Yes, I figured that was the reason it was broken afterwards, deleting it obviously didn't work. I checked the case and it is correct. As long as it is supposed to be matching the Unix Executable File inside the $$anonymous$$acOS folder.
This is the error I get: "object file format unrecognized, invalid, or unsuitable".
Thanks for the quick response, let me know what you think.
[EDIT:] Accidentally posted it as an answer... deleted it... :)
(just an FYI, make sure you copy that whole export line, it's longer than the box in which it appears.)
Haha, thank you so much! That works perfectly now, just fired up the app after installing it from the package. It's not damaged, works great.
I didn't have the Command Line Tools installed and I definitely did not have that allocate thing going.
If I may ask, why did that work?
Thanks again, God bless!
Howey
The only "damage" is just $$anonymous$$acOS being unable to find the binary; it uses CFBundleExecutable to find it, so if that's missing, it can't run the app.
The "codesign" tool uses another tool, "codesign_allocate," to allocate the space for codesigning information. By default it (and other CLI tools) are installed within Xcode.app, but not accessible at the command line.
CODESIGN_ALLOCATE is the environment variable that codesign looks for in order to find codesign_allocate. (Why Apple doesn't just automatically set that for us, I do not know.)
Happy that it worked for you!
a script for singing(app and plugins) and packaging the build http://goo.gl/pq0Wav
Your answer
Follow this Question
Related Questions
How to get mac version to dmg for amazon? 1 Answer
Can't run game made in Windows on Mac 1 Answer
Unity 3.5b6 building for OSX 10.5 0 Answers