端口转发本地服务器到Expo Android模拟器
我的笔记本电脑中有一台本地服务器。我想通过Android模拟器中的Localhost访问它。我该怎么做?
I have a local server running in my laptop. I want to access it via localhost in the android emulator. How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过进入仿真器内的地址10.0.2.2从Android模拟器内部访问主机。
例如,如果您可以通过
localhost:8080
在本地计算机上访问Web服务,则可以通过从模拟器内部键入相同的访问。有关模拟器网络的更多详细信息,您可以阅读在官方文档中
You can access host machine from inside the android emulator by going to the address 10.0.2.2 inside the emulator.
For example if you have a web service accessible on
localhost:8080
on your local machine, you can access the same by typingfrom inside the emulator. More details about emulator networking you can read in the official documentation