• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

OS X: Possible to start .app from command line?

icarus4586

Senior member
Most Mac OS X programs are distributed as ".app" packages, which are basically directories with the required binaries and resources for the program. You run them by simply clicking on the ".app" directory (which doesn't look like a directory unless you're at a terminal).
At any rate, I'm wondering if it's possible to start one of these .app programs from a command line. I've got X11 forwarding enabled, so for normal Unix applications (like emacs, kate, etc) I can connect with SSH from a Unix box and run them on my Mac at home, with full GUI. It would be nice to be able to do that with the .app programs that run in X11, too, but I can't figure out how.
 
I think you use the open command. Maybe something like open /Applications/Mail.app

I haven't really tried it though.
 
Yep, that appears to work, although I certainly haven't tested with x11 forwarding. Nice tip though. I think I'll be using open for a bunch of stuff now 🙂

You can also go into the .app folder, find the executable and run that, although that's just extra work 😛
 
Thanks for the replies, and sorry I've taken so long to reply. School is pretty hectic around now.

Anyway, open does work, and it's a very handy utility. Unfortunately, it looks like when you run the program as an "app," it's unaware of any kind of X11 forwarding. For that, you have to dig through the package and run the binary directly. Thanks for the info!
 
It probably wouldn't be too hard to whip up a shell script to replace open, which digs into the .app folder, finds the executable and runs it. The executables seem to be in a consistent location.
 
Back
Top