Using Network Link Conditioner to simulate bad network conditions on iOS and macOS
Tags: ios, xcode
Published: 2021-11-04 20:42:19

---
title: Using Network Link Conditioner to simulate bad network conditions on iOS and macOS
published: true
date: 2021-11-04 19:53:57 UTC
tags: ["ios", "xcode"]
canonical_url: https://tarikdahic.com/posts/using-network-link-conditioner-to-simulate-bad-network-conditions-on-ios-and-macos/
cover_image: https://tarikdahic.com/images/network-link-conditioner-share.png
---

 **Network Link Conditioner** is a network utility tool provided by Apple that can simulate various network conditions and help us to develop better apps. If you ever received a bug report where user mentioned slow network connection the Network Link Conditioner will help you to reproduce that issue.

We are always on the go, using our mobile devices in different places with different network conditions and we need to adjust the apps that we develop for that conditions. For example, the elevators are ruthless, somehow the app that I work on has always issues with them! 😀

## Installation

Network Link Conditioner is available on iOS and macOS and in this article I will cover how to install and use it on both platforms.

### iOS

To enable Network Link Conditioner on iOS device you will need to enable that device for **development**. You can do that by connecting and building the app directly to your device. If your device is not enabled for development, Xcode will do that before building and installing your app.

The other option is to go to _Window_ → _Devices and Simulators_ in Xcode and from there select your device and enable it for development.

Inside the _Settings_ app you will now have a _Developer_ section and inside that section you will be able to use Network Link Conditioner.

![](https://tarikdahic.com/images/network-link-conditioner-ios.png)

### macOS

You will need to go to _more downloads_ page on the Apple Developer portal to and search for appropriate **Additional Tools** for your Xcode version. [This](https://developer.apple.com/download/all/?q=Additional%20Tools) link will take you directly to those search results. Download the `dmg` file, open it, and inside _Hardware_ folder you will find the file called `Network Link Conditioner.prefPane`.

![](https://tarikdahic.com/images/network-link-conditioner-install.png)

Double click on it to install it and when the installation is completed you can open the **Network Link Conditioner** by going to the _Settings_ app and at the bottom of the window you will find it.

![](https://tarikdahic.com/images/network-link-conditioner-settings.png)

## How to use

**Network Link Conditioner** comes with a lot of presets that you can use like _3G, Edge, Very Bad Network, LTE, 100% Loss_ and more. They are great for testing your app on bad network conditions and in most cases you will not need to create custom presets (profiles).

To use it, pick a preset and just _flip the switch_ to enable it. It is that easy, but don’t forget to turn it off after you are done with testing because it is applied on the entire system.

Every preset has following:

- **Downlink** bandwidth, packet drop rate and delay in ms
- **Uplink** bandwidth, packet drop rate and delay in ms
- **DNS Delay**

By tweaking these attributes you can simulate a lot of different network conditions.

**Edge** is a great preset to see how your app behaves on very slow networks. **Very Bad Network** preset is great when you want to test that you have connection to the Internet but that it is very unreliable.

I am working with VoIP and I have found that custom profile with _60%_ packet loss in both directions is very great for testing reconnection and recovery mechanisms.

If you are using **iOS Simulator** you will need to install the Network Link Conditioner on macOS and apply it to entire system. This will affect the connection of your entire macOS.

Here’s a little trick that I use for uploading. When I need to upload a large file and I don’t want to make my home network unusable I just turn on Network Link Conditioner with custom profile that limits my upload speed. It is configured like this:

![](https://tarikdahic.com/images/network-link-conditioner-upload-limit.png)

**Network Link Conditioner** is a very useful tool and if you are not using it to test your apps your users might suffer! If you have any questions, please post them in the comments below.