Home » Questions » Computers [ Ask a new question ]

Difference between .app applications and files in /usr/bin?

Difference between .app applications and files in /usr/bin?

I don't really understand the difference. I tried putting a .app file in /usr/bin and executing if from the terminal but that doesn't do anything. What kind of files go in there?

Asked by: Guest | Views: 199
Total answers/comments: 2
Guest [Entry]

"Wikipedia has a good article on Application Bundles.

In short, a .app is not a file: it's a directory tree with a specific structure. The actual binary that runs (ie, the equivalent of the binary you'd find in /usr/bin) is PackageName.app/Contents/MacOS/PackageName. However, you (generally) can't just copy that file to '/usr/bin' and run it, because it will expect to have lots of other files it needs inside the .app folder as well - for instance, many applications have the translation files that allow them to present the UI in different languages under PackageName.app/Contents/Resources/de.lproj (where de happens to mean german).

In some cases, the .app bundle may contain executables you can execute directly - for instance, I often use the ebook-convert binary from the calibre.app bundle, by running /Applications/calibre.app/Contents/Resources/loaders/ebook-convert. In this case, ebook-convert happens to be a self-contained python script and is perfectly happy being called this way - not all executables will be as happy.

You can usually start a .app by calling the main binary directly - eg, /Applications/Safari.app/Contents/MacOS/Safari will launch Safari. However, this is a lot of typing - open /Applications/Safari.app is a shortcut that does the same thing.

man open has many more examples of using open to act as though the user had double-clicked on an icon in finder."
Guest [Entry]

.app is actually not a file, but a folder (or Application bundle) with many different files in it. It also contains the executable files that you actually run.