App icons for Electron and Tauri: .icns, .ico and PNG
Desktop apps need an icon file per platform: .icns for macOS, .ico for Windows, PNG for Linux. Where Electron and Tauri expect them, and how to make the set.
Mobile stores tell you exactly what they want. Desktop app tooling is looser, and the usual result is a default Electron or Tauri logo in someone's Dock because the icon path was wrong. Each platform wants its own format.
The three formats
| Platform | Format | Contents |
|---|---|---|
| macOS | .icns | 16 to 512 points at 1x and 2x, inset shape and shadow |
| Windows | .ico | Several sizes in one file: 16, 24, 32, 48, 64, 128, 256 |
| Linux | .png | 512 or 1024 square |
The Mac icon is not the same artwork as the Windows one: macOS expects the rounded body inset in the canvas with a shadow, while Windows icons usually fill more of the square. See the macOS app icon shape.
Tauri
npm run tauri icon ./app-icon.png
# writes src-tauri/icons/: icon.icns, icon.ico, PNGs and moreThe source should be square and at least 1024 pixels, with transparency. tauri.conf.json lists the generated files under bundle.icon.
Electron
- electron-builder: put
icon.icns,icon.icoandicon.pngin thebuild/folder, or setmac.icon,win.iconandlinux.iconin its config. - Electron Forge: set
packagerConfig.iconto a path without an extension, such asassets/icon, and provideassets/icon.icnsandassets/icon.ico. - Window icon on Linux and Windows during development: pass
icontoBrowserWindow.
Check after packaging
Icons are cached aggressively by macOS and Windows. After replacing one, rebuild and test on a clean install, or the old icon can linger in the Dock or taskbar. The app should also look native once it opens; a native macOS look in Tauri and Electron covers the window itself.
App Icon Foundry exports a macOS icon with the correct inset shape alongside the other platforms' files, from one design, ready for Tauri's or Electron's tooling to package.
Questions
What icon formats does a desktop app need?
An .icns file for macOS, an .ico file containing several sizes up to 256 pixels for Windows, and PNGs for Linux, typically 512 pixels or larger.
How does Tauri generate icons?
The Tauri CLI has an icon command. Give it a square PNG of at least 1024 pixels, or an SVG, and it writes the platform icons into src-tauri/icons, which tauri.conf.json already points at.
Where does Electron look for the app icon?
It depends on the packager. electron-builder looks in the build folder for icon.icns, icon.ico and icon.png by default; Electron Forge takes a packagerConfig icon path without an extension and picks the right file per platform.