How to distribute an application for Mac OS so that it can be run by double clicking it?

anon :

Goal

I've written a simple python application and I want to build it in a way such that I can email it to a non-technical person using a Mac OS machine such that they can just download the file and double click it to run.

What I've tried so far

I've built a single file executable using pyinstaller, but when I email it and download it, the file doesn't have permission to be executed. I know that this can be fixed with chmod, but the goal is for a non-technical person to be able to just double click to run.

I've also tried creating a "installation file" that's just a file with a .command file extension that is essentially this:

#!/bin/bash
cd -- "$(dirname "$BASH_SOURCE")"
sudo chmod a+x MyApplication
exit 0

But this has the same problem as above - the file doesn't have permission to be run by default.

Is there something simple that I'm missing? I'm open to not necessarily having to email the app, but I do need a simple way to share it.

Gianluca :

Platypus allows scripts in different languages (including Python) to be bundled into OSX applications. Python is typically installed on newer versions of OSX anyway, so there might be no need to ship Python itself, and the app could be tiny in file size.

Generally, since OSX applications are really folders, it might be worthwile to pack the folder before emailing as

tar cjf YourApp.tbz YourApp

where YourApp is the folder containing the application. OSX recognizes the tbz extension and will unpack the app/folder when doubleclicked, say in Downloads or the Desktop, where the user can then doubleclick the application to run it.

tar cjf archive.tbz singlefile

will similarly also work for archiving a single file, where tar will preserve the executable and other flags.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=170461&siteId=1