Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sloanlance/f8f65203c5caec37dc1476b72f5aeafc to your computer and use it in GitHub Desktop.
Save sloanlance/f8f65203c5caec37dc1476b72f5aeafc to your computer and use it in GitHub Desktop.
How to make a standalone iOS app with Pythonista

After you made some cool games or apps with Pythonista, you may want to make it run as a standaone app on iPad/iPhone and possibly share it on the AppStore. This how-to tells you how to do it.

What you need:

  1. Pythonista code you wrote
  2. A Mac with Xcode 7.1 installed
  3. iPhone/iPad running iOS 9

Steps:

  1. Download PythonistaProjectTemplate.zip. The original PythonistaProjectTemplate described at http://olemoritz.net/pythonista-15-whats-new-and-whats-missing.html does not work with Xcode 7. I updated it to work with Xcode 7 and added a more interesting example than the plain old Hello World thing.
  2. Unzip the file and open the project in Xcode 7.1. In project settings, change the Bundle Identifier from com.yuhangwang.pythonistaproject to something else.
  3. Follow the instructions here to configure your developer account on Xcode and to configure your iOS device settings.
  4. Click the run button on Xcode and your should see the "Eight Pyzzle" game installed on your iPad or iPhone.
  5. Now it is time to run your own code. First upload your Pythonista code to Github, and then copy & paste the code into the Script.py file, replacing everything in that file with your code. When you copy & paste, do not do it in Xcode as you will see indentations get messed up. You can use Sublime Text, Komodo Edit, or your favorite Python code editor. Now click the run button in Xcode and see your app run on your iPad/iPhone.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment