ionic capacitor generate apk code example

Example 1: ionic 5 capacitor build apk with android studio

npx cap copy android
npx cap open android

Example 2: ionic capacitor build android apk command

ionic capacitor build android
// Once Android Studio launches
// click on Build -- >Build Bundle /Apk
// Then your apk will be at: android/app/build/outputs/apk/debug/app-debug.apk

Example 3: start ionic 5 capacitor app

ionic start [appName] [appType] --capacitor

e.g. ionic start myApp blank --capacitor

Example 4: ionic capacitor run ios

npx cap open ios

Example 5: capacitor.ionicframework.com to apk

ionic capacitor copy android && cd android && ./gradlew assembleDebug && ./gradlew installDebug && cd ..

Example 6: capacitor build android without android studio

ionic capacitor copy android && cd android && ./gradlew assembleDebug && cd ..