Mac app store productbuild

hotpaw2 picture hotpaw2 · Nov 7, 2011 · Viewed 9.4k times · Source

Apple's document on submitting an app to the Mac App store contains this example use of the command productbuild, from in /Developer/usr/bin/.

productbuild \
--component build/Release/Sample.app /Applications \
--sign "3rd Party Mac Developer Installer: Name1 Name2" \
--product product_definition.plist Sample.pkg

When I run this command on my Sample app, I get the error:

productbuild: error: No product definition plist found at "product_definition.plist".

What is this product_definition.plist, where should it come from, what should be inside it, and what tool should be used to create this plist?

Answer

djromero picture djromero · Nov 15, 2011

From the Apple document you linked: "You should specify a single component, a signature, and (optionally) a product definition file."

Unless you have a specific requirement, you don't need a product definition file. If you need it, the man page of productbuild has a lot of information. It is just a plist dictionary, like this example:

<?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>gl-renderer</key>
    <string>( 'GL_APPLE_float_pixels' IN extensions )</string>
</dict>
</plist>

I've verified that Xcode doesn't use a product definition file when you share an archived application as package. This is the actual command line:

/usr/bin/productbuild --component <path-to-xcarchive>/Cool.app 
                      /Applications 
                      <tmp-path>/package.pkg 
                      --sign 3rd Party Mac Developer Installer