导航
导航
文章目录
  1. Context
  2. Installation

Charles Proxy macOS setup guide

Context

Charles is an HTTP proxy / HTTP monitor / Reverse Proxy that enables a developer to view all of the HTTP and SSL / HTTPS traffic between their machine and the Internet. This includes requests, responses and the HTTP headers (which contain the cookies and caching information). Ever since I started using Charles my testing life has become much easier.

In this guide I will help you set up the Charles in macOS to view the iOS application’s traffic.

You can download a free trail from the Charles website. Make sure to download the macOS dmg file.

Installation

Double click on the dmg file. (In my case the version was charles-proxy-4.5.1.dmg)

Installation

Click on the Agree button

Installation

Move the Charles app to the Application Folder

Installation

Open Charles from the Application folder

On your browser open ‘google.com’, probably you are going to see some error like this one below.

Installation

Check the network calls under the www.google.com

Installation

This is because we have not configured the Charles Root Certificates in your machine.

Installation

Follow the images.

Installation

After installing the Charles Root Certificate, Open your Keychain Access. Search for Charles, now you may see something like this i.e. Certificate icon with (X) mark. It indicates that we have not trusted the certificate yet. We need to trust the certificate first.

Installation

Double click to open the Certificate. User Trust settings choose Always Trust.

Installation

Now you should see the certificate icon turns blue with a (+) mark on it. If that’s the case you have trusted the Certificate.

Installation

Now go to SSL Proxying Settings

Installation

You need to add wild cards, so that you can get network calls from all the connected hosts. Add the following . and choose OK.

Installation

Now we need to install the Root Certificate on the Test Mobile Device. We need to make sure the Device under test and your Mac should be on the same network. Follow the screen.

Installation

You should see the IP address along with the port address. Please note this one.

Installation

Now go to the Wi-Fi settings, Tap on the info icon. and configure the proxy as follows. Please note this IP address and Port number will be used for configuring the Proxy.

Installation

Tap on the info icon

Installation

Tap on the Configure Proxy

Installation

Select the Manual Option

Now enter the IP and Port number shown in the Charles.

Installation

Now go to the Safari and enter the following url

chls.pro/ssl

Installation

You should see a connection request at Charles now, Click on Allow.

Installation

Installation

At the moment if you see the Safari browser, you should see something similar. Tap on Allow. Once the configuration profile is downloaded, you will get an indication. After that go to Settings > General > Profiles. User the Downloaded profile you should see the one we are looking for. Open the Profile.

Installation

Tap on the install.

Installation

You may need to enter the Phones unlock code to install the profile. Once the Profile is installed successfully, you should see the verified tick ✅ mark.

Installation

Go to the following location and enable the full trust for the root certificate. Follow the screenshot reference below.

Settings > General > About > Certificate Settings >

Installation

That’s all you need to do. You may open your test application and see the network calls at Charles. For the demo purpose, I have used the Flipkart application and searched for an ‘iphone’

Installation

You can see the network call and its contents.

Installation