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.

- 2,298
- 5
- 42
- 51
2 Answers
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.

- 822
- 7
- 8
-
Hi @Federico when I specify an address shows this error "TypeError: Cannot read property 'launchBrowser' of undefined" Any solution? Thanks. – Beto Aveiga Aug 16 '17 at 14:35
-
@BetoAveiga which version of Ionic cli are you using? Which version of Ionic framework? Which version of cordova? Which browser? Please provide steps to reproduce the error and I will try to help you. – Federico Hernández Aug 16 '17 at 19:44
-
Hi @Feredico. Thanks. Can I answer "the last version of everything"? Everything is up to date, including the last version of the CLI. Anyway... the problem is gone because I solve it using remote debugging of my device with Chrome, forwarding ports, which is even better than I was looking for. (Ionic CLI 3.8.1 - Chrome 61.0.3163.49 - Cordova 6 - Ionic 3.6) – Beto Aveiga Aug 17 '17 at 14:39
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.

- 41
- 3