Last Updated: February 25, 2016
· montas

Application shortcut for commandline on OSX

Did you ever need to open Xcode project from current dir? Do you use lines like this one?

open that_project.xcworkspace/

'open' have handy switch '-a' which alows you to specify application in which you want to open specified file. With this option you can open current directory with Xcode and it will open project in that directory.

-a application
Specifies the application to use for opening the file

So with simple alias you can open xcode and have your project opened from command line.

alias xcode='open -a /Applications/ .'

You can do this with any other application ie. RubyMine.

alias rubymine='open -a /Applications/ .'