I have been thinking about how to access my localhost in windows from Android/Apple devices. Every now and then, web developers bump into the problem of accessing localhost sites/apps from their mobile devices.
As a general practice, all files of a website are uploaded to the remote server (generally under a subdomain named “demo”) and tested using various devices and browsers. Whenever any file goes under any change, it is again uploaded to the remote server for testing. This is certainly time consuming and tiresome task.
I develop my all sites, static or dynamic, on my personal computer, with the help of XAMPP 5.6.3 (32-bit).
Recently, I have learned about accessing localhost over Wi-fi from a tutorial. Through this process, now I can access my localhost from mobile devices, and test my sites locally to meet clients’ demands with ease!!! This new method has made my development process faster and easier.
My Networking Setup
Fig. 1 and Fig. 2 show a general picture of my networking setup. My PC is connected to my Wi-fi router using an RJ-45 cable and my mobile phone and Samsung tab also connect to the Internet through Wi-fi. First thing is to get the IP address of my localhost. Open the command-line box using the “cmd” command from Windows Run and type “ipconfig”. ipconfig gives me the IP address of localhost (PC) which is “10.0.0.101”.
This is it. This is the minimum setup for you to access your websites that reside in your “localhost”.
Now to test the setup. Take up your Android device or iOS device and fire up your browser. Type in the address of your localhost in the address bar, http://10.0.0.101, and tap on the “Go” button. You should see the content of the localhost, like the following:
I have been using this setup now and am quite happy that it’s working for me well. I hope that this model will come in handy in your case too.
Well, how do you test your web projects from your devices for responsiveness? Please express your thoughts in the comment section and share the information with us. Thank you for reading!
Leave Your Comment