Compiling to Android to see any change is quite a slow process. Am I doing something wrong or redundant in my workflow? Any time I make any code changes I run the following commands. Is anything unnecessary or incorrect? Can I instead just sync Gradle files or something in the Android IDE?
npm run build && npx cap copy && npx cap copy android && npx cap open android
normal cmd: npm run build && npx cap copy && npx cap open android
if you added any cordova or native package then
npm run build && npx cap copy && npx cap sync && npx cap open android
I’m running Capacitor. So it sounds like you’re saying nothing I’m doing is redundant and must be done with every change? No shortcuts?
Edit: Nevermind, I see you skip npx cap copy android. I’ll leave that out next time.
What I do is simply leave an Android Studio window open, so I just npm run build && npx cap copy
and then switch to that Studio window where I either build the apk or run directly on a connected device. So that leaves the open android
step out (along with the associated Android Studio startup time).
So do you also need to do anything inside Studio to sync the files, like Sync with Gradle or something?
Not that I’ve noticed - I think npx cap copy
copies the necessary stuff into the android
subfolder, so I either just pick “Build → Build APK” or “Run → Run app”.