Mac – How do Mac app execution files work

mac

How do the .app execution files work? Can it be decompiled? In the Windows world, exe files were modified through hex editors and such and most of the executables relied on library files such as dlls and ini files.

But how do .app files work?

I've revealed the hardrives directory structure through terminal and when I get a new package to install after it has been mounted not only do I see the .app file and application folder but I also see other files such as a background folder (being if the package had a nice backround to it ) and some other files. But these app files, are it's library files embedded inside the app?? Or is it calling the library files in the OSX includes directory? I just wanna know all that I can about the Mac. Soon I'll be developing but not yet.

Best Answer

A .app file is an archive, containing the binary executable file itself, as well as any resources that go with it. In essence, it contains all the files that you would see inside a program's folder on Windows, but to the UI it shows up as a single monolithic item. This allows programs to be installed and uninstalled simply by placing the .app file in the /Applications folder (or wherever the user wishes), and deleting it when no longer wanted.

When you double click a .app file, the OS's open handler knows to execute the internal binaries.

You can right-click on a .app file and hit "show package contents" to see the internal folder structure of the package.

Related Question