Ionic mobile browser testing is not working

I try to use mobile browser testing with ionic. I'm connected in the same Wifi as my iPhone and checked my IP-Address with the following command: ifconfig |grep inet. When I'm running ionic server with the command ionic serve I'm not able to open my ionic app on my iPhone using my IP-Address and the specified port from ionic. Do I have to enable something else on my machine? I also tried different ports without any success.

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

What solved this issue was using Port Forwarding as per https://developer.chrome.com/devtools/docs/remote-debugging#port-forwarding

In this way I could open the site using "localhost:8100" and not the IP address on my mobile device in Chrome and the site loaded and debugged correctly.

This answer may be late, but I hope it is useful to anybody who has the same problem in the future. What solved this issue for me was 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 run ionic serve I can succesfully connect from the mobile browser.