How does one launch an ".app" from a shell script?

jgc94131

Registered
The subject kind of says it all. Since applications are ".app" directories, and
executing the binary in the MacOS subdir doesn't
seem to work, is there a way to launch a MacOS
application from a shell?
 
EXAMPLES
'open /Volumes/Macintosh HD/foo.txt' opens the document in the default
application for its type (as determined by LaunchServices).

'open /Volumes/Macintosh HD/Applications/' opens that directory in the
Finder.

'open -a /Applications/TextEdit.app /Volumes/Macintosh HD/foo.txt' opens
the document in the application specified (in this case, TextEdit).

'open -e /Volumes/Macintosh HD/foo.txt' opens the document in TextEdit.

'open http://www.apple.com/' opens the URL in the right browser.

'open file://localhost/Volumes/Macintosh HD/foo.txt' opens the document
in the default application for its type (as determined by LaunchSer-
vices).

'open file://localhost/Volumes/Macintosh HD/Applications/' opens that
directory in the Finder.
 
some apps have console support too so it will verbose right to the terminal. but to do thad you have to cd /path/to/.app/Contents/MacOS then ./nameofapp&

ex: to load quake 3:

cd /Applications/quake3/Quake3.app/Contents/MacOS

./Quake3&

likewise if there is a bunch of gibberish displayed after the execution of the last command, you can only launch the app by open -a /path/to/app
 
Back
Top