One way to build Cordova Android projects with CLI tools

Build & sign Android APKs/AABs from Cordova projects on your machine using CLI tools only.

This is a short guide for seting up a CLI environment to turn Cordova projects into APK / AAB files locally. It's written for Windows, but can be adapted to Linux & macOS as well. You can use it with Construct 3 Android exports, or any other Cordova project. The guide was written in February 2026 and might not age well.

Installing required build tools

We need to install Node.js, OpenJDK, Android Command Line Tools and Gradle to build our Cordova Android project.

I like to use Scoop (an open source CLI installer for Windows). After adding the Extras bucket, you can use this one liner to install all of the above:

scoop install nodejs-lts openjdk17 android-clt gradle-bin

Then install Cordova globally using the Node.js package manager:

npm install -g cordova

At this point we need a Cordova Android project. If you already have one, navigate to its directory and skip to the next section. If you're using Construct, go to Export, select Android and on the Cordova options screen select Cordova project.

If you just want to set up the build environment, create a blank Cordova Android project with the following commands:

cordova create blank-app
cd blank-app
cordova platform add android

Installing Android SDK Build Tools

At this point we can try building the project. It will probably download some dependencies and eventually fail and give you an error message, if you don't have the required version of Android Build Tools installed.

cordova build android

The error message will tell you to install a specific version of the Android Build Tools (eg. 35.0.0), which should be available from the Android SDK manager. It's best to list all available packages first:

sdkmanager --list

Look for "build-tools" and copy the line that matches or a tiny bit superseeds the version number requested by Gradle. At the time of writing, 35.0.0 was required, 35.0.1 also worked, older versions and 36.x didn't. Proceed to install the preferred version (35.0.0 in the example):

sdkmanager --install build-tools;35.0.0

To check what's currently installed with this command:

sdkmanager --list

If you need to uninstall a version, use this command template:

sdkmanager --uninstall build-tools;35.0.0

Running builds

After Android SDK Build Tools are installed, we can attempt to build again:

cordova build android

This time it will hopefully proceed to install the remaining build dependencies and eventually finish the build successfully. If you have a slow Internet connection, it'll take a while. Subsequent builds will be faster.

The previous command creates a debug build. If you want to make a signed production build, you can use the following command as a template, just replace the ??? parts with the relevant values:

cordova build android --release -- --keystore="???.jks" --keystoreType jks --storePassword=??? --password=??? --alias=???

You can use these comment as a part of automations - public deployment scripts, generating nightly builds for continuous testing, et cetera.

That's about it! Happy building :)

This article was updated on

Related posts