charles set to grab the data packets on the phone
1. Check the ip address on Charles computer
First find the ip of Charles's computer, select "Help" -> "Local IP Address" in the Charles menu bar, and the ip of Charles's computer will appear. As shown below:
2. Configure the IP and port to the mobile phone to complete the pairing
First, the computer and the mobile phone are connected to the same Wi-Fi; then, open the mobile phone "Settings" -> "WLAN", select the currently connected Wi-Fi name and press and hold to select "Modify Network", find the agent in the advanced options, select Manually configure the proxy, fill in the port number and ip (the IP is the IP on the computer, the port is generally 8888 by default, or check it in Proxy—Proxy Settings in the menu bar), and save;
3. Pair the mobile phone with the computer
Open any program on the mobile phone that requires the Internet, and Charles on the computer side will appear a confirmation pop-up window asking for a connection on the mobile phone side. Click allow to complete the pairing.
4. Set the mobile device or remote browser to download the certificate
Charles menu bar - Help - SSL Proxying - click Install Charles Root Certificate on a Mobile Device or Remote Browser;
Jump out of the pop-up box and find chls.pro/ssl
5. Install the Charles Root certificate on the phone
Open the mobile browser, enter chls.pro/ssl, jump out of the charles certificate, click to download
6. Install the certificate in the WLAN settings of the mobile phone
Long press the wifi icon to enter the WLAN interface, click WLAN settings or advanced settings, etc., then click Install Certificate, select the Charles certificate you just downloaded, and finally click OK
7. Verification
Open the mobile browser, enter the Baidu address, and check that Charles intercepts the request successfully
The shoes searched by the mobile browser are as follows:
The request intercepted in charles, as shown below