【发布时间】:2016-02-25 11:37:40
【问题描述】:
我正在使用 genymotion 模拟器并从中提取主机文件
adb 重新挂载
adb pull /system/etc/hosts C:\Users\Rkn09\Desktop\hosts
我添加了新的映射,例如 192.168.0.115 xxx.mydomain.com 我将它推回模拟器使用
adb push C:\Users\Rkn09\Desktop\hosts /system/etc/hosts
但是当我向 xxx.mydomain.com 发出请求时,它不会重定向到我在 LAN 192.168.0.115 中的本地计算机。我什至使用 cat /etc/hosts 检查了主机文件,它有我的映射,谁能帮我解决这个问题。
PS:相同的进程在 Mac OS X EI Captain 中运行良好,我在 windows7 中遇到了这个问题
【问题讨论】:
-
完全相同的问题,不幸的是,不能投票两次!
-
在模拟器中使用 192.168.x.x 是否有效?就我而言 - 是的,但 dns 仍未解决
-
我的朋友遇到了类似的问题,问题出在 hosts 文件中,因为 Windows 记事本。我们没有在记事本中编辑主机文件,而是在 adb shell 中使用“echo”命令将主机条目添加到主机文件中。
标签: android android-emulator localhost genymotion hosts