Application Bundles

Native Mac OS X applications are delivered in packages known as application bundles. These packages contain the application’s executable code, images, sounds, icons, localizable strings, and other resources. An application, as shown in the Finder, is actually just a specific directory structure with a few additional attributes.

These application bundles are displayed in the Finder with a simple name (for example, TextEdit). Users can double-click on these application names, complete with colorful icons, and the system automatically launches the application. Alternatively, users can drop documents on the application, and the launched application will attempt to open the selected document.

For a developer, however, an application bundle is a directory with an .app suffix and a specific internal file structure. You can explore these bundles on your system from the Finder by Control-clicking on an application and selecting “Show Package Contents,” as shown in Figure 7-2.

Opening an application package

Figure 7-2. Opening an application package

Layout of an Application Bundle

Once you peel back the layers of an application bundle, you’ll find quite a few directories, each with several files. Figure 7-3 shows the structure of a typical application bundle for a Java application (in this case, the open source Java application PCGen; for more information on PCGen, visit http://sourceforge.net/projects/pcgen/ ...

Get Mac OS X for Java Geeks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.