Now that the metadata has been created, we can create the directory structure required for a macOS application bundle. The location of the files is important, and is set out as follows:
File pathDescription
myapp.app/Contents/Info.plist | The application metadata outlined in the preceding |
myapp.app/Contents/Resources/myapp.icns | The application icon in ICNS format |
myapp.app/Contents/MacOS/myapp | The application executable |
After creating these directories and moving files to the correct location, you have a complete application bundle. This can be executed by double-clicking the icon and it can be distributed in this state. Installation consists of dragging this icon into the Applications folder of the computer, as follows:
Creating the .app directory structure and adding metadata creates a macOS application
Looking at the result in Finder, we see the new directory as an application, its .app extension is hidden, and the icon is the same we set up before. You can launch, install, or remove this app like any other:
Our .app directory shows as the application it describes