Ionic 4 App 192.168.8.200 not working on mobile device

Viewed 1310

Im tried to serve ionic 4 mobile app on using mobile browser, but its not worked for me. http://localhost:8100 is really worked on local server, Ionic 3 app is relay working following method 192.168.8.200:8100 anyone know how run the ionic 4 app different devices using IP address

Thanks

3 Answers

Try this:

  1. learn what IP address your machine has (windows, run "ipconfig")
  2. run 'ionic serve --address 192.168.0.72' (my address is 192.168.0.72 on dev PC)
  3. now from another device on local network go: 192.168.0.72:8100

You can change port as well as needed: https://ionicframework.com/docs/cli/commands/serve

Please note with this command you will also need to use this IP address to debug instead of localhost:8100. Your browser by default will still try to get to localhost first.

Update 2:

Try also running it this way: 'ionic serve --address 0.0.0.0'

This way both localhost and 192.168.0.72 (my PC interface) work.

Update:

Please use the --host option (e.g. --host=192.168.0.24) to specify the host of the dev server.

example: ionic serve --address 0.0.0.0

For Ionic using Angular: ng run app:serve --host=192.168.8.200 --port=8100

Related