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.

    1. Make sure that your iOS device and your laptop are connected to the same wireless network.

    2. On your laptop (OSX) go into System Preferences -> Network to find your IP Address.

    3. Then on your iOS device, go into Settings, Wi-Fi

    4. Click the little arrow beside your wireless network to see the details of the network

    5. 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.

    6. 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.

    1. In Charles, open up the menu “Proxy” -> Throttling Settings and you’ll see the menu.

    2. On the menu, turn on throttling on a global level, for all hosts. Or you can enable it only for select hosts.

    3. 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)

    Have fun!



Suggested Topics

  • 2
  • 3
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2