本文介绍了是否可以在 iOS 模拟器中禁用网络?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试调试我在从 Internet 获取其主要数据的应用程序中看到的一些不一致的行为.我在模拟器中没有看到问题,只是在设备上,所以我想在模拟器中重现网络和连接环境.

I am trying to debug some inconsistent behaviour I am seeing in an application that gets its primary data from the Internet. I don't see the issues in the simulator, just on the device, so I'd like to reproduce the network and connectivity environment in the simulator.

有没有办法在模拟器中禁用网络?

Is there a way of disabling the network in the simulator?

(我远程连接到 Mac 进行编码,目前没有其他选择,因此禁用操作系统网络不是一个选项).

(I am connecting to the Mac remotely to code, and there isn't any other choice right now, so disabling the OS network isn't an option).

推荐答案

恐怕不会——模拟器共享操作系统正在使用的任何网络连接.不久前,我提交了一份关于模拟网络状况的雷达错误报告;你可能会考虑这样做.

I'm afraid not—the simulator shares whatever network connection the OS is using. I filed a Radar bug report about simulating network conditions a while back; you might consider doing the same.

这篇关于是否可以在 iOS 模拟器中禁用网络?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 06:56