App doesn't work on emulator or device when not connected from device to wifi, so how can I test Connection/Network stuff while developing?


I noticed that while developing my app doesn’t work if I’m not connected to the same wifi of my developing computer, but If I run the actual realease (apk for android) without any wifi nor data it works just fine.

The catch is I want to code some functionality of the app of what to do when there’s is no internet connection so how can I code this while testing if I must turn off the wifi?


Sorry I did not understand your issue and your setup, but maybe this nice article on how to debug your app written by @gajotres may help you.


thanks the link is great just finished reading it.

So my problem is I noticed that when I emulate or run the app while developing for android if I have wifi off (in the emulator or android device), the app just doesn’t work/it doesnt even run.

But for example when I try running the released apk (which is the executable android package) if I don’t have wifi there is no problem and app runs fine.

So right now I need to code into my app while testing an error message to display when there is no wifi, so as I said at first while developing if I run/emulate on android device without wifi app doesn’t works properyl it tries to run/open but then just crashes. If I recall properly I read somewhere in the Ionic documentation that while testing I need to have device and computer connected to same wifi, so my question is how can I test connectivity stuff while developing if I can’t turn of wifi.


Believe it or not, I don’t have wifi here … so I cant debug my app on device, nor on emulation because of a chrome-related issue with unsafe url and getGeolocation …