- iOS Tutorial
- iOS - Home
- iOS - Getting Started
- iOS - Environment Setup
- iOS - Objective-C Basics
- iOS - First iPhone Application
- iOS - Actions and Outlets
- iOS - Delegates
- iOS - UI Elements
- iOS - Accelerometer
- iOS - Universal Applications
- iOS - Camera Management
- iOS - Location Handling
- iOS - SQLite Database
- iOS - Sending Email
- iOS - Audio & Video
- iOS - File Handling
- iOS - Accessing Maps
- iOS - In-App Purchase
- iOS - iAd Integration
- iOS - GameKit
- iOS - Storyboards
- iOS - Auto Layouts
- iOS - Twitter & Facebook
- iOS - Memory Management
- iOS - Application Debugging
- iOS Useful Resources
- iOS - Quick Guide
- iOS - Useful Resources
- iOS - Discussion
How to disable the network in iOS Simulator?
Sometimes while testing our app on simulator we need to test for case where no internet is available. This can be achieved in multiple ways.
Below are some of the possible ways to do it
Easiest but not the most correct way is to disconnect your mac from the LAN Cable is you are on a LAN, or turn off the wifi if you are connected on a wifi network. But that will definitely turn off internet for your whole device, not just simulator. So, there are some more ways to do it
Download Hardware IO tools for Xcode.
Go to Xcode menu, select open Developer tool
Select More Developer tools from that menu
This takes you to apple developer account, sign in to your account, Now if you still have Xcode older than 8.0 you need to download Hardware IO tools for xcode, other wise for new Xcode search for Additional tools for Xcode
Download and install this tool, then open system preferences in you mac.
You’ll find the tool Network link conditioner installed there, for newer xcode versions you may find it in Xcode developer tools menu.
Use it to control the network.
This tool will also effect speed of your mac at the same time along with the simulator.
- Related Articles
- How to take a screenshot of my iOS application in the iOS simulator?
- How to use images while developing iOS App in a Simulator?
- Where are iOS simulator screenshots stored?
- How to enable/disable data connection in iOS programmatically?
- Disable Orientation Change in iOS
- Disable Scroll View Programmatically in iOS?
- How to disable the keyboard shortcuts in Matplotlib?
- How to disable Bluetooth in android?
- How to disable wifi in android?
- How to disable ONLY_FULL_GROUP_BY in MySQL?
- How to get the Navigation Bar height in iOS?
- How to enable/disable the GPS programmatically in Android?
- How to disable only the horizontal scrollbar in Java?