kivy,  linux,  mobile

Mobile App Development With Kivy & Python 3 (part 2 android release + sign and zipalign, publish)

So, folder for kivy project is zenseeker.

Buildozer init (get spec and modify it)

buildozer -v android debug

Move the apk to the phone and debug it if needed with adb logcat (press install and check the logs)

It works? Good, then get ready for keytool (save the password and alias) and signing with jarsigner.

But read this first, Publish your app:

https://developer.android.com/studio/publish

mkdir ~/keystores/

keytool -genkey -v -keystore ~/keystores/.keystore -alias -keyalg RSA -keysize 2048 -validity 10000

So then we have a keystore, cool

Next up

Open a cmd, navigate to project where the buildozer.spec is

buildozer -v android release (not not use the EXPORT keys from keystore)

This will create and usigned.apk (zenseeker-release-unsigned.apk)


Move that apk (test before signing) to the phone and install it, it works? Great, next

Cd to that folder

espen@espen-UN65U:~/project/learnkivy/learn/zenseeker/.buildozer/android/platform/build/dists/zenseeker/build/outputs/apk/release

Then run jarsigner on that file

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ~/keystores/zen_nutshell.keystore zenseeker-release-unsigned.apk zen_nutshell_alias

Then verify the jar

jarsigner -verify zenseeker-release-unsigned.apk

jarsigner -verify -verbose -certs zenseeker-release-unsigned.apk

Move the zenseeker-release-unsigned.apk to the phone and test it, if it works, then it is success.

Then run zipalign from android (check where it is)

espen@espen-UN65U:~/.buildozer/android/platform/android-sdk/build-tools/29.0.2

espen@espen-UN65U:~/.buildozer/android/platform/android-sdk/build-tools/29.0.2$ zipalign -v 4 ~/project/learnkivy/learn/zenseeker/.buildozer/android/platform/build/dists/zenseeker/build/outputs/apk/release/zenseeker-release-unsigned.apk ~/Desktop/zenseeker.apk

Move the new zenseeker.apk to the phone and install it (it is now optimized, so should load quick), if it works, then ready for play store…..


Comments Off on Mobile App Development With Kivy & Python 3 (part 2 android release + sign and zipalign, publish)