If you have been through Mobile Apps development
or testing, you should know the importance of testing the app in varying network
conditions specially the weak network conditions. We need to ascertain the proper functioning of our apps when the bandwidth
is very low or when there is no connectivity at all. Remember robust apps do not
break down due to speed issues.
Using Charles, we can downgrade/limit the
internet speed and simulate various low network conditions to effectively test
our app. Slowing down of internet speed is called Bandwidth Throttling.
Let’s see how to do this. For this exercise
we will use Android device, process/concept on iOS devices is almost the same.
Setting up a proxy in the mobile device is
the first step, lets configure it first.
Configuring Proxy On The Mobile Device:
Prerequisite:
- Mobile device and a system (desktop/laptop) connected to the same WiFi.
- Keep the IP address of the system handy, you will need it while configuring proxy.
- Charles (Free only in trial period, else it is paid)
Steps:
2. Long press on the connected WiFi name.
3. Navigate to the "Manage network
settings" page.
4. In the Proxy drop down select “Manual”
5. In the "proxy Hostname" field type the IP
address of your system which will act as a proxy6. In the "Proxy port" field type “8888”
7. SAVE the connection
Your proxy is all set. Launch Charles on
your system, all the mobile traffic would now be routed via Charles.
Next step in the process is to throttle the internet
speed on your device. This can be achieved by controlling the
internet speed on your system, eventually your mobile device would be using the
internet of your system so controlling/limiting the speed on your system will
directly limit the internet speed on your device.
Setting Up Charles
Steps:
- Open Charles, Click on Proxy option in the title bar at the top.
4. In the Bandwidth field select the Download and Upload speed you want.
5. The speed you specify is in kbps so
enter accordingly.
For e.g to get a download speed of 1 Mbps enter 1000 in
Download field and to get an upload speed of 2 Mbps enter 2000 in the Upload
field.
7. Keep it close to 80 or 90
percent to get the speed you have specified in the Upload and Download fields,
keeping this value low means degrading the speed further for e.g. keeping this
to 10 would really slow down your internet speed.
8. Leave other fields as is unless you really want to change them.
9. Click OK
Hola!!!! you are all set. Try opening any webpage or any app on your device and you will get the internet speed that you have mentioned in the Charles settings.
8. Leave other fields as is unless you really want to change them.
9. Click OK
Hola!!!! you are all set. Try opening any webpage or any app on your device and you will get the internet speed that you have mentioned in the Charles settings.
Other Pointers
- The “Throttle Preset” field simulates some of the internet connection types. For e.g. selecting 3G would simulate a 3G connection.
- Reliability and Stability is used to simulate the reliability and stability of the connection. This is used to simulate connections that have frequent drops.
- Last but not the least after you are done with the settings in Charles just test it by opening www.speedtest.net or http://beta.speedtest.net/ on your system and check if you are getting a speed close to what you have desired. It may not be same but it would be close enough.
Thank You, I was out of my working place for sometime. Will be working on some new posts shortly.
ReplyDeleteThank You!!
ReplyDeleteThe bandwidth bottleneck often proves to be a tiresome issue. Thank you for such an effective article on how to deal with it. However, if anyone is looking to switch their internet service provider in Oman, Internet Packages they should look up AWASR.
ReplyDeleteGood Post. I like your blog. Thanks for Sharing
ReplyDeleteWiFi Speed Test
I'm glad that it helped you.
DeleteMany thanks for providing this information.
ReplyDeleteWifi Speed test
Wifi Speed