-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
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 theAssets.car
into the app's Resources folder. - Extend the
Info.plist
with aCFBundleIconName
key, 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.