Localhost running on mac.. Can I view it on my Android phone?

前端 未结 11 1217
遥遥无期
遥遥无期 2021-01-30 04:59

Running a ruby on rails project on my mac. I need to test it on my android phone. Is there a way to view my mac localhost on my android phone?

11条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-30 05:42

    MacOS Catalina 10.15.4

    1. Go to Settings -> Security and Privacy.

    1. Select Firewall tab and unlock the settings using your laptop password:

    1. Select Firewall Options... and in the dialog uncheck the box for Block all incoming connections and hit OK.

    1. Open Terminal and type ifconfig. Look for the en0. In the section find the address sitting near inet - this is the address of your laptop in a local network.
    en0: flags0= mtu 0
    ...
            inet 192.168.0.123 netmask 0xffffff00 broadcast 192.168.0.255
    ...
    
    
    1. Use the IP address + the port (in case you are using localhost:4200 for development), otherwise omit the port:
    http:// inet>:
    
    1. Profit!

提交回复
热议问题