Debug iOS traffic on iPhone device

November 09, 2017

I’m doing production support for an iOS mobile app. The pain point is hard to debug HTTPS traffic between the iPhone and our server. In this article, I will explain how to capture the requests, response and the HTTP headers.

1  CrX8DErYnxVEqwNfeJkUcw

Step 1:

Download and install Charles: https://www.charlesproxy.com/download/ on your laptop. Click install “Charles Root Certificate on a Mobile Device or Remote Browser”.

1  LDUZecED  AlpsTkWtIv51g 1  95DmuWBnnXfr39v6Fw1uaQ

Then you would see a popup with details above.

Step 2:

Use your iPhone connect to the same wifi network. In the iPhone wifi setting, you can choose HTTP proxy, click on Configure Proxy with Manual details:

1  T  DdamOXoOgVW55GgstXPQ

Fill in the Server and Port number from the same info of the popup. You would then see the popup updated for the connection:

1  9e3x9msHjJYf6ORFrmh0gA

Next, open the Safari in your iPhone and browse to chls.pro/ssl to download and install the certificate by clicking allow:

1  l9521Mwh  k0sidjsYfe74A

Click “Install” of the Profile:

1  3fuA630KVHOMNrCPlqj1nQ

And you are done:

1  kwTQwsU  VzukMztZFcaeaw

Step 3:

In your iPhone device, go to Setting > General > About > Certificate Trust Settings and toggle the Charles Proxy CA to on.

1  6SXPkv0EJha42RqvbGk9Jg

Finally, step:

Restart Charles, you can then see the traffic with https content! For example, the medium app on iOS traffic is captured as shown below:

1  j0eQzaJRjPKbCLGw9DAXHA

Let me know if you encounter any problem. Happy Debugging :)


Written by Victor Leung who is a keen traveller to see every country in the world, passionate about cutting edge technologies. Follow me on Twitter