How to build .apk from capacitor Ionic poject without using Android Studio

I recently came across Capacitor and i tried it, I find it better than Cordova.
But the only thing is I could not find a command to generate .apk or archive.
In Cordova, I was able to generate .apk without even opening Android Studio.
I am looking for capacitor equivalent commands for ionic cordova build android and ionic cordova build ios


Give this a try:
"ios": "sudo ionic build && npx cap sync ios && npx cap open ios", "android": "sudo ionic build && npx cap sync android && npx cap open android",

You can add there to your package json and when you want a new build just go npm run [platform]. You can also try running it without sudo

Hey, type npx cap open android, this will open the android studio automatically. Wait till the gradle downloads successful and click on the play button (that’s if you have an android device connected to the pc) else click on Build -- >Build Bundle /Apk and you are good to go

Hey, did you read the question?

without using Android Studio

Looking for same

I have a current project in Cordova and it is integrated with Team City CI / CD.
We generate .apk and Xcode archives by running Cordova build whenever we push something to the master branch.
I like Capacitor but didn’t find the capacitor build commands for my scenario.

You can’t. Capacitor just opens the IDEs that you need in order to build Platform projects.

I would suggest following/participating in this issue.