且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Chrome浏览器中查看在本地机器上运行的网站?

更新时间:2023-11-30 16:14:10

在您的mac上打开您的网络偏好设置(点击顶部的wifi信号)。找到您当前连接到的网络的IP地址。在手机的浏览器中,输入该IP地址并在其后面追加:3000到$

I am working on a rails web app, currently focusing on the mobile design and would like to view html screens I have developed in the mobile chrome browser on my Galaxy Nexus (running Jelly Bean).

On my MacBook Pro I am able, obviously, to run a local server and view the site on my machine via LocalHost:3000 url. Would it be possible to complete some network configuration on my phone/macbook pro to view the Local Host site on my phone when its running on my machine? Could Chrome Dev Tools be leveraged in anyway?

e.g.

https://developers.google.com/chrome/mobile/docs/debugging

+5 cool points for whoever answers this question. :)

On your mac go open your network preferences (click the wifi signal at the top). Find the ip address of the network you are currently connected to. In the browser of your phone, type in that ip address and append :3000 to the end of it