美文网首页
SketchTool

SketchTool

作者: CodingTom | 来源:发表于2018-06-19 08:52 被阅读9次

什么是 SketchTool

SketchTool是一个与Sketch捆绑的 命令行实用工具 ,它允许您使用Sketch文档执行一些操作,比如检查或导出资源。它还允许您从命令行控制Sketch来执行一些操作。

安装SketchTool

下载Sketch,解压 Sketch 获取 Sketch.app;把 Sketch.app 拖到 Applications(应用程序)中。

Sketch下载地址

安装完 Sketch.app 你就可以在 Sketch.app/Contents/Resources/sketchtool/bin 目录下找到sketchtool

导出PNG Shell 命令

#!/bin/bash
export PATH=$PATH:/Applications/Sketch.app/Contents/Resources/sketchtool/bin
#echo $PATH
#sketchtool help

sketchtool export artboards inputFilePath --output=DirPath --formats="png"

在Xocode中导出

怎样从Sketch向Xcode自动导出图形资源

# AppIcon
export PATH=$PATH:/Applications/Sketch.app/Contents/Resources/sketchtool/bin

sketchtool export artboards "$PROJECT_DIR"/"Graphics Resources/AppIcon.sketch" --output="$PROJECT_DIR"/"$PROJECT_NAME"/Images.xcassets/AppIcon.appiconset --formats="png"

# LaunchImage
sketchtool export artboards "$PROJECT_DIR"/"Graphics Resources/LaunchImage.sketch" --output="$PROJECT_DIR"/"$PROJECT_NAME"/Images.xcassets/LaunchImage.launchimage --formats="png"

相关资源参考连接

sketchtool guides

Sketch官网

相关文章

  • SketchTool

    什么是 SketchTool SketchTool是一个与Sketch捆绑的 命令行实用工具 ,它允许您使用Ske...

网友评论

      本文标题:SketchTool

      本文链接:https://www.haomeiwen.com/subject/honoeftx.html