Writing your first iPhone app, with PythonMobile apps are awesome! Writing them is super-intimidating.
But first, a bit about me and why I’m doing this.
Back to our narrative
- The Python for iOS template: http://pybee.org/project/projects/templates/python-ios-template/
- Python 3.5: I recommend using Anaconda (https://www.continuum.io/downloads) to set up and manage your Python environments, and will be assumed in this post
- CookieCutter: https://github.com/audreyr/cookiecutter
Wait, is there a point here somewhere?
Chunking Out The Work
- Deploy some kind of zero-order application onto the iPhone with absolutely minimal functionality
- Get a super-simple GUI app working with Toga in my local development environment
- Get the GUI app working on the iPhone through that procedure
Overview of existing online documentation:
Step Chapter One: Zero Order iPhone App
- Download Anaconda
- Run ‘conda create -p ~/Development/envs/ios python=3’
- Run ‘source activate ~/Development/envs/ios’
- Run ‘pip install cookiecutter’
- Run ‘pip install toga-ios==0.2.0.dev1’
- Create a project working directory for your files
(e.g. ‘mkdir ~/iphone_app; cd ~/iphone_app’)
- Stick the uncompressed stuff into the project working directory
- Run ‘cookiecutter https://github.com/pybee/Python-iOS-template --checkout 3.5’ ← Read the next bit before you actually run this!
formal_name [App Name]:
- Open your project directory in XCode
- Unlock your phone and push “play”
- OUTCOME! Your app is now on the phone!
Step Chapter Two: Get a Super-Simple GUI app working locally using Toga
container = toga.Container()
button = toga.Button(label='DataVsAlgo')
if __name__ == '__main__':
app = toga.App(name='Charty Buttons', app_id='blue.neuron',
Step Chapter Three: Get that App onto the Phone How to get into toga-iOS bridge development
- Set up a place in your development folder to store source code versions of the Toga stack
- Use symlinks to add them to your XCode project exactly according to the following screenshot