Using Charles Proxy to test mobile app network
I would like to test the behavior of my app in case of slow network. Can Charles Proxy do it? please give me some guidance. Many thanks.
First of all, you need to know how to connect your mobile phone with Charles proxy.
Here are the quick and easy steps to set this up (I am using iPhone, but you can also connect android devices using step in this post: Debugging HTTP on an Android phone or tablet with Charles proxy for fun and profit.
Make sure that your iOS device and your laptop are connected to the same wireless network.
On your laptop (OSX) go into System Preferences -> Network to find your IP Address.
Then on your iOS device, go into Settings, Wi-Fi
Click the little arrow beside your wireless network to see the details of the network
For the proxy settings at the bottom of the screen, select “Manual” and enter the IP Address you found on step 2 and the default port that Charles Proxy listens to is 8080.
Now your iOS device will be connecting to the internet through your laptop on the port that Charles is monitoring. All your network requests from your iOS device will be viewable in your Charles window
Now you can test your application and see what network calls your app is making, and what responses it is getting back to help you troubleshoot all of those hard-to-resolve network related bugs.
Testing Your App In Various Network Conditions
Set up your proxy as described in the section above.
In Charles, open up the menu “Proxy” -> Throttling Settings and you’ll see the menu.
On the menu, turn on throttling on a global level, for all hosts. Or you can enable it only for select hosts.
Then you can choose throttle preset through the dropdown. For example, you can throttle it to a point where it simulates bandwidth over 3G. Of course, you can also set your customized network by change parameter in the throttle configuration, like round-trip latency. (my favor is setting it to 25000000ms)