惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
O
OpenAI News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
Webroot Blog
Webroot Blog
GbyAI
GbyAI
S
SegmentFault 最新的问题
Cyberwarzone
Cyberwarzone
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
J
Java Code Geeks
Google DeepMind News
Google DeepMind News
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
博客园 - 【当耐特】
S
Secure Thoughts
酷 壳 – CoolShell
酷 壳 – CoolShell
AWS News Blog
AWS News Blog
Engineering at Meta
Engineering at Meta
S
Security Affairs
H
Help Net Security
Microsoft Security Blog
Microsoft Security Blog
D
DataBreaches.Net
云风的 BLOG
云风的 BLOG
Hugging Face - Blog
Hugging Face - Blog
Google DeepMind News
Google DeepMind News
Spread Privacy
Spread Privacy
T
Threatpost
Forbes - Security
Forbes - Security
C
Cisco Blogs
Scott Helme
Scott Helme
Attack and Defense Labs
Attack and Defense Labs
Simon Willison's Weblog
Simon Willison's Weblog
腾讯CDC
The Last Watchdog
The Last Watchdog
Cloudbric
Cloudbric
Last Week in AI
Last Week in AI
Recorded Future
Recorded Future
小众软件
小众软件
V
Vulnerabilities – Threatpost
美团技术团队
人人都是产品经理
人人都是产品经理
有赞技术团队
有赞技术团队
Apple Machine Learning Research
Apple Machine Learning Research
Hacker News - Newest:
Hacker News - Newest: "LLM"
I
Intezer
月光博客
月光博客
C
Cyber Attacks, Cyber Crime and Cyber Security
博客园 - 司徒正美
C
Cybersecurity and Infrastructure Security Agency CISA
Martin Fowler
Martin Fowler
博客园 - 聂微东

博客园 - 大强跑了

MacOS应用主菜单连接到ViewController的事件 设置ios/iPad应用允许分屏 QLabel加入点击的几种方式 记录常用的几条gitee命令 编译安装低版本的vapor toolbox vmware fusion打不开dev vmmon断裂管道 macOS升级ruby OBJC调试日志控制的宏定义 开发AppleScript时查看程序UI元素的工具 mac进入恢复模式 macos升级后安装cocoapods DataGridView自定义RichTextBox列 C#winform的datagridview设置选中行 Other Linker flags 添加 -Objc导致包冲突 nat打洞原理和实现 成为顶尖自由职业者必备的七个软技能之四:如何成为销售之王(转) mac下编译FFmpeg-Android iOS app submission : missing 64-bit support eclipse显示adb is down错误,无法真机调试
macOS生成icns文件的脚本
大强跑了 · 2025-08-01 · via 博客园 - 大强跑了
rm -r icons.iconset
mkdir icons.iconset
sips -z 16 16 cangshu.png -o icons.iconset/icon_16x16.png
sips -z 32 32 cangshu.png -o icons.iconset/icon_16x16@2x.png
sips -z 32 32 cangshu.png -o icons.iconset/icon_32x32.png
sips -z 64 64 cangshu.png -o icons.iconset/icon_32x32@2x.png
sips -z 128 128 cangshu.png -o icons.iconset/icon_128x128.png
sips -z 256 256 cangshu.png -o icons.iconset/icon_128x128@2x.png
sips -z 256 256 cangshu.png -o icons.iconset/icon_256x256.png
sips -z 512 512 cangshu.png -o icons.iconset/icon_256x256@2x.png
sips -z 512 512 cangshu.png -o icons.iconset/icon_512x512.png
sips -z 1024 1024 cangshu.png -o icons.iconset/icon_512x512@2x.png
iconutil -c icns icons.iconset -o icon.icns
rm -r icons.iconset

保存为generate.sh,cangshu.png是图标图片,替换成自己的图片名称即可,generate.sh和图片放在同一目录,终端运行sh generate.sh即可生成icns文件。

来源:https://blog.csdn.net/weixin_43901089/article/details/133082683

指定文件名:

#!/bin/bash
if [ $# -eq 0 ]; then
    echo "请输入图片文件名"
    exit 1
fi

filename=$1

#echo "你输入的文件是: $filename"

if ! test -f "$filename"; then
    echo "文件 $filename 不存在"
    exit 1
fi

rm -r icons.iconset
mkdir icons.iconset
sips -z 16 16 $filename -o icons.iconset/icon_16x16.png
sips -z 32 32 $filename -o icons.iconset/icon_16x16@2x.png
sips -z 32 32 $filename -o icons.iconset/icon_32x32.png
sips -z 64 64 $filename -o icons.iconset/icon_32x32@2x.png
sips -z 128 128 $filename -o icons.iconset/icon_128x128.png
sips -z 256 256 $filename -o icons.iconset/icon_128x128@2x.png
sips -z 256 256 $filename -o icons.iconset/icon_256x256.png
sips -z 512 512 $filename -o icons.iconset/icon_256x256@2x.png
sips -z 512 512 $filename -o icons.iconset/icon_512x512.png
sips -z 1024 1024 $filename -o icons.iconset/icon_512x512@2x.png
iconutil -c icns icons.iconset -o icon.icns
rm -r icons.iconset

执行 sh generate.sh cangshu.png