LoginSignup
2
1

More than 5 years have passed since last update.

SketchToolをインストールする方法

Last updated at Posted at 2018-09-21

Sketch.app のなかに install.sh というファイルがある時期があるんだけど、バージョン 48 から、そのファイルがなくなるようになりました。 2018/9/21 現在使ってる最新バージョン (51.3) にもそういうファイルはもう存在していない。

試したことと解決方法は下記のようになります。

手動でバイナリーファイルを移動してみる :x:

cli ツールのローケーションはここに収納されています。

/Applications/Sketch.app/Contents/Resources/sketchtool/

.
├── README.txt
├── bin
│   ├── sketchmigrate
│   └── sketchtool
└── share
    └── sketchtool
        └── resources.bundle

次のコマンドでコピーするのができます:

cp bin/* /usr/local/bin/
cp share/* /usr/local/share

が、 sketchtool を実行してみると、こういう問題が出てきました:

dyld: Library not loaded: @rpath/BCFoundation.framework/Versions/A/BCFoundation
  Referenced from: /usr/local/bin/sketchtool
  Reason: image not found
Abort trap: 6

Sketch社の人によると:

Yes sorry about that. Since 48, we changed how we organize some stuff in our repo and the Libraries are now frameworks so when you install sketchtool, the frameworks are missing because they are not copied.

We are looking a nice solution but in the meantime, you can use /Applications/Sketch.app/Contents/Resources/sketchtool/bin/sketchtool directly

(https://sketchplugins.com/d/502-dyld-library-not-loaded/4)

とにかく、今は直接そのバイナリーファイルを使ってくださいっていうことになりました。

バイナリーのローケーションを PATH に追加する :o:

毎回フルパスを使ったらちょっとアレなんで、 PATH に追加して見みました。

cat << EOF >> ~/.zshrc
# Add Sketch related tools
export PATH="\$PATH:/Applications/Sketch.app/Contents/Resources/sketchtool/bin/sketchtool"
EOF

* zsh 使ってない人は ./zshrc./bash_profile とかに書き換えてください。

そして次のコメントを実行するとこの変更がすぐに反映してくれます。

source ~/.zshrc

下記のように、実行して、問題なければこういうようなバージョンのアウトプットがプリントアウトしてくれます。

$ sketchtool -v
sketchtool Version 51.3 (57544)

以上です!

資料

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1