Mobile browser ion test not working

I am trying to use ionic mobile browser testing. I am connected to the same Wi-Fi as my iPhone and verified my IP address with the following command: ifconfig |grep inet . When I start the ion server with the ionic serve command, I cannot open my ion application on my iPhone using my IP address and the specified port from the ion. Should I turn on something else on my machine? I also tried different ports without any success.

+5
source share
2 answers

This answer may be belated, but I hope that it will be useful to anyone who has the same problem in the future. For me, it decided to put the following command: ionic address and select the ip of my dev server (in my case 192.168.0.2 ) instead of the localhost option. Now when I start ionic serve , I can successfully connect from a mobile browser.

+10
source

I had a similar problem using Windows 8.1 and Android. When I used http: // localhost: 8100 / , it loaded correctly in my desktop version of Chrome, but using my local IP address in the desktop browser, i.e. 192.168.1.185:8100 I have a "Connection refused" error. Needless to say, this also didn't work in Chrome on my mobile device.

To solve this problem, Port Forwarding was used in accordance with https://developer.chrome.com/devtools/docs/remote-debugging#port-forwarding

That way, I could open the site using "localhost: 8100" and not the IP address of my mobile device in Chrome, and the site was uploaded and debugged correctly.

+4
source

All Articles