Android模拟器不使用Windows主机文件? [英] Android emulator doesn't use Windows host file?
问题描述
m3 http://img245.imageshack.us/img245/461/65254534.jpg
Chrome使用Windows的HOST文件:
Chrome using the windows' HOST file:
m1 http://img266.imageshack.us/img266/9380/59750633.jpg
Android模拟器:
Android emulator:
m2 http://img821.imageshack.us /img821/7363/19470766.jpg
编辑
在Windows上,仿真器通过调用GetNetworkParams()API获取地址,请注意,这通常意味着模拟器忽略主机文件的内容(Linux / OS X上的/ etc / hosts,%WINDOWS%/ system32 / HOSTS在Windows上)
"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
fil e在仿真器中 - 它在一个只读文件系统上。
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屋!