Application bundle
A pattern where we bundle the executable along with supporting files in a directory that looks like the application itself, at least in the Finder, as it has an .app suffix and as it comes with special behaviour and appearance:
- The double-click runs the program instead of opening the directory
- Finder shows the application's icon instead of a directory icon.
The content is semi-standardized. It includes
- the icons
- the internationalization strings
- metadata about the app
- frameworks and libraries, separated from the executable.
ls -1p "/Applications/Google Chrome.app/Contents/"
Frameworks/
Library/
Resources/
_CodeSignature/
MacOS/
Info.plist
PkgInfo
Such content should be treated as read-only, as tampering it triggers a signature change and security measures that prevent the executable from running.
The application's dynamic data and preferences are stored outside the bundle.