npx @tauri-apps/tauricon --help Description Create all the icons you need for your Tauri app. "ICON-PATH" is the path to the source icon (default: 'app-icon.png'). The icon needs to be either png (1240x1240 with transparency) or svg (square dimensions with transparency). Usage $ tauricon [ICON-PATH] Options --help, -h Displays this message --log, l Logging [boolean] --target, t Target folder (default: 'src-tauri/icons')
生成好的图标默认放在 src-tauri/icons 目录下,在构建时包含在应用程序中。
如果需要从其他位置获取图标,则可以编辑 src-tauri/tauri.conf.json 的以下部分:
{ "tauri": { "bundle": { "icon": [ "icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.ico" ] } } }