Uploading multiple APKs to the Play Store from Cordova and Crosswalk

Let’s say you have a low version release and a current release for your app. Let’s also say you’re using crosswalk or another plugin that builds for different device architectures. We can still do it!

It all depends the android version code. If you take a look in your android manifest you’ll see something like:

android:versionCode="102052"

Basically it’s a version code that (among other things) tells google play that this is a new APK. You need to increment this every time you upload a new APK, even if its meant to support the same version!

Here’s the code:

# in your config xml file
# add the following attribute to "widget"
# should look something like: <widget id="com.gsp.appName" version="1.2.5" android-versionCode="102052"
android-versionCode="102052"

# in your project root
cordova build --release android

# cd into your apk folder
cd platforms/android/build/outputs/apk

# if you havent already, generate a keystore file and save it someplace safe
# this file will allow you to make updates and sign your app, without it 
# you're screwed, so make sure you keep it. You can sign other apps with it.


# sign your apk with your keystore file
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ~/PATH/TO/FILE/your_key.keystore android-release-unsigned.apk alias_name

# now verify with zipalign
~/Library/Android/sdk/build-tools/23.0.0/zipalign -v 4 android-release-unsigned.apk YOUR_APP_NAME.apk

#once verified, upload it to the play store apks.

# increment the version code for your next apk
# should look like: <widget id="com.gsp.appName" version="1.2.5" android-versionCode="102053"
android-versionCode="102053"

# repeat the building through uploading steps, repeat as necessary

Here's a video to show you how to do it:

Leave a Reply

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