Android模拟器不使用Windows主机文件? [英] Android emulator doesn't use Windows host file?
问题描述
Chrome浏览器使用Windows的主机文件:
Chrome using the windows' HOST file:
Android模拟器:
Android emulator:
修改
在Windows中,模拟器通过调用GetNetworkParams()API获取地址。请注意,这通常意味着模拟器忽略你的内容的hosts文件(/ etc /在Linux / OS X主机,%WINDOWS在Windows上)%/ SYSTEM32 / HOSTS。
"On Windows, the emulator obtains the addresses by calling the GetNetworkParams() API. Note that this usually means that the emulator ignores the content of your "hosts" file (/etc/hosts on Linux/OS X, %WINDOWS%/system32/HOSTS on Windows)."
我怎么能在模拟器中使用静态IP地址?
how can I use static IPs in the emulator?
推荐答案
FWIW,它的没有的可能改变手机本身的 / etc / hosts中
仿真器中的文件 - 这是一个只读文件系统
FWIW, it's not possible to change the phone's own /etc/hosts
file within the emulator - it's on a read-only file system.
就个人而言,我会在PC上运行本地解析服务器,在这一点上您的Windows O / S,然后覆盖项正确。
Personally, I'd run a local resolving server on your PC, point your Windows O/S at that, and then override the entries properly.
没有限制将做的工作,并有一个很好的功能,让您插入本地数据成您的DNS结果。
Unbound will do the job, and has a nice feature to allow you to insert "local data" into your DNS results.
这篇关于Android模拟器不使用Windows主机文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!