Both your development machine and your mobile device need to use the same Wi-Fi network.
- Start your application with
--host 0.0.0.0 --disable-host-check
ng serve --host 0.0.0.0 --disable-host-check
- Check your local IP address (Linux, macOS)
ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'
Example response:
192.168.178.97 # this one is the important one
192.130.102.159
- Open your mobile device's web browser and open the website on
<development-machine-ip-address:port>
Example:
Angular usually runs on port 4200. My Mac/Linux machine has the IP address 192.168.178.97
.
That's why I have to navigate to 192.168.178.97:4200
in my cellphone's web browser.