20

I'm brand new to Mac OS X (coming from Windows), and I'm trying to understand .app files. In Windows, we had executables (.exe files). If you opened one, your program would run, and any other files it needed were located elsewhere. In Mac OS X, as I understand it, these .app "files" are really more like folders that contain not only the executable itself but also other files that the app may need.

My question is, what exactly do these .app files do? How is it different from drilling into them and running the actual executable?

Recently I was trying to get an app to run on OS X. I finally got it to work (seems like JAVA_HOME needed to be set). However, it only works when I drill into the .app folder and run the shell script that starts the app. If I double-click the .app file/folder, the app just bounces in the dock for a while, eventually stops, and nothing happens (other than the fans spinning like crazy). So clearly the OS is doing something different when it tries to run the app from the .app file vs. directly from the executable within.

I'd like to understand what exactly the .app is doing that causes this app to not run so that I can work to fix the issue. FYI the app is Oracle's SQL Developer.

2
  • 2
    .app is just an extension and not mandatory on OSX for a folder to behave like an app. Have you right clicked on the file in question and revealed the contents? It might help you grok the layout and refine the error you are experiencing.
    – bmike
    Commented Nov 29, 2013 at 6:41
  • 2
    .app extension turns a regular directory into so called "application bundle"—which includes the application executable and related resources (icons, graphics, property files, localizations, etc.) Have a look at en.m.wikipedia.org/wiki/Application_bundle article or Apple developers documentation. Commented Nov 29, 2013 at 7:04

1 Answer 1

18

"apps" are "Package Bundles" is Apple jargon, and are treated specially by the OS. As mentioned above, these are actually Unix directories, in a special format. The actual Unix Executable File is in a subdirectory named MacOS, which you can see using the "Show Package Contents" menu in Finder.

The "app" is analogous to the directory created when you install a Windows program. You can indeed navigate into the app, and run the Unix Executable File.

For more complete details see the Apple Bundle Programming Guide It is in the archive section but Apple's new documentation does not give the overview

This doesn't solve your problem, but without knowing more about the app it won't be solved by manipulating the package. You will need to contact the developer.

You could also look at the Console app, which will let you examine any error or warning messages.

1
  • 1
    Thanks for the info. Turns out the app relied on an environment variable that was set in the shell but not globally (for use by GUI apps launched from Finder or Spotlight, for example). That's why I was seeing different behavior when I ran it from the shell vs. from the icon in the dock. I've since resolved the issue by setting that variable globally. Commented Dec 2, 2013 at 3:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .