Use of the iOS development grab tool for Charles

Source: Internet
Author: User
Tags ssl certificate

Use of the iOS development grab tool for Charles 

In the course of iOS development, grabbing is one of the most common skills required. Here we mainly introduce the grasp of the weapon under Mac Charles (version: 4.0.1). It can be very convenient to crawl HTTP/HTTPS requests, thereby improving our development efficiency. This article does not provide a cracked version of the installation instructions (a lot of online), the recommended use of genuine, official DMG: click here.

First, how to crawl HTTP requests?

(1) After the installation is complete, open Charles, set the port number: 8888 (the port number can be customized).

Select the "Proxy Settings" submenu under the "Proxy" menu. Open the Proxy Settings dialog box:

Set the port number in the Proxy Settings dialog box: 8888, and tick the "Enable transparent Http proxying" entry:

(2) Open "Network preferences" to view the computer IP address:

(3) Set up mobile network (IOS):

(4) Open the mobile app that needs to grab the bag, when the first use, Charles will pop up the confirmation dialog, directly click "Allow" button to see the corresponding request data.

Warm tip: After the bag is finished, please turn off the HTTP proxy in your mobile wifi. This may cause iOS to not be able to access the network.

Second, how to crawl HTTPS requests?

(1) Computer installation SSL Certificate

Select Charles, select "SSL proxying" and "Install Charles Root Certificate" in the "Help" menu to automatically open the Keychain Access window:

In the Keychain Access window, locate the corresponding certificate, and double-click Open. When you set the "Use Certificate" entry to: Always trust.

Fill in the Administrator password update settings.

(2) Mobile phone installation certificate (using Safari mode):

Make sure the phone is set up manually (refer to the HTTP capture settings above).

Enter the following link address in the Mobile Safari browser: Http://charlesproxy.com/getssl. The phone will automatically jump to install the "Charles Proxy SSL proxying" profile. As shown in the following:

Click the "Install" button, you will be prompted to enter your phone password, and then confirm the installation.

The above will complete the mobile phone SSL certificate installation steps.

(3) On the Charles toolbar, click the Settings button and select "SSL proxying Settings ...":

Open the SSL proxying Settings dialog box:

Click "Add": Enter * in host to match all hosts. HTTPS default port number: 443.

Add complete to display the results as follows:

(4) Test:

Before installing the mobile certificate, the test results are as follows:

After installing the mobile certificate, the test results are as follows:

For Charles Proxy access to https some of the normal processing methods of some failures (general HTTPS as long as the "Enable SSL proxying" agent to open Charles can access): click here

Third, if there is no WiFi, we can also grasp the bag? (This article does not do a detailed explanation)

(1) The rvictl way of grasping the bag:

Open Virtual port: rvictl-s

Close Virtual port: Rvictl-x

Then use Wireshark to capture this port data.

(2) The tcpdump way of grasping the bag:

There is a big drawback is that mobile phones need to jailbreak.

Part of this article is from the network, the follow-up will be continuously updated and perfected. Welcome to learn to communicate together!

If you want to reprint, please specify the source

Four, reference blog address:

Grab kit on Mac Charles

Use of the iOS development grab tool for Charles

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.