Skip to content

Instantly share code, notes, and snippets.

@Vehmloewff
Last active October 14, 2022 17:15
Show Gist options
  • Save Vehmloewff/5040fd8150fb1b240b8cbc5392f5f72c to your computer and use it in GitHub Desktop.
Save Vehmloewff/5040fd8150fb1b240b8cbc5392f5f72c to your computer and use it in GitHub Desktop.

How to create a macos app

Throught this guide, replace "MyApplication" with the name of your application.

Create the following files:

MyApplication.app
|-- Contents
	|-- MacOS
		|-- MyApplication # this is your apps executable file
		# Any supportive CLI programs can go here as well
	|-- Resources
		|-- MyApplication.icns # See below for info on how to create this
	|-- Info.plist # download this file from below

Download Info.plist. You can edit it for the specific needs of your applicaiton.

Use this guide to create MyApplication.icns

To get the installation location of the app, use Deno to get the PID and then run ps <pid> to get a list of stuff, which should contain the command used to start the app. Join this to Deno.cwd(), and you will have the location of the executable.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>MyApplication</string>
<key>CFBundleExecutable</key>
<string>MyApplication</string>
<key>CFBundleIconFile</key>
<string>MyApplication.icns</string>
<key>CFBundleIdentifier</key>
<string>com.example.myapplication</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>MyApplication</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.0.268</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>MyApplication</string>
<key>CFBundleURLSchemes</key>
<array>
<string>myapplication</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>0.0.268</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTSDKName</key>
<string>macosx12.1</string>
<key>DTXcode</key>
<string>1321</string>
<key>DTXcodeBuild</key>
<string>13C100</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>LSMinimumSystemVersion</key>
<string>10.11.0</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>This app needs access to Bluetooth</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>This app needs access to Bluetooth</string>
<key>NSCameraUsageDescription</key>
<string>This app needs access to the camera</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app needs access to the microphone</string>
<key>NSPrincipalClass</key>
<string>AtomApplication</string>
<key>NSQuitAlwaysKeepsWindows</key>
<false/>
<key>NSRequiresAquaSystemAppearance</key>
<false/>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
<key>CFBundleGetInfoString</key>
<string></string>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment