[英]Access localhost from Android device
我在os x笔记本电脑的xampp中有一台服务器,当我在仿真器Web导航器中键入:10.0.2.2/myphpServer时,一切正常,但是从USB连接的真实android设备上,我无法连接。
Check public ip of your pc by ifconfig
command in terminal then use YOUR_IP/myphpServer
通过终端中的ifconfig
命令检查PC的公共IP,然后使用YOUR_IP/myphpServer
If you are in local network (router or LAN) then use your local_ip/myphpServer
(make sure your mobile is also in same network) 如果您位于本地网络(路由器或LAN)中,请使用local_ip/myphpServer
(确保您的手机也位于同一网络中)
If your mobile doesn't have internet connection then go for Android USB Tethering 如果您的手机没有互联网连接,请使用Android USB网络共享
您需要将两个设备都连接到同一网络才能访问Android设备中的localhost。
最好在cmd ipconfig
使用笔记本电脑类型的IP地址搜索本地连接:IPv4地址
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.