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

Okay, editing in response to your comment. Make sure that:

  1. …your Xcode Command Line Tools are installed. (do that in Xcode, it’s at Preferences → Downloads → Components)
  2. …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?