Hi. Not sure where to ask this.
So I want to be able to launch my ionic app right away on my phone - without connecting via USB - directly via Wi-Fi (Wireless Debugging).
I managed to successfully build and launch it on my phone. But now the problem is that - it does not see the .env
variables.
So - how to pass the variables so that when it is deployed via wifi it will see them? (Hardcoding is not an option)
launching via ionic capacitor run android --device
with the help of adb
We are using Vite so its import.meta.env.VITE_APP_SEARCH
. When I build the regular way - the keys are in the final bundle.
But via wireless for some reason it does not pass the variables as I understood.
UPD:
managed to resolved thanks to Ionic 7 + Vue/Vite + Capacitor 5 set .env file for ionic capacitor run - #4 by aaronksaunders
so
- I have to build using vite build with the mode
ionic build -- --mode dev && npx cap sync
- To run on android device with the
--no-build
flag. ionic capacitor run android --no-build
(You have to do previous steps - Enabled Developer mode on Android device, connect and pair via adb
)