How do you set the app icon for your Electron app?
I am trying BrowserWindow({icon:'path/to/image.png'});
but it does not work.
Do I need to pack the app to see the effect?
How do you set the app icon for your Electron app?
I am trying BrowserWindow({icon:'path/to/image.png'});
but it does not work.
Do I need to pack the app to see the effect?
Setting the icon
property when creating the BrowserWindow
only has an effect on Windows and Linux.
To set the icon on OS X, you can use electron-packager and set the icon using the --icon
switch.
It will need to be in .icns format for OS X. There is an online icon converter which can create this file from your .png.
Below is the solution that i have :
mainWindow = new BrowserWindow({width: 800, height: 600,icon: __dirname + '/Bluetooth.ico'});
You can do it for macOS, too. Ok, not through code, but with some simple steps:
Actually it is a general thing not specific to electron. You can change the icon of many macOS apps like this.