Nifty fractal

Anatomy of an App Bundle

I recently needed to use CMake to generate macOS app bundles, and I had a really hard time getting the icon to work (macOS 10.14). No matter what I did, the icon just would not show up, although strangely, it did work on my old 10.10 laptop. This led me to a journey into the macOS bundle.   App bundle directory
   Info.plist See below
PkgInfo Obsolete; only used by Carbon
   AppIcon.icns App icon for 10.12 and before All icons (including app icon) 10.13 and later
en.lproj/ Localizations
Frameworks/ Any shared libraries included in the bundle
MacOS/ Executables
AppName Main executable
external_tool Helper executable

Required app/document icon sizes

512x512 (1x and 2x)App Store, Finder in icon view
256x256 (1x and 2x)Finder
128x128 (1x and 2x)Finder, Dock
32x32 (1x and 2x)Finder list views
16x16 (1x and 2x)Spotlight

The Info.plist is something like the following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN” “">
<plist version="1.0">
    <!— Boilerplate -->
    <key>CFBundleInfoDictionaryVersion</key> <!— always 6.0 -->

    <!— Name of bundle. Used if CFBundleDisplayName does not exist.
         Should be 16 characters or less -->

    <!— Name of executable file (in case the user renames the bundle) -->


    <!— Obsolete (macOS 10.12-). Name of the .icns file containing the
         app icon, located in the Resources/ directory. The “.icns” extension
         is not necessary. By default this value is “AppIcon”. -->
    <!— macOS 10.13+: name of the icon in the Resources/ file.
         If this key exists but the Resources/ file does not exist,
         the CFBundleIconFile (usually AppIcon.icns) will NOT be used and
         you will get the default application icon. -->


    <!— Version keys -->

    <!— Optional; displayed in Finder’s Get Info command -->
    <string>Copyright (C) 2020 by Geoff Prewett</string>

    <!— Optional; sets the default language -->

    <!— Optional; sets the content types that this application can handle -->
            <string>documentIcon</string> <!— .icns file -->
            <string>Comma-separated values</string>

    <!— Optional; describes existing content types (not defined by this
         application. (The system already knows about CSV files, but this
         is an example of what its definition might look like.) -->
            <string>Comma-separated values</string>

Helpful information: