A OSX application has a .app extension, but it’s not a file. It’s a package. You can view the application’s contents by navigating to it in the Finder, right-clicking it and then choosing “Show Package Contents”.
The internal structure has many other folders, but you can be sure that every Mac app will have a Contents folder with a MacOS subfolder in it. Inside the MacOS directory, there’s an extension-less file with the exact same name as the app itself. This file can be anything really, but in its simplest form it’s a shell script.
appify
Thomas Aylott came up with a clever “appify” script that allows you to easily create Mac apps from shell scripts. The code looks like this:
Here’s how to install it:
- Save the script to a directory in your PATH and name it appify (no extension). I chose to put it in /usr/local/bin, which requires root privileges.
- Open Terminal.app and enter sudo chmod +x /usr/local/bin/appify to make appify executable without root privileges.
After that, you can create apps based on any shell script simply like this:
$ appify your-shell-script.sh "Your App Name"
Adding a custom app icon
- Create an .icns file or a 512×512 PNG image with the icon you want, and copy it to the clipboard (⌘ + C).
- Right-click the .app file of which you want to change the icon and select “Get Info” (or select the file and press ⌘ + I).
- Select the app icon in the top left corner by clicking it once. It will get a subtle blue outline if you did it right.
- Now hit ⌘ + V (paste) to overwrite the default icon with the new one.

