Skip to content

Instantly share code, notes, and snippets.

@nntsugu
Created August 17, 2014 06:27
Show Gist options
  • Save nntsugu/5a93bd537dbdf95de31d to your computer and use it in GitHub Desktop.
Save nntsugu/5a93bd537dbdf95de31d to your computer and use it in GitHub Desktop.
Swiftをコマンドライン(CLI)で実行する ref: http://qiita.com/nntsugu@github/items/17d344cb5f505051687d
export PATH=$PATH:`find /Applications/Xcode6-Beta*.app -name swift|grep bin|xargs -I{} dirname {}`
or
export PATH=$PATH:/path/to/swift_dir
~~~~~~~~~~~~~~~~~~
↑↑↑
## find /Applications/Xcode6-Beta*.app -name swift|grep bin|xargs -I{} dirname {}
## の結果を書けばOK
$ export PATH=$PATH:`find /Applications/Xcode6-Beta*.app -name swift|grep bin|xargs -I{} dirname {}`
## Swift入りのXCodeはまだBeta版なので、find先を/Applications/Xcode6-Beta*.appとしています。
## Betaが取れたら、適宜書き換えてください。たぶんXCodeでOK
$ swift -h
でhelpが表示されればOK
var str = "Hello Swift World!!"
println(str)
$ swift hello.swift
Hello Swift World!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment