Barebones Python app that can be submitted to the Mac App Store.
Hello App Store
This is a barebones Python app that can be submitted to the Mac App Store.
It displays a simple dialog and exits.
Quickstart
Prerequisites
- OS X 10.8 (Mountain Lion)
- Python 2.7.x
lib/python2.7.
- py2app 0.8.1 or later
Python.framework bundles in generated apps that won't pass Mac App Store checks.
- (Optional) wx 3.0.0.0 osx-cocoa (classic)
- (Optional) PySide 1.1.1 / QT 4.8.6
- (Optional) PtQt 4.11 / sip 4.16.1 / QT 4.8.6
How to Build
- Clone this repository or download a ZIP file of it:
git clone https://github.com/davidfstr/Python-in-Mac-App-Store.git
* cd Python-in-Mac-App-Store
- Build the app package
dist/HelloAppStore.app:
./build-app.sh
- Build the installer package
dist/HelloAppStore.pkg:
./build-pkg.sh
For submission to the App Store you will also need to enable code signing:
- Configure code signing:
SIGNING_IDENTITY line in code-signing-config.sh to refer to your Mac App Store signing certificates:
* You will need an Apple Developer account and a subscription to the Mac Developer Program ($99/year) to get signing certificates.
* Create the appropriate Mac App Store certificates in the Mac Dev Center and download them to your dev machine.
* Change the DOCODESIGNING line in code-signing-config.sh to assign
1 instead of 0.
- Rebuild the app package and installer package using the same steps as above.
How to Submit
- Create a record for your app inside iTunes Connect.
CFBundleIdentifier key in src/Info.plist to match it.
* Fill out app metadata, including its description, keywords, screenshots, etc.
* Press "Ready to Upload Binary".
- Open Application Loader:
- Click "Deliver Your App" and select the app record you created in iTunes Connect.
- When you are prompted for an item to upload, select
dist/HelloAppStore.pkg.
Writing your Own App?
Choosing a GUI Library
Any app you submit to the Mac App Store must have a GUI. In Python there are a few libraries available to create a GUI:
- [Tkinter] / Tk - Built-in to Python. Just works.
- [PyObjC] / Cocoa - Full bindings to the Cocoa frameworks.
- [ctypes] / Cocoa - Low-level bindings directly to Cocoa frameworks.
- [wxPython] / wxWidgets
- [PySide] / QT
- [PyQt]4 / QT
The above assessment leaves the following choices for Mac App Store apps:
- Tkinter
- PyObjC
- ctypes
This example app uses Tkinter by default but includes samples for several of the other GUI libraries.
If you'd like to try the other samples, open src/HelloAppStore.py and change the main function to call one of the other libraries.
[ctypes]: https://docs.python.org/2/library/ctypes.html [Tkinter]: https://wiki.python.org/moin/TkInter [wxPython]: http://wxpython.org [PySide]: http://www.pyside.org/ [PyQt]: http://www.riverbankcomputing.com/software/pyqt/intro [PyObjC]: https://pythonhosted.org/pyobjc/