So you're building a mobile web app and you want to view it on an actual phone not a virtual one in your dev tools? No, you don't have to deploy! If you've ever used Create React App, running developer mode gives you simple instructions for doing this, however Next.JS $ yarn dev
does not! Fear not, it is very simple...
1. Get your machine's IP address
# Linux/Mac
$ ifconfig
# Or Windows...
$ ipconfig
2. Run your project
$ yarn dev
3.Open browser on your phone
- If your machine's IP is
192.168.0.69
... - ...navigate to
192.168.0.69:3000
on your phone
It's as easy as that!
Top comments (4)
it works like a charm
make sure your computer and phone are connected to the same network (wifi, ethernet)
In Windows, use the IP in the "IPv4 Address" label.
This is not working for me