Behaviors
Current (macOS 15)
To add an icon to a macOS app, all you have to do is to create an .icns file and stuff it in the app's Resources folder.
You can provide the .icns file to electron-builder, and it will automatically bundle and make it work with the app.
Soon (macOS 26)
Apple introduced a new way to create icons using Icon Composer. This is not a standard image format and has assets & layers bundled inside it.
However, this app creates .icon files which does not currently work with electron-builder.
Feature Request
Make .icon files work automatically with electron-builder. Provide it via electron-builder config, and automatically bundle it into the app.
Current Workaround
This method is a workaround for the issue, and can be used for electron-builder to automate this process.
- Create a Xcode project for a macOS app with the
.icon file configured as the app icon.
- Extract the
Assets.car from the app's Resources folder which contains the bundled app icons.
- Create a custom
afterPack hook which copies the Assets.car into the app's Resources folder.
- Extend the
Info.plist with a CFBundleIconName key, which point towards the App Icon inside the Assets.car. This is demonstrated below.
electron-builder.json:
{
"mac": {
"extendInfo": {
"CFBundleIconName": "AppIcon"
}
}
}
I have a sample of the workaround, which is implemented here.
Behaviors
Current (macOS 15)
To add an icon to a macOS app, all you have to do is to create an
.icnsfile and stuff it in the app's Resources folder.You can provide the
.icnsfile toelectron-builder, and it will automatically bundle and make it work with the app.Soon (macOS 26)
Apple introduced a new way to create icons using Icon Composer. This is not a standard image format and has assets & layers bundled inside it.
However, this app creates
.iconfiles which does not currently work withelectron-builder.Feature Request
Make
.iconfiles work automatically withelectron-builder. Provide it via electron-builder config, and automatically bundle it into the app.Current Workaround
.iconfile configured as the app icon.Assets.carfrom the app's Resources folder which contains the bundled app icons.afterPackhook which copies theAssets.carinto the app's Resources folder.Info.plistwith aCFBundleIconNamekey, which point towards the App Icon inside theAssets.car. This is demonstrated below.electron-builder.json:
{ "mac": { "extendInfo": { "CFBundleIconName": "AppIcon" } } }I have a sample of the workaround, which is implemented here.