OpenFL/Haxeflixel Android Signing APK

ShaunHaxe0 Comments

Haxe C++ target

So I am in the process of signing my game for release after using the standard debug.apk throughout the development process (that is automatically applied via OpenFL and Lime).

It is important to know the procedure for my own reference and for anyone who gets confused as I did at first.

First off, you need to generate a private key, this can be done by looking for an executable named keytool in your JDK path. Mine exists at:

On a windows machine, to know where it exists you can type:

I change into the directory where this exists and run the following:

I now have a key called myGame.keystore. I move this file to the root of my project (where the OpenFL Project.xml resides).

MyGame Project

When I have moved this, I first need to add a certificate tag in Project.xml.

I now want to build my project so it gets exported to the export directory. (Or whatever directory you have chosen to export to). So in the root of the project I open the command line and type:

The clean argument wipes the directory clean so that any existing exports are removed. If I navigate to the path where this project was transpiled I should see an unsigned release key. I now need to use jarsigner on this to sign the APK. Run this command. If jarsigner is not recognised you will need to add to your path, it can be found under the JDK alongside the keytool executable.

One last thing to do. Use the zip align executable, this is found under build tools in your Android SDK path.

The steps can be found here under manual for Google play:

You now upload the APK (C:/Users/Shaun Stone/Desktop/MyGame/export/android/bin/bin/myGameRelease.apk) to Google play! Woohoo!


Leave a Reply

Your email address will not be published. Required fields are marked *