Proper syntax to run app-scripts build: --prod --platform android --target cordova

I would have to run ionic cordova build android --prod with increased memory.

I’ve seen I can run
ionic cordova build --prod
node --max-old-space-size=8192 ./node_modules/@ionic/app-scripts/bin/ionic-app-scripts.js build --prod --release.

For the android build, I’ve tried
node --max-old-space-size=8192 ./node_modules/@ionic/app-scripts/bin/ionic-app-scripts.js build --target cordova --platform android --prod --release,
but the target and platform sections seem to be ignored, because the app stops after a regular production build (lint is the latest build task run), so does not start the specified platform build.

So, what is the proper syntax for --target cordova --platform android?

1 Like

Did you find a solution yet?

Sadly, no I could not

You are running a script with node.
Cordova is run by the Ionic CLI, not ionic-app-scripts.
(Building with Ionic CLI will trigger a build with app-scripts internally, then hand over to the Cordova CLI when done)