So while developing I turn off the wifi and then the ionic app doesn\'t work in android device/emulator.
But when I turn off wifi with the released and signed apk fi
When you run application with ionic run android -l -c
then all data and resources are being served from your computer through network. In fact in that case it works on mobile in same way you run on computer browser with ionic serve
. So when you turn off mobile internet then it is unable to serve from computer, as network was channel to serve pages. But ionic run android
packages all aplication sources in mobile and resources are served from file:///android_asset/www/
.
Real Purpose of ionic run -l -c :
l
stands for liverload, which keeps on refreshing your application in mobile whenever there is change in source. c
stands for console, application console logs are shown in your command line from where you initiated application. It helps ionic developers for testing, as they do not have to install application again and again. But remember keep your phone connected to computer and both should be on same internet network.
NOTE: Sometimes cordova plugins
like camera etc behave strange in this enviroment. So better use without -l -c
while checking plugins related functionalities.
just solved the issue. I was trying to run the app with ionic run android -l -c
so now I run it with ionic run android
and off course that doesn't need livereload -l
and now app works just fine