Skip to content

App Bundle

Carlos Hernandez edited this page Jul 13, 2026 · 1 revision

App Bundle (.app)

embala's .app backend does one small, honest thing: it lays out a macOS application bundle around an executable you built. It never compiles, links, or lipos anything, and it renders exactly one asset — a .icns from your PNG. Everything else in the bundle is metadata copied straight out of embala.toml.

The bundle is a plain directory named <display-name>.app, written to the output directory (dist/ by default). It is unsigned — see Limitations and Code-Signing for what that means for your users.

Build it:

embala build --formats app

Requesting app with no [app] section in the config is a clear error, not a crash. See Getting-Started for the end-to-end flow and Configuration-Reference for the full schema.

What you get

A directory bundle with this layout:

<display-name>.app/
└── Contents/
    ├── Info.plist
    ├── MacOS/
    │   └── <name>              # your executable, copied verbatim
    └── Resources/
        └── <display-name>.icns # only when an icon is configured
Path Comes from
<display-name>.app [package].display-name
Contents/MacOS/<name> your [app].executable, renamed to [package].name
Contents/Resources/<display-name>.icns [app].icon or [package].icon (omitted if neither is set)

The executable is renamed to [package].name inside the bundle regardless of what the source file on disk is called, and it is always marked executable.

Configuration

The [app] section is small:

[app]
executable = "dist/hello"          # path to the Mach-O, relative to the config file
icon = "icon.png"                  # optional; PNG only
minimum-system-version = "11.0"    # optional; becomes LSMinimumSystemVersion
Key Required Meaning
executable yes Path (relative to the config file) to the Mach-O to bundle.
icon no Path (relative to the config file) to a PNG. Falls back to [package].icon.
minimum-system-version no Written verbatim as LSMinimumSystemVersion. Omitted when unset.

All identity and version metadata comes from the shared [package] block, not from [app].

Info.plist

embala writes a fixed, deterministic set of keys — no wall-clock input, so two builds of the same config produce byte-identical output. Each key maps to config as follows:

Info.plist key Value Source
CFBundleName display name [package].display-name
CFBundleDisplayName display name [package].display-name
CFBundleIdentifier reverse-DNS identifier [package].identifier
CFBundleVersion version string [package].version
CFBundleShortVersionString version string [package].version
CFBundleExecutable executable name [package].name
CFBundlePackageType APPL (constant) —
CFBundleSignature ???? (unregistered creator code) —
CFBundleIconFile <display-name>.icns written only when an icon is bundled
LSMinimumSystemVersion e.g. 11.0 [app].minimum-system-version, only when set

That is the whole plist. embala writes nothing more — no LSApplicationCategoryType, no NSHighResolutionCapable, no document types. If you need extra keys, that is not in scope (see Limitations).

Note that [package].version must be numeric x.y.z (the MSI backend requires it), so both CFBundleVersion and CFBundleShortVersionString carry that same value.

Icon pipeline

If an icon is configured, embala decodes the PNG and renders it into the full standard .icns size set — 16, 32, 64, 128, 256, and 512 point icons plus the @2x retina variants the format defines — resizing with Lanczos filtering. The result lands at Contents/Resources/<display-name>.icns and CFBundleIconFile is set to match.

Precedence and rules:

Situation Result
[app].icon set that PNG is used
[app].icon absent, [package].icon set the package-level icon is used as fallback
neither set the bundle ships without an icon (no CFBundleIconFile)
the file is not a PNG the build fails — embala only decodes PNG

embala does not author or convert icons beyond PNG→icns. Bring a PNG (a large, square one — everything is resized down from your single source image).

You supply the Mach-O

The executable is copied into the bundle verbatim. embala does no architecture inspection: it never runs lipo, never validates the file is even a Mach-O, and never merges or thins slices. This is deliberate — you own the build.

  • Fat / universal binaries are welcome. Build your x86_64 + arm64 universal binary however you like and point [app].executable at it; embala lays it out unchanged.
  • No arch validation. Whatever bytes you supply are what ships. If you hand it the wrong-arch binary, the bundle builds fine and fails at launch on the target Mac — that check is yours to make.

macOS 26 note: CFBundleExecutable must be a real Mach-O

Because the file is copied verbatim, you can point [app].executable at a shell script and get a bundle that builds. Do not ship that: on macOS 26, LaunchServices refuses to launch a bundle whose CFBundleExecutable is a script-backed executable, so it won't open via Finder or open. The main executable must be a genuine Mach-O binary. (Code signing enforces the same requirement — see Code-Signing.)

Signing and Gatekeeper

The bundle is unsigned. A .app downloaded through a browser gets a com.apple.quarantine attribute, and Gatekeeper blocks an unsigned quarantined bundle from opening on first launch. The full expectations — what each certificate type actually changes, and how to sign — are in Code-Signing.

Limitations

These are scope decisions for v1, not bugs:

  • Single executable only. The bundle carries exactly one file under Contents/MacOS/ plus the optional icon. There is no mechanism for extra resources, embedded frameworks, helper tools, or additional Contents/ files. If your app needs a bundled framework, that is out of scope.
  • No configurable Info.plist keys. You get the fixed key set documented above and nothing else.
  • No DMG output. embala does not produce a .dmg. Ship the .app directory however you distribute files (zip it, put it in a .pkg — see Pkg, etc.).
  • Rebuilds replace the bundle wholesale. If a <display-name>.app directory already exists in the output directory, embala deletes it and recreates it from scratch on each build, so stale files never accrete. Do not keep anything you care about inside the output bundle — treat it as build output, not storage.
  • Unsigned. Signing and notarization are handled by the separate [sign] mechanism; see Code-Signing.

Clone this wiki locally