Yuan的博客
EN

如何为 Tauri 生成的 macOS 应用制作 Liquid Glass 图标

  1. 设计图标尺寸为 1024x1024不要带圆角
  2. 使用 Icon Composer 生成 Liquid Glass 版本。详细说明可参考苹果官方的 YouTube 视频
  3. 在 Figma 中创建一个 1024x1024 的画布,并将背景颜色设置为透明。
  4. 导入生成的图标,将其调整为 860x860 大小,放在画布中央。
  5. 将这两个图层分组并导出。
  6. 将导出的图标放入你的 Tauri 项目中的 src-tauri/icons 文件夹,并将文件名改为 icon.png
  7. 运行以下命令:
    pnpm tauri icon src-tauri/icons/icon.png
    
#!/bin/bash

# Clear All App Caches Script
# Clears all development and system caches for the Loud Mouth app

echo "🧹 Clearing all app caches for Loud Mouth..."

# Clear Cargo build cache
echo "→ Clearing Cargo build cache..."
cd "$(dirname "$0")/src-tauri" && cargo clean
cd "$(dirname "$0")"

# Clear Xcode DerivedData
echo "→ Clearing Xcode DerivedData..."
rm -rf ~/Library/Developer/Xcode/DerivedData/LoudMouth-*

# Clear user icon caches
echo "→ Clearing icon caches..."
rm -rf ~/Library/Caches/com.apple.iconservices
rm -rf ~/Library/Caches/com.apple.dock.iconcache
find ~/Library/Caches -name "*icon*" -type d 2>/dev/null | xargs rm -rf 2>/dev/null

# Clear node_modules cache
echo "→ Clearing node_modules cache..."
rm -rf node_modules/.vite

# Clear dist folder
echo "→ Clearing dist folder..."
rm -rf dist

# Restart Dock
echo "→ Restarting Dock..."
killall Dock 2>/dev/null

# Restart Finder
echo "→ Restarting Finder..."
killall Finder 2>/dev/null

echo ""
echo "✅ All caches cleared successfully!"
echo ""
echo "📝 Note: For system-level icon cache, run manually:"
echo "   sudo rm -rf /Library/Caches/com.apple.iconservices.store"
echo ""