How to build Python application for Android / iOS and Desktop
This is a short post, and I’ll just present you Buildozer. With this tool, you will be able to build your Python projects to Android and iOS; and then deploy it easily to any platform.
If you prefer and if you are going to develop for Android with Python, you can just download the Kivy VM for Android.** Take a look in this post and see what do you need to use it.**
Currently, Buildozer supports packaging for:
- Android: via Python for Android. You must have a Linux or OSX computer to be able to compile for Android.
- iOS: via Kivy iOS. You must have an OSX computer to be able to compile for iOS.
- Supporting others platform is in the roadmap (such as .exe for Windows, .dmg for OSX, etc.)
I - Install
i - Using PIP
If you have** PIP ** installed, just run the command bellow to install it:
ii - Using easy_install
iii - Building it from source
If you prefer, you can build Buildozer from source. Just run the following commands to try it:
If you will be developing for Android, you will need at least Cython, few build libs and Java SDK. Some binaries of the Android SDK are still in 32 bits, so you need few 32 bits libraries available:
Please, read more at Buildozer’s documentation
II - Using it
Buildozer is very well documented, so I’m not going to show you everything about it here, just read the documentation: https://github.com/kivy/buildozer#usage-example
But to start a new project, go to the folder where the main.py is located and run:
This command will create the buildozer.spec. Open it and change the configurations.
To build and run it on Android, use the command:
To build and run in on iOS, use the command:
Or for desktop, just run it:
Now, you are able develop apps/games for any platform with Python!! Keep connected with the blog, I have a tutorial series about Mobile Development with Python(this is the part 0,” before you start”).
Thanks for reading, see you in the next post!!