How do I zipalign my apk?

0 favourites
  • 7 posts
  • I've tried uploading the apk ludei gave to me on google store but they are asking me to run the zipalign tool,what is that?and how do I succesfuly publish my app?

  • You need to sign and align your APK before it can be uploaded to Google Play. Here's how I've been doing it, but it's been a while since the initial installation so you might have your own hurdles and discoveries. It was a slight PITA to get this set up, but once you get the through the initial part the process is quite fast each time you need a signed/aligned APK.

    To sign it, you'll need the "jarsigner" tool. To install that tool, just get the latest Java JDK.

    To align it, you'll need the "zipalign" tool. To install it, get the latest Android sdk and then find the zipalign.exe file somewhere in the installation (I forget where it is). Ultimately, make sure you have zipalign.exe sitting in Android\sdk\tools.

    So now, you'll need to create a keystore which will be used to sign the APK. I don't remember how I made mine, but I've linked to some tutorial that will hopefully work for you.

    Now, here's what I have done to make this process easy for myself (I don't know if this is the best way or anything, I feel like I'm clueless on the whole, I'm barely getting by). In the root of E:\, I place my keystore file. Each time I have a new unsigned APK, I also place it here and call it Unsigned.apk or something to that effect.

    Now, I have a text document called "SignAndAlignScripts.txt", which contains the following text, including line breaks:

    jarsigner -verbose -keystore E:\mykey.keystore -storepass MY_PASSWORD -keypass MY_PASSWORD E:\Unsigned.apk MY_COMPANY
    
    zipalign -v 4 E:\Unsigned.apk E:\SignedAndAligned.apk
    
    [/code:11rbjv4z]
    The first part signs the APK, and the second aligns it. By pasting that text into command prompt, it'll automatically run both events and you'll wind up with a SignedAndAligned.apk that you can upload to Google. There's probably an easier way, like in a batch file or something so that you just have to double-click it, but the bottom line is that it's convenient to have a script to make it all one process. Now every time I need a new signed-aligned APK, I just place my unsigned file in E:\, name it appropriately, and then run this script. Voila, easy signed/aligned APK.
    
    Disclaimer: I have only very little clue of what I'm doing, learning lots along the way, like you. There may be a far better way, so wait a little while in case there's a better response <img src="{SMILIES_PATH}/icon_razz.gif" alt=":P" title="Razz">
    
    EDIT: I think I found the tutorial I followed. It was on Scirra all along. Follow that and you should be good to go! [url=https://www.scirra.com/tutorials/861/how-to-sign-and-align-your-android-app-apk]https://www.scirra.com/tutorials/861/ho ... id-app-apk[/url]
  • I can recommend the tool that AndreasR mentions - works great!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks both of you

  • Do you mean in the old cloud or in the new one? In Cocoon.io you should get an already signed and aligned apk ready for uploading it to the store without issues.

  • didn't knew you guys have a new platform

    don't have acces to it now,but thanks for the tip

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)