Charles is a proxy tool used for network debugging and analysis, which allows you to view and debug the network communication between devices and servers. With this tool, you can monitor the network traffic of applications, modify requests and responses, and even simulate different network conditions. It provides the following functions:
When using Charles to capture packets, you need to configure a Charles client proxy to forward application requests to the server. When you start Charles, it automatically sets the browser as a proxy. Once network requests are sent through the browser, Charles directly captures network packets of the network requests and their responses.
Charles can capture HTTP requests from both PCs and applications. To implement network capturing on a mobile device, you need to configure the Charles proxy. To capture HTTPS packets, you need to download the Charles certificate and install the certificate.
To use Charles, perform the following steps:


Tap the target Wi-Fi network to launch the setup screen. Select Manual from Proxy, and set the host name and port number of the proxy server to the IP address and listening port of Charles (that is, 8888). Then, enter the correct password to connect to the Wi-Fi network.
On the top menu bar, choose Help > SSL Proxying > Install Charles Root Certificate > Install Certificate. Set the storage location (the current user or local computer) and click Next. Select Place all certificates in the following store, click Browse, and set the certificate storage path to Trusted Root Certification Authorities.

Method 1: On the top menu bar, choose Help > SSL Proxying > Install Charles Root Certificate on a Mobile Device or Remote Browser. Access http://chls.pro/ssl -> via the browser of the mobile phone, and click Download Now to download the certificate to the mobile phone memory.


Method 2: On the PC, choose Help > SSL Proxying > Save Charles Root Certificate... to save the certificate in .pem format to the local PC. Connect the mobile phone to the PC, and upload the PEM file to the phone through DevEco Studio (specifically, right-click the folder where the PEM file is to be uploaded, click Upload..., and select the PEM file).

To install a certificate on a mobile phone, perform the following steps:
On the mobile phone, go to Settings > Security > More settings > Encryption and credentials. Select Install from storage, and click CA Certificate. When you see a warning, click Continue, navigate to the downloaded certificate, click the certificate to install it. The certificate is successfully installed if a success message is displayed.
Selecting Install from storage | Clicking CA Certificate |
|---|---|
|
|
Generally, the tool is expected to listen only for the requests sent by the specified directory server and filter out other network requests. To meet this requirement, you can use either of the following methods:

