MacOS – What does a .app file actually do

applicationsmacos

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.

Best Answer

"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.