Tauri App Icon: Set Icons for Windows, macOS, Linux
You've built a Tauri app, but the default icon still shows in the taskbar. Or maybe you're about to ship and realize the dock icon is a generic placeholder. Setting a proper Tauri app icon is straightforward once you know where the files go and how the config references them. This guide walks you through the exact steps for Windows, macOS, and Linux, using Tauri's built-in icon generator and the tauri.conf.json configuration.
Prerequisites
Before you start, make sure you have:
A Tauri project (v1 or v2) already set up.
Node.js and npm installed (or your preferred package manager).
A square source image, ideally 1024×1024 PNG with transparency. SVG works too, but PNG is safer for the generator.
If you need a high-quality source icon, you can create one from your existing logo or favicon using Mzu favicondl — it exports clean PNGs at multiple sizes.
Step 1: Generate the icon set
Tauri provides a CLI command that takes a single source image and produces all the platform-specific formats: .ico for Windows, .icns for macOS, and various PNGs for Linux and mobile. Run this from your project root:
npm run tauri icon path/to/your-icon.png
If you're using Tauri v1, the command is npm run tauri icon as well, but check your package.json scripts. The generator writes files into src-tauri/icons/ by default. You'll see files like 32x32.png, 128x128.png, icon.icns, and icon.ico.
Tip: The source image should have a transparent background and a clear silhouette. Avoid text or fine details — they won't survive at 16×16 or 32×32. For design guidance, see our favicon design tips (the same principles apply to app icons).
Step 2: Configure tauri.conf.json
Open src-tauri/tauri.conf.json and locate the bundle section. Under icon, list the paths to the generated icons. Tauri v2 uses a slightly different structure than v1, but the concept is the same.
Make sure the paths are relative to src-tauri/. If you moved the icons elsewhere, update the paths accordingly.
Step 3: Verify platform-specific behavior
Each OS uses a different file from the list. Here's what matters:
Windows: Uses icon.ico for the executable, taskbar, and Start menu. The ICO should contain multiple sizes (16, 32, 48, 256). The Tauri generator handles this.
macOS: Uses icon.icns for the dock and Finder. The ICNS format includes multiple resolutions up to 1024×1024.
Linux: Uses the PNGs (typically 32x32, 128x128, 128x128@2x) for the app launcher and window manager. Some desktop environments also read icon.png from the bundle.
If you're building for mobile (iOS/Android), the generator also creates appropriate assets, but those are outside the scope of this guide.
Step 4: Rebuild and test
After updating the config, rebuild your app:
npm run tauri build
Then install or run the built executable. Check the taskbar (Windows), dock (macOS), or application menu (Linux) to confirm the icon appears. On Windows, you may need to clear the icon cache if the old icon persists — a known quirk. For macOS, sometimes the dock caches icons; logging out and back in resolves it.
Common pitfalls
Wrong path in config: Tauri will fail to bundle if the icon file doesn't exist. Double-check the relative paths.
Missing ICO sizes: If you manually create an ICO, ensure it includes 16, 32, 48, and 256 pixel layers. The Tauri generator does this correctly.
Transparent background issues: On Windows, fully transparent areas may appear black in some contexts. Use a solid background if you see artifacts.
Forgetting to rebuild: Changing the icon requires a full rebuild; hot reload won't update the native icon.
macOS ICNS format: If you supply a PNG instead of ICNS, macOS may ignore it. Always use the generated icon.icns.
Conclusion
Setting a Tauri app icon is a three-step process: generate the icon set with tauri icon, reference the files in tauri.conf.json, and rebuild. The built-in generator saves you from manually creating ICO and ICNS files. Keep your source image simple and square, and verify the icon on each target platform. For more on icon formats and best practices, explore our favicon best practices — many principles carry over to app icons.
Check the documented requirements
The HTML Standard defines rel='icon' as the link relationship for an icon representing the current page.
你已经用 Tauri 构建了一个应用,但任务栏里显示的仍然是默认图标。或者你正准备发布,却发现 Dock 图标是个通用占位符。只要搞清楚文件该放哪儿、配置怎么引用,设置一个像样的 Tauri 应用图标其实并不复杂。本文会带你走完 Windows、macOS 和 Linux 上的具体步骤,用的是 Tauri 自带的图标生成器和 tauri.conf.json 配置。
Tauri v1を使用している場合もコマンドはnpm run tauri iconですが、package.jsonのスクリプトを確認してください。ジェネレーターはデフォルトでsrc-tauri/icons/にファイルを書き込みます。32x32.png、128x128.png、icon.icns、icon.icoなどのファイルが生成されます。
HTML Standardは、現在のページを表すアイコンのリンク関係としてrel='icon'を定義しています。
Tauri 앱을 만들었는데 작업 표시줄에 여전히 기본 아이콘이 보이나요? 아니면 출시를 앞두고 독 아이콘이 일반 플레이스홀더라는 걸 깨달았나요? 파일을 어디에 두고 설정에서 어떻게 참조하는지만 알면 Tauri 앱 아이콘을 제대로 설정하는 일은 간단합니다. 이 가이드에서는 Tauri의 내장 아이콘 생성기와 tauri.conf.json 설정을 사용해 Windows, macOS, Linux에서 정확한 단계를 안내합니다.
사전 준비
시작하기 전에 다음을 확인하세요:
이미 설정된 Tauri 프로젝트(v1 또는 v2).
Node.js와 npm 설치(또는 선호하는 패키지 관리자).
정사각형 소스 이미지, 이상적으로는 투명 배경의 1024×1024 PNG. SVG도 작동하지만 생성기에는 PNG가 더 안전합니다.
고품질 소스 아이콘이 필요하다면 기존 로고나 favicon에서 Mzu favicondl을 사용해 만들 수 있습니다. 여러 크기의 깔끔한 PNG로 내보내 줍니다.
1단계: 아이콘 세트 생성
Tauri는 단일 소스 이미지를 받아 모든 플랫폼별 형식을 생성하는 CLI 명령을 제공합니다. Windows용 .ico, macOS용 .icns, Linux 및 모바일용 다양한 PNG입니다. 프로젝트 루트에서 다음을 실행하세요:
npm run tauri icon path/to/your-icon.png
Tauri v1을 사용 중이라면 명령은 역시 npm run tauri icon이지만 package.json 스크립트를 확인하세요. 생성기는 기본적으로 src-tauri/icons/에 파일을 씁니다. 32x32.png, 128x128.png, icon.icns, icon.ico 같은 파일이 보일 것입니다.
팁: 소스 이미지는 투명 배경과 명확한 실루엣을 가져야 합니다. 텍스트나 세밀한 디테일은 피하세요. 16×16이나 32×32에서는 살아남지 못합니다. 디자인 가이드는 favicon 디자인 팁을 참고하세요(동일한 원칙이 앱 아이콘에도 적용됩니다).
2단계: tauri.conf.json 설정
src-tauri/tauri.conf.json을 열고 bundle 섹션을 찾으세요. icon 아래에 생성된 아이콘의 경로를 나열합니다. Tauri v2는 v1과 구조가 약간 다르지만 개념은 같습니다.
경로가 src-tauri/를 기준으로 상대 경로인지 확인하세요. 아이콘을 다른 곳으로 옮겼다면 경로도 그에 맞게 수정해야 합니다.
3단계: 플랫폼별 동작 확인
각 OS는 목록에서 서로 다른 파일을 사용합니다. 중요한 점은 다음과 같습니다.
Windows: 실행 파일, 작업 표시줄, 시작 메뉴에 icon.ico를 사용합니다. ICO 파일에는 여러 크기(16, 32, 48, 256)가 포함되어야 합니다. Tauri 생성기가 이를 처리합니다.
macOS: Dock과 Finder에 icon.icns를 사용합니다. ICNS 형식은 최대 1024×1024까지 여러 해상도를 포함합니다.
Linux: 앱 런처와 창 관리자에 PNG 파일(일반적으로 32x32, 128x128, 128x128@2x)을 사용합니다. 일부 데스크톱 환경은 번들에서 icon.png도 읽습니다.
모바일(iOS/Android)용으로 빌드하는 경우 생성기가 적절한 에셋도 만들지만, 이 가이드의 범위를 벗어납니다.
4단계: 재빌드 및 테스트
설정을 업데이트한 후 앱을 다시 빌드하세요.
npm run tauri build
그런 다음 빌드된 실행 파일을 설치하거나 실행하세요. 작업 표시줄(Windows), Dock(macOS), 애플리케이션 메뉴(Linux)에서 아이콘이 표시되는지 확인하세요. Windows에서는 이전 아이콘이 남아 있을 경우 아이콘 캐시를 지워야 할 수 있습니다. 이는 알려진 특이 사항입니다. macOS에서는 Dock이 아이콘을 캐시하는 경우가 있는데, 로그아웃했다가 다시 로그인하면 해결됩니다.
흔한 함정
설정의 잘못된 경로: 아이콘 파일이 존재하지 않으면 Tauri는 번들링에 실패합니다. 상대 경로를 다시 확인하세요.
ICO 크기 누락: ICO를 직접 만들 경우 16, 32, 48, 256픽셀 레이어를 포함해야 합니다. Tauri 생성기는 이를 올바르게 처리합니다.
투명 배경 문제: Windows에서는 완전히 투명한 영역이 일부 상황에서 검게 보일 수 있습니다. 아티팩트가 보이면 단색 배경을 사용하세요.
재빌드 누락: 아이콘을 변경하려면 전체 재빌드가 필요합니다. 핫 리로드는 네이티브 아이콘을 업데이트하지 않습니다.
macOS ICNS 형식: ICNS 대신 PNG를 제공하면 macOS가 이를 무시할 수 있습니다. 항상 생성된 icon.icns를 사용하세요.
결론
Tauri 앱 아이콘 설정은 세 단계로 이루어집니다: tauri icon으로 아이콘 세트를 생성하고, tauri.conf.json에서 파일을 참조한 뒤, 재빌드합니다. 내장 생성기를 사용하면 ICO와 ICNS 파일을 수동으로 만들 필요가 없습니다. 소스 이미지는 단순하고 정사각형으로 유지하고, 각 대상 플랫폼에서 아이콘을 확인하세요. 아이콘 형식과 모범 사례에 대해 더 알아보려면 favicon 모범 사례를 살펴보세요. 많은 원칙이 앱 아이콘에도 적용됩니다.
문서화된 요구 사항 확인
HTML 표준은 현재 페이지를 나타내는 아이콘의 링크 관계로 rel='icon'을 정의합니다.
Has creado una app con Tauri, pero el icono predeterminado sigue apareciendo en la barra de tareas. O quizás estás a punto de lanzarla y te das cuenta de que el icono del dock es un marcador de posición genérico. Configurar un icono de app Tauri adecuado es sencillo una vez que sabes dónde van los archivos y cómo los referencia la configuración. Esta guía te explica los pasos exactos para Windows, macOS y Linux, usando el generador de iconos integrado de Tauri y la configuración de tauri.conf.json.
Requisitos previos
Antes de empezar, asegúrate de tener:
Un proyecto Tauri (v1 o v2) ya configurado.
Node.js y npm instalados (o tu gestor de paquetes preferido).
Una imagen fuente cuadrada, preferiblemente PNG de 1024×1024 con transparencia. SVG también funciona, pero PNG es más seguro para el generador.
Si necesitas un icono fuente de alta calidad, puedes crear uno a partir de tu logo o favicon existente usando Mzu favicondl — exporta PNGs limpios en varios tamaños.
Paso 1: Genera el conjunto de iconos
Tauri proporciona un comando CLI que toma una única imagen fuente y produce todos los formatos específicos de cada plataforma: .ico para Windows, .icns para macOS y varios PNGs para Linux y móvil. Ejecuta esto desde la raíz de tu proyecto:
npm run tauri icon path/to/your-icon.png
Si usas Tauri v1, el comando también es npm run tauri icon, pero revisa los scripts de tu package.json. El generador escribe los archivos en src-tauri/icons/ por defecto. Verás archivos como 32x32.png, 128x128.png, icon.icns e icon.ico.
Consejo: La imagen fuente debe tener fondo transparente y una silueta clara. Evita texto o detalles finos — no sobrevivirán a 16×16 o 32×32. Para orientación sobre diseño, consulta nuestros consejos de diseño de favicon (los mismos principios se aplican a los iconos de app).
Paso 2: Configura tauri.conf.json
Abre src-tauri/tauri.conf.json y localiza la sección bundle. En icon, enumera las rutas a los iconos generados. Tauri v2 usa una estructura ligeramente diferente a v1, pero el concepto es el mismo.
Asegúrate de que las rutas sean relativas a src-tauri/. Si moviste los iconos a otro lugar, actualiza las rutas en consecuencia.
Paso 3: Verifica el comportamiento específico de cada plataforma
Cada sistema operativo utiliza un archivo diferente de la lista. Esto es lo que importa:
Windows: Usa icon.ico para el ejecutable, la barra de tareas y el menú Inicio. El ICO debe contener múltiples tamaños (16, 32, 48, 256). El generador de Tauri se encarga de esto.
macOS: Usa icon.icns para el dock y Finder. El formato ICNS incluye múltiples resoluciones hasta 1024×1024.
Linux: Usa los PNG (típicamente 32x32, 128x128, 128x128@2x) para el lanzador de aplicaciones y el gestor de ventanas. Algunos entornos de escritorio también leen icon.png del bundle.
Si estás compilando para móvil (iOS/Android), el generador también crea los recursos apropiados, pero eso está fuera del alcance de esta guía.
Paso 4: Recompila y prueba
Después de actualizar la configuración, recompila tu aplicación:
npm run tauri build
Luego instala o ejecuta el ejecutable compilado. Revisa la barra de tareas (Windows), el dock (macOS) o el menú de aplicaciones (Linux) para confirmar que el icono aparece. En Windows, es posible que necesites borrar la caché de iconos si el icono antiguo persiste — una peculiaridad conocida. En macOS, a veces el dock almacena en caché los iconos; cerrar sesión y volver a iniciarla lo resuelve.
Errores comunes
Ruta incorrecta en la configuración: Tauri fallará al empaquetar si el archivo de icono no existe. Verifica dos veces las rutas relativas.
Tamaños ICO faltantes: Si creas manualmente un ICO, asegúrate de que incluya capas de 16, 32, 48 y 256 píxeles. El generador de Tauri lo hace correctamente.
Problemas con fondos transparentes: En Windows, las áreas totalmente transparentes pueden aparecer en negro en algunos contextos. Usa un fondo sólido si ves artefactos.
Olvidar reconstruir: Cambiar el icono requiere una reconstrucción completa; la recarga en caliente no actualizará el icono nativo.
Formato ICNS en macOS: Si proporcionas un PNG en lugar de ICNS, macOS puede ignorarlo. Usa siempre el icon.icns generado.
Conclusión
Establecer un icono de aplicación Tauri es un proceso de tres pasos: genera el conjunto de iconos con tauri icon, haz referencia a los archivos en tauri.conf.json y reconstruye. El generador integrado te evita crear manualmente archivos ICO e ICNS. Mantén tu imagen de origen simple y cuadrada, y verifica el icono en cada plataforma de destino. Para obtener más información sobre formatos de iconos y mejores prácticas, explora nuestras mejores prácticas para favicons; muchos principios se aplican también a los iconos de aplicaciones.
Consulta los requisitos documentados
El Estándar HTML define rel='icon' como la relación de enlace para un icono que representa la página actual.
Need a clean source icon for your Tauri app?
Generate a crisp, square PNG from your logo or favicon with Mzu favicondl. Perfect as the base for Tauri's icon generator.