如何使用iconutil手动创建icns文件? [英] How to manually create icns files using iconutil?

查看:1509
本文介绍了如何使用iconutil手动创建icns文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我验证我的应用程式时,我收到以下错误:


应用程式包不包含ICNS格式的图示,包含 512x512 512x512 @ 2x 图片。


我用来使用 Img2icns 应用程序制作icns图标,直到今天它总是工作得很好。但现在我得到这个错误,没有办法使它的工作。我尝试在 512x512 和 1024x1024 ) .img2icnsapp.com /> Img2icns ,但我总是得到的错误。我也尝试按照苹果的OS X人机界面指南的说明,但是当我尝试使图标集我得到这个终端错误:


-bash:语法错误接近意外的标记'newline'


我对终端命令不是很好,所以也许我在做有问题。我写了:

  iconutil -c icns< / Users / myname / SDK Mac Apps / MyApp / grafica / icon.iconset> 

如果任何人可以帮助,将非常感谢。

解决方案

请检查以下说明( link ):


使用iconutil手动创建icns文件



iconutil 命令行工具将 iconset 文件夹到部署就绪的高分辨率icns文件。 (您可以在Terminal中输入 man iconutil ,找到此工具的完整文档。)使用此工具还会压缩生成的 icns

将一组图标转换为icns文件

>

在终端窗口中输入此命令:



iconutil -c icns< iconset filename&



其中< iconset filename> 是包含集您要转换为 icns 的图标。除非您指定了如下所示的输出文件,否则输出将写入与 iconset文件相同的位置:



iconutil -c icns -o< icon filename> < iconset filename>


换句话说,您需要替换 ; iconset filename> 的路径:

  / Users / myname / SDK Mac Apps / MyApp / grafica / icon.iconset 

由于路径包含空格,因此您需要使用双引号,例如:

  iconutil -c icns/ Users / myname / SDK Mac Apps / MyApp / grafica / icon.iconset

此命令应该能正常工作。


When I'm validating my app I get this error:

the application bundle does not contain an icon in ICNS format, containing both a 512x512 and a 512x512@2x image.

I use to make the icns icons with Img2icns app and till today it always worked good. But now I'm getting that error and there's no way to make it work. I tryed to put two PNG files togheter (512x512 and 1024x1024) in Img2icns but I always get the error. I also tryed to follow instructions on OS X Human Interface Guideline of Apple but when I try to make the icon sets I get this terminal error:

-bash: syntax error near unexpected token 'newline'

I am not very good with terminal command and so maybe I'm doing something wrong. I wrote:

iconutil -c icns </Users/myname/SDK Mac Apps/MyApp/grafica/icon.iconset>

If anyone could help it would be very much appreciated. Thanks, Massy.

解决方案

Checkout the following instructions (link):

Use iconutil to Create an icns File Manually

The iconutil command-line tool converts iconset folders to deployment-ready, high-resolution icns files. (You can find complete documentation for this tool by entering man iconutil in Terminal.) Using this tool also compresses the resulting icns file, so there is no need for you to perform additional compression.

To convert a set of icons to an icns file

Enter this command into the Terminal window:

iconutil -c icns <iconset filename>

where <iconset filename> is the path to the folder containing the set of icons you want to convert to icns. The output is written to the same location as the iconset file, unless you specify an output file as shown:

iconutil -c icns -o <icon filename> <iconset filename>

In other words, you need to replace <iconset filename> by the path:

/Users/myname/SDK Mac Apps/MyApp/grafica/icon.iconset

Since the path contains spaces, you need to use double quotes, for example:

iconutil -c icns "/Users/myname/SDK Mac Apps/MyApp/grafica/icon.iconset"

This command should work properly.

这篇关于如何使用iconutil手动创建icns文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆