在Mac上运行的Localhost.可以在Android手机上查看吗? [英] Localhost running on mac.. Can I view it on my Android phone?

查看:364
本文介绍了在Mac上运行的Localhost.可以在Android手机上查看吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Mac上运行ruby on rails项目.我需要在我的Android手机上对其进行测试.有没有办法在我的Android手机上查看我的Mac本地主机?

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?

推荐答案

名称"localhost"只是对您自己的计算机的回送.要在Android上访问它,您需要找到计算机的IP地址.

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.

查找此信息(在Mac和Linux上均可使用)的最通用方法是进入终端并键入ifconfig.查找"en0"或"en1",然后在该条目下查找"inet"列表.类似于"192.168.1.100".找到该地址后,这就是您要在浏览器的地址栏中输入的内容.

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.

(特别是在Mac上,您可以转到系统偏好设置"中的共享"窗格,并在其中告诉您.)

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

这篇关于在Mac上运行的Localhost.可以在Android手机上查看吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆