7 ways to Simulate Low Network Speed to Test Your Mobile Application
Tags: testing, ios, android, mobile
Published: 2021-10-04 21:00:04

When testing mobile apps, newbies QA frequently forget to check the app with an unstable Internet connection. But in many cases this is critical: connection speed directly influences user experience and workability of the main functions. It is especially true for applications where geolocation and mobile Internet are heavily in use. For example, video chats, messengers, and other [multimedia products](https://forasoft.com/services) we specialize in.

In this article, we’ll show how to simulate slow Internet connection on a test device with no hassle. 

## Network Link Conditioner

Let’s start with a standard utility Network Link Conditioner for iOS apps testing. It lets the QA adjust the Internet connection as they need.

To switch on this function on iPhone, you need a MacOS device:

1. [Download and install Xcode for Mac](https://developer.apple.com/xcode/)
2. Open Xcode on Mac
3. Connect iPhone to Mac
4. Allow Mac access iPhone
5. Open Settings on iPhone
6. Scroll down
7. Tap Developer

![iPhone settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2m94iow1pp7aey69e01b.png)

- Tap Network Link Conditioner

![Developer section setting options](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fjhdcn7deikufz7qizer.png)

- Pick network preset or create your own
- Switch on the Enable toggle

![Enable toggle in Network Link Conditioner](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ae0ltbgum3ovijc07yt.png)


iOS lets us choose one of pre-installed presets of connection quality – or create our own preset.

For our own preset these settings are available:

![Settings for preset connection quality](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dvspu69llpmun0ux9gjj.png)

Here we see that Apple took care of testing apps with different levels of connection quality and gave us almost all the needed settings.

Having got acquainted with Network Link Conditioner for iOS, we’ve been sure such a feature would be on Android too. God, how much we’ve been mistaken.

## Network Link Conditioner on Android

It appeared to be impossible to emulate a slow or unstable connection on a real Android with the help of standard tools. Therefore, I faced 2 paths: download some apps from Google Play that emulate slow connection, or use a specifically precise adjustment of the Internet connection access point.

Apps didn’t work out for me ☹ All the apps that give this function require Root access, and this breaks the concept of testing in real-world conditions.

So, having left the Root access as the last resort, I decided to look closer at path #2 — adjustment of the access point.

In the past, when I was a student, mobile internet traffic was ending up quickly (and we needed to read, watch something while on the lesson), and we used an iPhone as an access point. The idea came to mind: to mix the student experience and recently gathered knowledge.

Using Network Link Conditioner and an access point made of macOS or iOS doesn’t require any extra knowledge and are easy to adjust. Exactly what’s needed if we want to save time. 

So, to emulate bad connection on Android we need and Android device and… an iPhone with mobile internet Developer Tools switched on.

1. Make iPhone the access point _(Settings > Mobile Data > Personal Hotspot)_
2. Adjust connection with _Network Link Conditioner_
3. Connect to the access point with the Android device
4. Ready. You’re awesome 🙂

## Cloud device farms

You don’t have to own a device farm to test an app on a wide range of mobile devices. It’s also quite inconvenient if you or your employees mostly work remotely. We started using cloud device farms, and let us tell you — it’s a big gamechanger. You should try it for better mobile testing. 

Some farms (e.g. [Browserstack](https://www.browserstack.com/) or [LambdaTest](https://www.lambdatest.com/)) allow connection throttling — artificial connection slowdown — for testing on mobile devices. 

![Throttling options on Browserstack](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j7h5g8luv3gbtoxkpjaf.png)

It might require a paid subscription to throttle the connection. For Browserstack the individual plan price starts from $29.

## Android emulator testing

Another way to simulate slow connection is to use an emulator. It’s software for a PC that copies another OS. Android emulator imitates the performance of a real smartphone, so you can test your mobile app on it if you don’t have an actual device.  

Testing on emulators could never compare to testing on real devices but it’ll do for the first development stages. 

With Android studio emulators you can set the limit based on the cellular type (LTE, EDGE, etc.). Each type has its own speed limitations (in kbps): 

**gsm** — GSM/CSD (up: 14.4, down: 14.4)
**hscsd** — HSCSD (up: 14.4, down: 57.6)
**grps** — GRPS (up: 28.8, down: 57.6)
**edge** — EDGE/EGPRS (up: 473.6, down: 473.6)
**umts** — UMTS/3G (up: 384.0, down: 384.0)
**hsdpa** — HSDPA(up: 5760.0, down: 13,980.0)
**lte** — LTE (up: 58,000, down: 173,000)
**evdo** — EVDO (up: 75,000, down: 280,000)
**full** — No limit, the default (up: 0.0, down: 0.0)

### How to test an app on Android emulator with throttled connection?

1. Download Android Studio

2. Create an emulator using [Android Virtual Device Manager](https://developer.android.com/studio/run/managing-avds#createavd) 

3. When creating / editing the emulator pick the cellular type: 

- Tap _Show advanced settings_

![Advanced Settings in Android Studio](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t18rw1886z6dhqrvcb8s.png)

- Select speed in the _Network section_

![Picking the Speed in the Network section](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ds08bv834sfqbkiflfuz.png)

- Run the emulator
- Launch your app in the emulator
- Turn off the WiFi on the emulator for it to use cellular connection settings

## Changing cellular type in the device settings 

You can pick a certain cellular type on an actual Android or iOS device. To do that you’ll also need a SIM-card with Internet access.

### How to switch to another network on an Android device? 

1. Go to _Settings_
2. Then _Network & Internet _
3. Open _Internet_
4. Go to _SIM settings_
5. Tap _Preferred network type_


![Instruction on how to switch cellular types on Android](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iyyvqv1l0ia9o2k5pwj1.gif)

Works for Android 12. Section names and placings may differ depending on the device and OS version. 

### How to switch to another network on an iOS device? 

1. Go to _Settings_
2. Then to _Mobile Data_
3. Open _Mobile Data Options_
4. Tap _Voice & Data_

![Instruction on how to switch cellular types on iOS](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4uoj5asje5ntn9d03xnp.gif)

Works for iOS 15.

## Bandwidth throttling in web debugging tool Charles

If cloud farms are expensive, launching an emulator is complicated, and you don’t have any SIM, you can use the network throttling function in Charles. 

Basically, you can use Charles to keep track of the mobile devices traffic when you carry out functional testing or debugging. But you can also use it to simulate slow internet connection for testing.  

### How to imitate slow connection with Charles?

1. Setup your host machine with Charles installed as a proxy for the device and the app you’re testing. Learn more about it from [the Charles documentation](https://www.charlesproxy.com/documentation/configuration/browser-and-system-configuration/). 
2. When in Charles go to _Proxy > Throttle settings_
3. Tap _Enable Throttling_
4. Select the speed limitation preset or set it up manually
5. Save the settings
6. Click _Proxy > Start throttling_

![How to start throttling on Charles](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8fvz5cevndo4q6ip8ywm.png)

## Throttling the speed in the router settings

You can also go for a radical way and throttle the speed in your router settings. It will definitely work if you test your app at home, on a real device, and you have access to the router admin panel. Keep in mind that having such an option depends on the router.

### How to throttle the connection on a router?

1. Go to the router settings. To do that, enter the special URL or the router IP in the address bar of your browser (192.168.1.1 or 192.168.0.1)
2. Enter login and password. You can find them on the router itself (usually both are “admin” by default) 
3. Open the Bandwidth control section

![What a standard Admin panel looks like](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/djbugatu40rdozr9yslx.png)

Don’t forget to cancel the limitation once you’re done 🙂

## Conclusion

There’re many ways to test an app and fake bad internet connection. The most convenient one, at least for us, is Network Link Conditioner. But you’re free to choose the best for yourself. 

Tested everything, it all worked out? Don’t forget to [report on it](https://forasoft.com/blog/article/how-to-report-on-testing-259) 🙂