If you are using Windows 10, you can use WSL (also sometimes called "bash on windows"), to package your app for android.
https://docs.microsoft.com/en-us/windows/wsl/install-win10
Once your ubuntu on windows is setup, you can follow buildozer's instructions
https://buildozer.readthedocs.io/en/latest/installation.html#installation
also follow the steps for "targeting android" for ubuntu.
Making ADB work.
Almost everything will work just like on a normal ubuntu installation (though possibly a bit slower), but adb
which is used by buildozer to install the app on your android device and display the logs, can't work directly inside WSL, but it's possible to make it work.
First you need to check the version of adb that buildozer installed.
After a successful build of your apk, type the two following commands in bash.
adb=$(find ~/.buildozer -name adb -type f,l)
$adb --version
This will show the version of adb that was installed, for me it's 1.0.39, but it's probably different for you.
Download the windows version of this version of adb.
https://developer.android.com/studio/releases/platform-tools#downloads allows you to download the latest version of the tools, try this one first.
- extract adb from it
- open a cmd window
- drag and drop your extracted adb.exe onto it and type
--version
after it then validate. - If the version is more recent than the one you got through buildozer, you can download an older version by editing the version in this link
https://dl.google.com/android/repository/platform-tools_r27.0.0-windows.zip
repeat the steps to check for adb version, once you got the same version as with buildozer, create yourself a shortcut to start it easily, you don't even need to see it, just to be able to easily start it.
using that ADB for server.
Make sure an adb server is not running in ubuntu
adb=$(find ~/.buildozer -name adb -type f,l)
$adb --kill-server
Then run the window's adb (using cmd or just double-clicking your shortcut)
check that you can access your device by running
$adb devices
in ubuntu.
Of course, your device must be in developer mode (https://developer.android.com/studio/debug/dev-options) and have usb debugging enabled (https://developer.android.com/studio/debug/dev-options) for this to work. When you run the command, you might get a confirmation dialog on your device asking for confirmation of access to your device, this is for security purpose, and is fine to accept here as you are the one asking for connection.
After that you should be all set to do android development with buildozer on windows 10, don't forgot to run adb on windows before trying to use it in ubuntu every time you reboot your computer.