From Cordova export to signed APK with Cordova CLI on Windows 10

3

Index

Stats

16,454 visits, 30,000 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 14 Apr, 2018. Last updated 19 Feb, 2019

Preface

Making a signed APK with the Cordova is not an easy thing. But if you are capable of making a decent game in construct you should be able to follow this tutorial.

This manual my seem long. But most action only need to be done once. After you got your game signed and ready to publish, updating it goes much quicker.

During this manual it is very helpful to see the hidden folders and file extensions in your file explorer. How to make them visible? Follow the instructions given on this page:

https://www.technipages.com/show-hidden-files-windows

The file extension checkbox is right above the hidden items checkbox.

In this manual we are going to use Windows Powershell. I think the old command prompt will work as well. To start Powershell Press [Windows key]+[X] and then click on Windows PowerShell.

During the build process you have to specify a targeted(required) and a minimum(optional) SDK/android API. The targeted SDK is the android API the APK will be build for. But it also will work on older versions. Up to the minimum version you give. 4.1 is the minimum version supported by cordova (april 2018). From august 2018 Google requires all new apps and updates to be targeted at an SDK that isn’t older then 1 year.

From android 5 and up there is an internal ‘browser simulator’ So If you specify a minimum version of 5 or higher, you get one small apk.

Before android 5 the crosswalk browser simulator is needed. This runs closer to the hardware, so you get APK’s for different SOC families. And the APK’s are bigger. During install the ARM64 APK requires the crosswalk app to be installed. The ARMv7 APK for older ARM devices has the crosswalk code embedded, so it does not ask for it.

In short.

Minimal version of 5 and up: 1 APK for all.

Minimal version 4.1 and up : 5 APK’s, crosswalk install can be needed, in game experience can be smoother

Google allows publishing multiple APKs of the same app. They must be signed with the same key. But also must have different version numbers. Lucky for us Cordova already fixed the version number thing for us.

For a list of android version → API level see : https://source.android.com/setup/start/build-numbers

I do not now everything. And I make mistakes. So if there are incorrect instructions / statements in this manual please let me know so I can update this manual.

Add a few places I added a question for conformation / clarification about something’s. If you know the answer, please let me know.

  • 1 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • 你好 我好久没有更新C2了。近期发现更新到r261 以上的版本。 CORDOVA CLI build 出来的android APP 无法在手机里面打开。黑屏无法启动APP. 能帮帮我么?

    R261无法BUILD API 28

    你好 我好久没有更新C2了。近期发现更新到r261 以上的版本。 CORDOVA CLI build 出来的android APP 无法在手机里面打开。黑屏无法启动APP. 能帮帮我么?

    R261无法BUILD API 28

    Hello, I haven't updated C2 for a long time. Recent updates have been found to be more than r261. Android APP built by CORDOVA CLI cannot be opened in the phone. Black screen can't start APP. Can you help me?

    R261 cannot BUILD API 28