如何从iPhone模拟器访问主机本身 [英] How do I access the host machine itself from the iPhone simulator
问题描述
我正在开发一个连接到Web服务的应用程序,用于大多数操作。作为一种捷径,我想在我的机器上运行我的开发服务器的副本。问题是:
I'm developing an app that connects to a web service for most of it's operations. As a shortcut, I'd like to run a copy of my development server on my machine. Question is:
如何/我可以从iPhone模拟器访问主机的网络(在这种情况下为http)?
How/can I access the host machine's network (http in this case) from the iPhone simulator?
我正在与应用程序一起开发Web服务,因此将它们放在主机上会很有帮助,然后我可以根据需要提交更改。
I'm developing the web service alongside the app, so it would be helpful to have them both on the host machine, and then I can commit changes as needed.
推荐答案
iOS模拟器使用主机网络,因此您应该只能使用localhost或您的机器IP地址,无论您的网络服务正在侦听哪个IP。
The iOS Simulator uses the host machine network so you should be able to just use localhost or your machines IP address, whichever IP your web service is listening on.
这篇关于如何从iPhone模拟器访问主机本身的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!