Forums

OverviewV-Play 1 SupportSigning an .apk › Reply To: Signing an .apk

OverviewV-Play 1 SupportSigning an .apk › Reply To: Signing an .apk
#6979

Ed

This is a tutorial for signing and aligning your publish builds for Google Play Store submission. Note: you need a Pro V-Play account in order to build a “Publish Build” instead of “Test Build”. Once you purchase your V-Play license, you need to update your config.json file in your app’s QML folder and add the following line: “stage”: “publish”,

Send the contents of your QML folder to a compressed folder and upload it to the v-Play build server. I have had problems uploading from Firefox 27, so I have been using Chrome. Download your .apk which will be named yourapp-release-unsigned.apk.

Download and install Java JDK (not JRE)
http://www.oracle.com/technetwork/java/javase/downloads/index.html

Here’s where the fun begins.

1. Copy yourapp-release-unsigned.apk
2. Navigate to your JDK folder. In my case, it was installed in the default location of C:\Program Files\Java\jdk1.7.0_51
3. Open the bin folder, and make sure the jarsigner and keytool are there. If they aren’t, make sure you downloaded and navigated to the JDK folder and not JRE.
4. Paste a copy of your .apk into this folder. (Trust me, it makes the process easier)
5.Now you need to create a “keystore”. Open your command prompt and “cd” to the bin folder. Just type the following:
cd C:\Program Files\Java\jdk1.7.0_51\bin and press enter. Note: your bin location may be different depending on where you installed your JDK. If you are successful, the command line should have changed to show you are now starting in the bin folder of JDK.

Enter the following into you command line:
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

I chose to replace “my-release-key.keystore” with “myapp.keystore”, and “alias_name” with the name of my app.

Press enter and you should be asked a few questions like your first and last name, organizational unit (I entered Application Development), Organization (I chose the name of my Google Play developer account), city, state, and 2-letter country code (mine was US).

By the way, when you choose your password, it may seem like nothing is being typed in the cmd, but it is. Just make sure you’re careful. You need to type your password twice anyway.

Now you should have a file in your bin folder called yourapp.keystore, or whatever you named it in the previous step.

6. Now you will sign your apk with jarsigner. enter the following into your command prompt (make sure you’re still at your bin folder).

jarsigner -storepass YOURPASSWORD -keystore YOURKEYSTORENAME.keystore YOURAPP-release-unsigned.apk YOURKEYSTORENAME

7. You need Android SDK for this next step. Download it here: http://developer.android.com/sdk/index.html

As you did previously with your jdk\bin folder, you will have to “cd” to the following folder:
cd C:\…adk-bundle….\sdk\tools

you will be using the zipalign tool, so make sure it is in that folder. Enter this into the cmd:

zipalign -f 4 YOURAPP-release-unsigned.apk YOURAPP_release.apk

Note: I pointed YOURAPP-release-unsigned.apk to the file I created in the previous step by entering the following:

zipalign -f 4 C:\Program Files\Java\jdk1.7.0_51\bin\YOURAPP-release-unsigned.apk YOURAPP_release.apk

I believe I had trouble with permissions the first time I tried this, so I right-clicked on the jdk bin folder and changed my permissions so I modify the file.

If you are successful, a new file should appear in your sdk\tools folder called YOURAPP_release.apk.

8. Verify everything worked by “cd” back to the jdk\bin and running:
jarsigner -verify YOURAPP_release.apk

Note: you need to point to your release.apk. for example, i used:

jarsigner -verify C:…\adk…\sdk\tools\YOURAPP_release.apk

You should be good to go!

Please let me know if this works for you or if you’re having trouble understanding my directions. If any V-Play team member is reading, tell me if I made a mistake!

-Ed

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support