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.

895f7 1crx8derynxveqwnfejkucw

Step 1:

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

2be8a 1lduzeced alpstkwtiv51g

3f612 195dmuwbnnxfr39v6fw1uaq

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:

4c601 1t 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:

db62f 19e3x9mshjjyf6orfrmh0ga

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

385e8 1l9521mwh k0sidjsyfe74a

Click “Install” of the Profile:

46132 13fua630kvhomnrcplqj1nq

And you are done:

04e2b 1kwtqwsu vzukmztzfcaeaw

Step 3:

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

da0be 16sxpkv0ejha42rqvbgk9jg

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:

6e7b0 1j0eqzajrjpkbclgw9daxha

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


Profile picture

Experience in software development, application architecture, and deploying cloud solutions for enterprise customers. Strong hands-on skills with a Master's degree in Computer Science and business acumen with a master of business administration (MBA) in Finance. Certified in Amazon Web Services (AWS), Google Cloud Platform (GCP), Microsoft Azure, Kubernetes (CKA, CKAD, CKS, KCNA) and Scrum (PSM, PSPO) with experience in building banking products from scratch. Connect on Linkedin

© 2022, @victorleungtw