本项目已停止维护,因为 Xcode 14.0 最终提供了此工具能够完成的大部分功能,请参阅 https://www.avanderlee.com/xcode/replacing-app-icon-generators/
AppIconResizer 使用纯 Swift 语言将给定的应用程序图标 png 文件渲染成 Xcode 中 iOS 项目所需的各种尺寸,不依赖任何外部工具。它还会生成所需的文件夹结构和 json 文件。
支持的最低 iOS 版本为 iOS 10.0
mint install num42/icon-resizer-swift
欢迎提交 PR 以增加其他安装方法!
mint run icon-resizer-swift icon-resizer-swift --devices iphone,ipad inputIcon.png
将 inputIcon.png
调整为 iPhone 和 iPad 的尺寸。
mint run icon-resizer-swift icon-resizer-swift --devices iphone --badge badge.png --targetPath /Users/steve/dev/icons inputIcon.png
将带有徽章 badge.png
的 inputIcon.png
调整为 iPhone 的尺寸,并将其保存到 /Users/steve/dev/icons
。
只需运行该工具即可获得所有可用选项
> mint run icon-resizer-swift icon-resizer-swift
🌱 Using num42/icon-resizer-swift 1.0.0 from Mintfile.
🌱 icon-resizer-swift 1.0.0 already installed
🌱 Running icon-resizer-swift 1.0.0...
Arguments:
inputPath - The path of your input app icon.
Options:
--devices [default: all] - The devices you need app icons for. Valid devices are iphone, ipad, watch and marketing. Use multiple devices by separating them with a comma.
--badge - Use this if you want a badge rendered on top of your app icon. Just give the path to the badge PNG.
--targetPath [default: /Users/admin/dev/Apps/template-app-beta-ios] - The path that the xcassets folder structure and app icons will be written to. If no path is given by the user, icons are written into the current path.