As discussed in “Code Requirements,” the system often uses the Info.plist file of an application bundle to determine the code’s designated requirement. Although single-file tools don’t normally have an Info.plist, you can add one. To do so, use the following procedure:
Add an Info.plist file to your project (including adding it to your source control.
Make sure the Info.plist file has the following keys:
CFBundleIdentifier
CFBundleName
The value for CFBundleIdentifier must be unique; it is used as the default unique name of your program for Code Signing purposes. To ensure uniqueness, you can include your company’s name in the value. The usual form for this identifier is a hierarchical name in reverse DNS notation, starting with the company name, followed by the organization in the company, and ending with the product name. For example, the identifier for the codesign tool is com.apple.security.codesign.
The value for CFBundleName shows up in system dialogs as the name of your program, so it should correspond to your marketing name for the product.
Add the following arguments to your link command:
-sectcreate __TEXT __info_plist Info.plist_path
where Info.plist_path is the path to the Info.plist file in your project.
In Xcode, use the OTHER_LDFLAGS build variable.
For example, here are the contents of the Info.plist file of the codesign tool.:
<plist version="1.0"> |
<dict> |
<key>CFBundleDevelopmentRegion</key> |
<string>English</string> |
<key>CFBundleIdentifier</key> |
<string>com.apple.security.codesign</string> |
<key>CFBundleInfoDictionaryVersion</key> |
<string>6.0</string> |
<key>CFBundleName</key> |
<string>codesign</string> |
<key>CFBundleVersion</key> |
<string>0.3</string> |
</dict> |
</plist> |
Last updated: 2007-05-15