How can I get network captures for mobile devices?
Sometimes, you use broadpeak.io to stream on mobile devices. In contrast to web browsers, there is no easy way to enable "developer mode" and generate .har files, which are critical for efficient troubleshooting. This article describes a technique to capture troubleshooting network captures on mobile devices.
Purpose
We will describe how Charles Proxy to capture network traffic generated by a specific application installed on mobile devices. This is usually intended for troubleshooting purposes. The Charles logs (.chls) can then be saved and shared with those who require them.
Connectivity diagram
First, this is how you should set up your system to succeed. Your laptop and mobile devices should be connected to the same Wifi (see step 1 below). Step 2 will describe the configuration on the computer, while Step 2 will describe what to do on the mobile device.

How to setup
This guide was written with a Windows laptop (Step 2 below) and an iOS phone (Step 3 below) in mind, but the general concept is still the same if you are using other OS.
For Android phone, developers typically must prepare a βdebugβ version of the application before it can be used with Charles. This debug version will need to be installed on the Android phone manually by installing the given .apk, and any new app update will require a similar βdebugβ version to be prepared. This was mainly due to the security control to only have the app trust the SSL certificate generated by Charles. Refer to the section here, specifically under βAndroidβ.
Generally, the steps below will be sufficient to set up Charles on the laptop to capture traffic coming from the iPhone, and additional information can be found at the given links, if required.
-
Wifi connected to the Internet should have access to the location/country where the application is allowed to operate. If the application is geo-blocked in a selected country, the Wifi connection should have VPN access to that country. This usually would require some configuration on the access points themselves. Similarly, if a typical mobile phone were used as a Wifi hotspot/tethering, it may have a VPN software installed on it that can connect to that specific country, and other devices, e.g., an iPhone and a laptop, can then be connected to this βhotspotβ. If the application does not have geo-block restrictions, then this VPN connectivity is not required.
-
On the laptop
-
Install Charles Logs β download it here. Follow the installation instructions here. Take note of the Configuration here , but a few pointers described below should suffice.
-
Select βProxy Settingsβ. Leave the βHTTP Proxyβ port as 8888. Check βSupport HTTP/2β.
-
Uncheck βWindows Proxyβ, so it does not capture activities on Windows.
-
Select βSSL Proxying Settingsβ. Check βEnable SSL Proxyingβ and add . into location.
-
After Step 3.i. below, Charles SSL Certificate will be installed onto the mobile phone. Note that the IP address below will differ depending on whatβs captured. In the example below, itβs 192.168.0.119 on my laptop. This IP and port will be required to set up as a proxy in the mobile phoneβs Wifi connection in Step 3.a below β so, note it down.
-
Connect the laptop to the same Wifi.
-
-
On the Mobile Devices e.g. Phone or Tablet, iOS or Android
-
As described in Step 2.v. above, itβs essential to βmanuallyβ configure the mobile devices to use Charles as a proxy. This is vital so that application traffic will be routed through it to capture the network activities. It is better to ensure only the application is running and no web pages are loaded on the phoneβs browser to limit the amount of traffic.
-
Manually configure the proxy, under the same Wifi connection on the phone.
-
Allow the connection and trust Charlesβ SSL certificate in your iOS device. Go to Settings > General > About > Certificate Trust Settings. Under "Enable full trust for root certificates", turn on trust for the Charles certificate.
-
-
Capture and Save the Charles Logs
-
Start the mobile application and try to reproduce the issue.
-
Note that the activities from the mobile application should be captured on Charles. Check the log activities to ensure the appβs URL request is successful without error. If there is no activity on Charles, the setup is not correctly done. In such a case, check the following:
-
The proxy was correctly configured on the iPhone. This is done by manually configuring the Wifi connection.
-
Trust the Charlesβ SSL certificate on the iPhone.
-
No anti-virus software or firewall that may block the communication between the laptop and the iPhone.
-
Check all steps from 2.ii. above.
-
Once the issue is reproduced, βsave sessionβ or βsave session asβ or βexport sessionβ and provide the logs to those who require them.
-
The file can be re-imported using Charles on any laptop to open it for analysis.
-
-
Updated 5 days ago