我在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
If you are in local network (router or LAN) then use your local_ip/myphpServer
(make sure your mobile is also in same network)
If your mobile doesn't have internet connection then go for Android USB Tethering
您需要将两个设备都连接到同一网络才能访问Android设备中的localhost。
最好在cmd ipconfig
使用笔记本电脑类型的IP地址搜索本地连接:IPv4地址
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.