Author: Mark Szymczyk
Last Update: May 9, 2007
This article provides an introduction to Mac OS X application bundles, showing you how to create an application bundle, add files and folders to the bundle, and retrieve files from the bundle.
A bundle is a directory. That’s all it is: a directory. A package wraps a bundle so the bundle looks like a single file instead of a directory. The most common bundle is an application bundle, which contains an executable file and the external files the application uses. A game’s external files include graphics files, sound files, and data files like levels.
Most Mac OS X GUI applications are application bundles. Application bundles are packages, which provides a major benefit for software developers. Packages appear to the user as a single file so he or she can’t accidentally delete or rename the external files your application needs to run.
Because most Mac OS X applications are application bundles, there are many examples for you to look at. To examine an application bundle, select an application from the Finder and control-click. A contextual menu will open. Choose Show Package Contents.
When you examine an application bundle, the top folder is named Contents, which holds the contents of the bundle. What lies underneath the Contents folder depends on the application, but there will be a minimum of four items.
If you look inside an application’s Resources folder, you can see what spoken languages the application supports. There will be a folder with the extension .lproj for each language the application supports.
More complicated applications pack more folders into their bundles. Xcode has a Plugins folder that contains Xcode’s plugins. iTunes has a Frameworks folder that contains the code frameworks iTunes uses.
Next (Creating Bundles)