Separate names with a comma.
Discussion in 'macOS' started by ilnyckyj, Jan 13, 2006.
How do you execute a .app from the command line?
Sure. Use the open command. open is very clever and uses LaunchServices to open things in the same way as the Finder.
So open /Applications/iTunes.app will open iTunes.
open ~/Desktop/file.txt will open file.txt in Text Edit (or whatever you have defined to open text files).
I've wondered this for a while, but never cared enough to look it up or ask the question.
Handy tip. Thanks.
if its the same as any linux exe cd to the dir and just do this
That won't work as <app name>.app is actually a folder. The executable is at <app name>.app/Contents/MacOS/<app name>
If you want to avoid having to type in the path, then you can just use:
open -a iTunes.app
The -a switch will make it search the /Applications folder and its sub-folders for the matching file.
I need to read man pages more often.