alptugan
3/1/2019 - 2:12 PM

Building App with py2App

# 1- Generate Setup py
py2applet --make-setup your_app_name.py

# 2- To relase it as an app
python setup.py py2app -A

# 3- To relase it as an dist app
python setup.py py2app

# Alternative way with more options
# 
# 1- Use the following setup.py to generate app
from setuptools import setup

APP = ['app_tk_Class.py']
APP_NAME = "MacOS Utility"
DATA_FILES = []

OPTIONS = {
    'argv_emulation': True,
    'iconfile': 'mutility.icns',
    'plist': {
        'CFBundleName': APP_NAME,
        'CFBundleDisplayName': APP_NAME,
        'CFBundleGetInfoString': "Set of Utilities to change operating system features",
        'CFBundleIdentifier': "com.alptugan.macosutility",
        'CFBundleVersion': "0.1.0",
        'CFBundleShortVersionString': "0.1.0",
        'NSHumanReadableCopyright': "Copyright © 2019, Alp Tuğan, All Rights Reserved"
    }
}

setup(
    name=APP_NAME,
    app=APP,
    data_files=DATA_FILES,
    options={'py2app': OPTIONS},
    setup_requires=['py2app'],
)

# 2- To relase it as an dev app
python setup.py py2app -A

# 3- To relase it as an dist app
python setup.py py2app