Grab Bag tool Charles (Mac usage record)

Source: Internet
Author: User

First, Introduction

Charles is a Mac-side interception and Analysis Network request tool, in the network development using it for analysis, can greatly improve our development efficiency. Charles is a fee-based software, generally can be tried for 30 days, but can be the corresponding crack to obtain services.

Second, installation and use

After downloading the compressed package, unzip the open, drag the package into the application folder, this time an original software can let us use, just have a trial period, right click on our Charles app, show package content:

Replace the jar package in the following folder with the jar package in our cracked folder:

Third, using Charles to carry out packet capture analysis on Mac

After the software installation, we can intercept the general network request on the Mac, open the software, the proxy settings in the Mac OS X proxy tick, set as a network proxy, if a network request occurs, can be intercepted by Charles

The interface for capturing information is as follows:

The software is very powerful, structure is to sort the request by domain name, sequence is to sort the request time, the following request and response, respectively, the requested packet and the returned packet, if it is JSON data, will automatically help us to parse the format.

Iv. grasping the packet on the mobile device

Intercept the network request on the mobile device, our mobile device must be in the same network segment as the computer, check the IP address in our computer's network settings, then on the mobile device click on the network on our connected computer, in the Agent column, select Manual, the IP address we just looked at here, and set a port number that is the same as Charles, which is 8888 by default.

In the proxy setting in Charles, select and configure the port number as follows

Crawling the HTTPS protocol on your Mac or mobile device requires special configuration: on your computer: Install Charles Root CertificateSelect "Install Charles Root Certificate", after the initial installation successful interface is as follows:However, "This root certificate is not trusted" is not possible, so you also need to right-click on the shortcut menu, select "Show Info" to open the following interface:Change the "trust"-"Use this certificate:" option to "Always trust", then close the introduction panel, and then go back to the "Keychain Access" interface, will become, indicating that the installation has been successful:2. Install Charles Root Certificate in IOS simulatorsSelect "Install Charles Root Certificate in IOS simulators" and the following prompt will pop up when the installation is complete:3. Install Charles Root Certificate on a Mobile Device or Remote BrowserSelect "Install Charles Root Certificate on a Mobile Device or Remote Browser" which will pop up the following prompt box:

  

  

4. On the Charles toolbar, click the Settings button, select SSL proxying Setting, select Enable SSL proxying, and then in the locations form fill in the domain name and port to grab the package, click the Add button, In the pop-up form, host fill in the domain name, such as fill api.instagram.com,port 443, if not joined locations form, there will be an error in the packet capture: SSL proxying not enabled for the This host: Enable in Proxy Settings, SSL locations, this time, on the left side of the domain name right-click: SSL proxying Enabled, OK. (This is actually the operation of adding locations above, but this operation is to simplify the operation)

On the phone

Click the button at the far right of your mobile networkGo to the following page, turn to the bottom, switch "HTTP proxy" to "manual", enter the IP address of the Mac that shares this network in the "Server" field, and enter "8888" in the "Port" field:At this point, if Charles on your Mac is open, the window will pop up like this:Click on the "Allow" button to successfully set up Charles to your device's HTTP Proxy, the device HTTP request can be caught, but HTTPS is not possible!!!(2) Browse to Chls.pro/ssl to download and install the certificate.Follow the prompts in the browser to enter "Chls.pro/ssl", will automatically jump to the following page:Click "Install" in the top right corner to access the following pages:Click "Install" in the top right corner again to eject the bullet box from the bottom, such as:Click the "Install" button to go to the following page: Enter general---about certificate trust settings for this machine, set the certificate you just installed as a trustAt this point, it's done!

V. More applications of Charles 1. Filtering Network Requests

Sometimes we just want to crawl a host's network request, we can set up a filter network, in the Proxy menu recording setting, we select the include tag, you can add a whitelist, so that Charles only intercept the request under this host:

如果弹框没有出现,将charles切换为小窗口
    • 1
    • 2
2. Analog Speed Limit Network

Most of the time, we need to test the application of the data when the network is poor, we can simulate setting the speed limit network, in the proxy menu in throttle settings, enable throttling tick, and can be set below the network settings, only Selected host can set a specified host access to restrict the network.

3, modify the network information, multiple requests

In testing the interface, sometimes we need to repeatedly make different parameters of the interface request, Charles also support our request parameter modification and multiple requests, right click on the request, now edit:

We can modify the parameters, request type and so on, then click Execute to re-request

批量请求选择repeat advanced....
    • 1
    • 2

iterations:10   //请求次数concurrency:2   //请求的并发数show results in new session //新建一个session窗口delays //请求延迟
    • 1
    • 2
    • 3
    • 4
VI. Charles Network Request redirection

Tools->map Remote

Grab Bag tool Charles (Mac usage record)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.