编辑iPhone Simulator主机文件 [英] Editing the iPhone Simulator hosts file

查看:56
本文介绍了编辑iPhone Simulator主机文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以编辑iPhone模拟器的hosts文件?

is it possible to edit the hosts file of the iPhone simulator?

我正在使用REST API,我需要能够使用正确的域(例如 http ://api.local.com )

I'm working on a REST API and I need to be able to access my local site using a correct domain (e.g. http://api.local.com)

推荐答案

您只需编辑Mac的/etc/hosts文件,iPhone Simulator将采用此处设置的任何内容.

You can simply edit your Mac's /etc/hosts file and iPhone Simulator will adopt whatever is set there.

它之所以有效,是因为iPhone模拟器仅提供了Mobile Safari用户界面的模拟前端,而该界面仅使用Mac的网络设置.

It works because the iPhone Simulator simply provides a simulated frontend of Mobile Safari's user interface, which just uses your Mac's network settings.

这篇关于编辑iPhone Simulator主机文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆