0

我正在尝试使用 Android 模拟器来使用在我的本地机器上运行的服务。我有一个在 IIS 下运行的站点,它在我的主机文件中如下所示:

127.0.0.1       www.local.company.co.uk

我有几个在 Apache Tomcat 下运行的站点。我的 Tomcat 相关站点的主机文件:

127.0.0.1       internal.localhost.company.com  # port:8090
127.0.0.2       external.localhost.company.com  # port:8081
127.0.0.3       auth.ws.localhost.company.com  # port:8082
127.0.0.8       mysite.localhost.company.com  # port:8086

到目前为止我尝试过的(在以下步骤中):

adb pull /etc/hosts

编辑安卓主机文件:

127.0.0.1        localhost
10.0.2.2         myefc.localhost.efinancialcareers.com

adb remount
adb push hosts /etc/hosts

然后我尝试在浏览器中访问 myefc.localhost.efinancialcareers.com 并被告知找不到网页。我至少希望它可以访问 www.local.company.co.uk。

理想情况下,我希望能够访问上述主机文件示例中指定的本地计算机上的任何站点。

我在 Windows 7 上使用 Tomcat 6。我使用的模拟器是 nexus one。

4

1 回答 1

0

I recommend to read this arcticle: http://developer.android.com/tools/devices/emulator.html#emulatornetworking

'Each instance of the emulator runs behind a virtual router/firewall service that isolates it from your development machine's network interfaces and settings and from the internet. An emulated device can not see your development machine or other emulator instances on the network. Instead, it sees only that it is connected through Ethernet to a router/firewall."

There are some recommendation in there for advanced networking.

于 2013-01-11T02:43:32.490 回答