Mac app store issue :: I can't build the installer after following Blurst's tutorial.

Hi I’m having an issue whilst following this tutorial on the Blurst website about signing a unity .app and making it into a .pkg for the mac app store.

I get this error when trying to build an installer package (the last step).


productbuild: unrecognized option `–sign3rd Party Mac Developer Installer: Company Name/Applications/mygamesname.pkg’

Usage: productbuild [options] --distribution [–package-path ]
Build product with a distribution and the packages it references

Usage: productbuild [–product ] {–component }
Build product with specific bundles, synthesizing a distribution

Usage: productbuild --synthesize [–product ] {–package }
Synthesize and write a distribution from component packages


I was able to code sign it properly and I have Xcode 4.0.2 if that makes a difference.

Any ideas why this is happening and what I can do to fix it? Thanks!

Oh and I have tried using Martin Schultz’s “Mac App Store PostProcessor” located here. Although for some reason when I build my game the info.plist is the same as it was before, it isn’t signed properly and it isn’t packaged up anywhere.

These are the steps I’ve taken with the PostProcessor;

I have copied and pasted the entire script starting with -

Code:

 #!/usr/bin/perl 

use File::Copy;

and ending with -

Code:

if ($doCreatePackage eq "true") {
    system("productbuild --component \"" . $installPath . "\" /Applications --sign \"". $certificateInstaller . "\" \"" . getcwd . $outputDirectory . $packageName . "\"");
}

I’ve left the variables about signing and packaging both as true and changed the signing certificate from Martin Schultz to my one.

It was copied and pasted into a text document and saved as .rtf then changed to .sh in the finder. I’ve placed the resulting file in “Assets/Editor” and built the project in Unity (not build and run).

After right clicking the resulting .app file, showing the package contents and viewing info.plist nothing has changed between this one and one without the shell script in the editor folder nor is there any .pkg files.

Any help on this would be greatly appreciated!

Thanks.

Current unity forums post; here

----- EDIT ------

This is the exact code I have written into the terminal to try and sign and build the application. Is there anything wrong with this syntax? If not, why else is it giving the error message as above?

codesign -f -v -s "3rd Party Mac Developer Application: Robot Roadies Limited" "/Users/jasonhodges/RobotRoadiesMac2.app"

productbuild --component "/Users/jasonhodges/RobotRoadiesMac2.app" "/Applications" --sign "3rd Party Mac Developer Installer: Robot Roadies Limited" "/Users/jasonhodges/RobotRoadies.pkg"

Thanks!

A few thoughts:

  • It's definitely a bad idea to ever save any kind of code/script as an .rtf file. You should keep everything as plain text throughout every step of the process. I'm not sure what program to recommend (since I use vi), but I believe Unitron should work.

  • The error you're getting from the productbuild command probably has to do with one of a few things. It might be because you're not using quotes around a file name that has spaces. It might be because the file doesn't exist (I believe it's supposed to be an installer certificate that you download from apple's website). It might be because you didn't change the name to match your company name, app name, and/or certificate name.

  • Nobody is going to bother reading your perl code if you don't format it. However, if it's something somebody posted on the web, it probably works. Much like the commands from your link, it is probably meant to be altered to meet the needs of your specific app.

Submitting an app to the App Store might require some basic knowledge of using the command line (Terminal). You will almost always have to modify the commands and scripts that people are nice enough to share.

Since the command to build the installer is typically very long (possibly multiple lines) and often contains paths with spaces, it sometimes takes a few tries to get it right.

Hope this helps... Good luck!

 

EDIT:

After taking a closer look at your command syntax, it looks like you need a space between the n and the 3 near what should be the following (from your link):

--sign "3rd Party..."

If there are spaces in the path to your installer certificate (there usually are) you will also have to enclose the path in quotes.

The error message is telling you it doesn't recognize the option --sign3rdBlahBlahBlah. That's because the option is supposed to be sign. When you execute commands from the Terminal, you typcially pass command line options by putting a hyphen (or two hyphens) before letters and words. For example, you can pass the "ignore case" option to the grep command like this to search for the word funky in a file named Foo-File:

``` grep --ignore-case funky Foo-File

You can always learn more about a command by typing man command-name from the Terminal. For example, to learn about the command you're trying to use today, use the following:

$  man productbuild
```

 

I guess you made a mistake when you copied the command from your link.

That's why it's important to understand the basics of the terminal to... um... use the terminal!