As a developer, no matter testing, front-end or back-end daily development or bug location, it is indispensable to capture packages. When it comes to capturing packages, Windows system uses fiddle, Mac system uses Chrales to capture packages, but some developers are not familiar with the configuration and operation of capturing packages, some time ago, I will not capture packages 😄, today mainly tells about the Mac system to capture packages, is sort of a memo, the future of their own reference and learning. So here’s how I learn to sell.

Step 1: download and install chrales to chrales website https://www.charlesproxy.com/ download chrales, simple installation.

After installation you have a nice vase in your application and there it is. Launch Chrales to start our configuration. Choose “Proxy” -> “Mac OS X Proxy” from the menu, as shown below:

Choose Proxy > SSL Proxying Settings from the menu, as shown below:

Select “Help” -> “SSL Proxying” -> “Install Charles Root Certificate” from the menu as follows:

Set the certificate to trust

Step 2: Set up the mobile phone agent

Select “Help” -> “Local IP Address” from the menu, as shown below:

There are two IPS, right? Which one should I use instead ☁️ ☁️ ☁️

Check the network configuration of the PC and find that the Ethernet and Wi-Fi are connected. To capture packets, ensure that the mobile phone and the PC are on the same LAN. Therefore, set 172.16.90.9 as the proxy of the mobile phone, open the mobile phone, and configure the proxy server IP address and port 8888.

HTTP packet capture is now possible, but HTTPS packet capture is not possible. Now the most important step is to install SSL security certificate for the mobile phone.

Select “Help” -> “SSL Proxying” -> “Install Charles Root Certificate on a Mobile Device” from the menu as follows:

The following popup window appears:

Configure your device to use Charles as its HTTP proxy, at 172.16.80.227:8888, and then browse to [CHLS. Pro/SSL](CHLS.

Enter chls.pro/ SSL in Safari to install the certificate. Note 1: Delete all previous certificates and install a new certificate. And make sure Charles is on on your computer. Note 2: For iOS 10.3, you need to enable full trust Charles certificates in Settings → General → About This machine → Certificate Trust Settings

HTTPS cannot be caught or cannot be caught. 1, delete all Charles certificates of the mobile phone 2, browser installation certificate, certificate address CHLS. Pro/SSL 3, access ios about the mobile phone, trust the Charles certificate of the mobile phone (PS: Android students may trust the mobile phone certificate in different places)