Mark Steggles Mark Steggles - 1 month ago 14
Android Question

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

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?

Answer

The name "localhost" is just a loopback to your own computer. To access it on your Android, you need to find the computer's IP address.

The most general way of finding this info, which works on both Mac and Linux, is to go into the Terminal and type ifconfig. Look for either "en0" or "en1", and under that entry look for the "inet" listing. It will be something along the lines of "192.168.1.100". When you find that address, that's what you'll want to put in your browser's address bar.

(On a Mac specifically, you can go to the Sharing pane in System Preferences and it'll tell you there.)

Comments