In
NeXTSTEP
NeXTSTEP is a discontinued object-oriented, multitasking operating system based on the Mach kernel and the UNIX-derived BSD. It was developed by NeXT Computer in the late 1980s and early 1990s and was initially used for its range of proprieta ...
,
OPENSTEP
OpenStep is a defunct object-oriented application programming interface (API) specification for a legacy object-oriented operating system, with the basic goal of offering a NeXTSTEP-like environment on non-NeXTSTEP operating systems. OpenStep was ...
,
GNUstep
GNUstep is a free software implementation of the Cocoa (formerly OpenStep) Objective-C frameworks, widget toolkit, and application development tools for Unix-like operating systems and Microsoft Windows. It is part of the GNU Project.
GNUste ...
, and their lineal descendants
macOS
macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and lapt ...
and
iOS
iOS (formerly iPhone OS) is a mobile operating system created and developed by Apple Inc. exclusively for its hardware. It is the operating system that powers many of the company's mobile devices, including the iPhone; the term also includes ...
, a bundle is a file
directory
Directory may refer to:
* Directory (computing), or folder, a file system structure in which to store computer files
* Directory (OpenVMS command)
* Directory service, a software application for organizing information about a computer network's u ...
with a defined structure and file extension, allowing related files to be grouped together as a conceptually single item.
Examples of bundles that contain executable code include
applications
Application may refer to:
Mathematics and computing
* Application software, computer software designed to help the user to perform specific tasks
** Application layer, an abstraction layer that specifies protocols and interface methods used in a c ...
,
frameworks
A framework is a generic term commonly referring to an essential supporting structure which other things are built on top of.
Framework may refer to:
Computing
* Application framework, used to implement the structure of an application for an op ...
, and
plugins. This kind of bundle usually contains one file representing executable code, and files that represent resources such as
nibs, templates, images, sounds, and other media. On some other systems, such as
Microsoft Windows
Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
, these resources are usually included directly in the executable file itself at compile time. On older Macintoshes, a similar technique is used, where additional
metadata
Metadata is "data that provides information about other data", but not the content of the data, such as the text of a message or the image itself. There are many distinct types of metadata, including:
* Descriptive metadata – the descriptive ...
can be added to a file's
resource fork The resource fork is a fork or section of a file on Apple's classic Mac OS operating system, which was also carried over to the modern macOS for compatibility, used to store structured data along with the unstructured data stored within the data f ...
. Similar in concept are the
application directories used in
RISC OS
RISC OS is a computer operating system originally designed by Acorn Computers Ltd in Cambridge, England. First released in 1987, it was designed to run on the ARM chipset, which Acorn had designed concurrently for use in its new line of Archim ...
and on the
ROX Desktop
The ROX Desktop is a graphical desktop environment for the X Window System. It is based on the ROX-Filer which is a drag and drop spatial file manager. It is free software released under the GNU General Public License. The environment was ins ...
.
Examples of bundles that do not contain executable code include document packages (
iWork
iWork is an office suite of applications created by Apple Inc. for its macOS and iOS operating systems, and also available cross-platform through the iCloud website.
It includes the presentation application Keynote, the word processing and ...
documents) and media libraries (
iPhoto
iPhoto is a discontinued digital photograph manipulation software application developed by Apple Inc. It was included with every Macintosh personal computer from 2002 to 2015, when it was replaced with Apple's Photos application. Originally so ...
Library).
Bundles are programmatically accessed with the
NSBundle
class in
Cocoa
Cocoa may refer to:
Chocolate
* Chocolate
* ''Theobroma cacao'', the cocoa tree
* Cocoa bean, seed of ''Theobroma cacao''
* Chocolate liquor, or cocoa liquor, pure, liquid chocolate extracted from the cocoa bean, including both cocoa butter and ...
, NeXTSTEP and GNUstep's
Foundation
Foundation may refer to:
* Foundation (nonprofit), a type of charitable organization
** Foundation (United States law), a type of charitable organization in the U.S.
** Private foundation, a charitable organization that, while serving a good cause ...
frameworks, and with
CFBundle
in
Core Foundation
Core Foundation (also called CF) is a C application programming interface (API) written by Apple for its operating systems, and is a mix of low-level routines and wrapper functions. Most Core Foundation routines follow a certain naming conventi ...
. Bundles often include an file for metadata. The
Uniform Type Identifier
A Uniform Type Identifier (UTI) is a text string used on software provided by Apple Inc. to uniquely identify a given class or type of item. Apple provides built-in UTIs to identify common system objects – document or image file types, folders a ...
(UTI) for an Apple bundle is
com.apple.bundle
.
Application bundles
Application bundles are directory hierarchies, with the top-level directory having a name that ends with a
.app
extension. In an application bundle, the first directory in the bundle underneath the top-level directory is usually named
Contents
. Within
Contents
there is usually another directory (called
MacOS
on Macs), which contains the application's executable code. Within the
Contents
folder there is usually also a directory called
Resources
, which contains the resources of the application.
Among other things, the
Resources
folder contains localized versions of the application's
nib files.
Other common subdirectories include
Plugins
,
Frameworks
, and
Shared Frameworks
. The
Frameworks
directory contains frameworks used by the application, and are used even if another version of the framework exists on the system. The
Shared Frameworks
directory contains frameworks that can be used both by the application that contains them, and other applications; they are used only if a newer version does not exist elsewhere on the system.
Plugins
contains extensible code used by the application.
By default, the
Finder displays application bundles, which can also be referred to as
packages
Package may refer to:
Containers or Enclosures
* Packaging and labeling, enclosing or protecting products
* Mail, items larger than a letter
* Chip package or chip carrier
* Electronic packaging, in electrical engineering
* Automotive package, ...
, as opaque files with no underlying structure; the contents of the bundle can be shown with the "Show Package Contents"
context menu
A context menu (also called contextual, shortcut, and pop up or pop-up menu) is a menu in a graphical user interface (GUI) that appears upon user interaction, such as a right-click mouse operation. A context menu offers a limited set of choic ...
item.
GNUstep by default uses the name of the application to name the folder that contains application code. An alternative is to name them by the computer architecture and OS the code is intended for to form a
fat binary
A fat binary (or multiarchitecture binary) is a computer executable program or library which has been expanded (or "fattened") with code native to multiple instruction sets which can consequently be run on multiple processor types. This results ...
, so the application can be opened on many platforms.
macOS framework bundles
macOS frameworks are also stored as bundles; the top-level directory of a framework bundle has a name that is the name of the framework followed by the extension
.framework
. In the top-level directory is a
Versions
directory, with subdirectories for one or more versions of the framework, each subdirectory containing the dynamic library code for the framework, in a file whose name is the same as the name of the framework, possibly with a
Headers
folder containing
header file
Many programming languages and other computer files have a directive, often called include (sometimes copy or import), that causes the contents of the specified file to be inserted into the original file. These included files are called copybooks ...
s for the framework, and other subfolders such as
Resources
. The
Versions
directory also contains a symbolic link
Current
to the directory for the current version of the framework. In the top-level directory are symbolic links to the contents of
Versions/Current
.
The
Finder displays framework bundles as directories rather than as opaque files.
Although GNUstep uses frameworks, they are not usually stored as bundles. This is because the full semantics of framework loading are considered too alien to other platforms.
Loadable bundles
Loadable bundles are bundles which contain code that can be loaded at runtime. Loadable bundles usually have the extension
.bundle
, and are most often used as
plug-ins. On macOS, there is a way to load bundles even into applications that do not support them, allowing for third party hacks for popular applications, such as
Safari
A safari (; ) is an overland journey to observe wild animals, especially in eastern or southern Africa. The so-called "Big Five" game animals of Africa – lion, leopard, rhinoceros, elephant, and Cape buffalo – particularly form an importa ...
and
Apple Mail
Apple Mail (officially known as Mail) is an email client included by Apple Inc. with its operating systems macOS, iOS, iPadOS and watchOS. Apple Mail grew out of NeXTMail, which was originally developed by NeXT as part of its NeXTSTEP operati ...
.
A feature inherited from NeXTSTEP, GNUstep has the interface too.
By default, the
Finder displays loadable bundles, which can also be referred to as
packages
Package may refer to:
Containers or Enclosures
* Packaging and labeling, enclosing or protecting products
* Mail, items larger than a letter
* Chip package or chip carrier
* Electronic packaging, in electrical engineering
* Automotive package, ...
, as opaque files with no underlying structure; the contents of the bundle can be shown with the "Show Package Contents"
context menu
A context menu (also called contextual, shortcut, and pop up or pop-up menu) is a menu in a graphical user interface (GUI) that appears upon user interaction, such as a right-click mouse operation. A context menu offers a limited set of choic ...
item.
Other bundle formats
There are many third-party macOS applications which utilize their own custom bundle format (e.g.
CandyBar
A candy bar is a type of candy that is in the shape of a bar. The most common type of candy bar is the chocolate bar, including both bars made of solid chocolate and combination candy bars, which are candy bars that combine chocolate with other ...
.iContainer
,
Aperture
In optics, an aperture is a hole or an opening through which light travels. More specifically, the aperture and focal length of an optical system determine the cone angle of a bundle of rays that come to a focus in the image plane.
An opt ...
.aplibrary
,
VMware Fusion
VMware Fusion is a software hypervisor developed by VMware for Mac computers. VMware Fusion allows Macs with Intel or the Apple M series of chips to run virtual machines with guest operating systems, such as Microsoft Windows, Linux, or macOS, ...
.vmwarevm
, etc.).
.lproj
An .lproj file is a bundle that contains
localization
Localization or localisation may refer to:
Biology
* Localization of function, locating psychological functions in the brain or nervous system; see Linguistic intelligence
* Localization of sensation, ability to tell what part of the body is a ...
files for OpenStep, macOS, or GNUstep software. It typically contains the
.nib
Interface Builder is a software development application for Apple's macOS operating system. It is part of Xcode (formerly Project Builder), the Apple Developer developer's toolset. Interface Builder allows Cocoa and Carbon developers to cr ...
files for a given language along with
.strings
files and images if needed (for example,
ReadMe
In software development, a README file contains information about the other files in a directory or archive of computer software. A form of documentation, it is usually a simple plain text file called README, Read Me, READ.ME, README.TXT, R ...
or license files). These localized files are used by installer makers to customize install packages. They are also included in an application bundle.
See also
*
Application Directory
An application directory is a grouping of software code, help files and resources that together comprise a complete software package but are presented to the user as a single object.
They are currently used in RISC OS and the ROX Desktop, and a ...
— the
RISC OS
RISC OS is a computer operating system originally designed by Acorn Computers Ltd in Cambridge, England. First released in 1987, it was designed to run on the ARM chipset, which Acorn had designed concurrently for use in its new line of Archim ...
analogue to an application bundle
*
AppImage
AppImage is a format for distributing portable software on Linux without needing superuser permissions to install the application. It tries also to allow Linux distribution-agnostic binary software deployment for application developers, als ...
— A Linux application that makes use of similar principles
References
External links
Bundle Programming Guideat Apple Developer Connection
from the GNUstep project
Platypus— a tool to create application bundles around scripts
File extension details
{{DEFAULTSORT:Application Bundle
NeXT
MacOS
MacOS development
GNUstep