How to change app icon in electron
Issue #66
Generate icns
- Generate
.iconset
- Run
iconutil -c icns "Icon.iconset"
. Note that icon names must be first letter lowsercased, and use_
instead of-
Use icns
- In
main.js
, specifyicon
1 | win = new BrowserWindow({ |
You can also use helper url methods
1 | const path = require('path') |
If app icon is not updated
- I get a problem that electron always shows default app icon. I tried using
png
,NativeImage
, different icon sizes but still the problem. When I useelectron-packager
to make release build, the icon shows correctly, so it must be because of Electron caching or somehow 😠- Go to
node_modules -> electron -> dist
, right click onElectron
, chooseView Info
- Drag another
icns
into the icon on the top left
Release with electron-packager
icon
must be specified with__dirname
(we already did) forelectron-packager
to pick up correct icons
Updated at 2020-09-26 18:02:30