Responsive Web design, well I know the developer console is a greater tool for debugging. and it gives you an option to check the responsiveness of your webpage. but checking it on a real device is always better.
So how to do it without too much hassle? The simple answer is with help of VS Code and Extensions called Live Server.
Before proceeding make sure your laptop and mobile device are connected to the same wifi.
For this, you need to install VS Code from here. And Live Server Extensions by Ritwick Dey from here.
After installing open your project folder on VS Code. You can do it by "drag-and-drop" or by navigating to "File > Open Folder
".
Then open index.html
and right-click on Editor, from the "Explorer Window" choose "Open with Live Server".
Remember the port, on which the live server is running.
Now open "Command Prompt" on windows and type ipconfig
hit Enter. Check the IP Address.
Now open your favorite browser on your smartphone and on the address bar enter the IP Address of your Computer and port of the local server. after that file name. like http://ip_address:port/filename
for example, mine would be: http://196.168.43.14:5500/index.html
Top comments (4)
I want this but with something like React/Next, any idea? not even sure how to search for it :c
Hey, this method is also applicable to React/Next JS. You won't require Live server in this case, as you can simply use
npm run dev
. To access the application from another device, visithttp://ip_address:port
in your web browser.It works.
Thank you.
Thank you so much, I got it up and running