Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Adding an Info.plist to Single-File Tools

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:

  1. Add an Info.plist file to your project (including adding it to your source control.

  2. Make sure the Info.plist file has the following keys:

    • CFBundleIdentifier

    • CFBundleName

  3. 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.

  4. 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.

  5. 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>


< Previous PageNext Page > Hide TOC


Last updated: 2007-05-15




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice