How do you watch HTTP requests an iPhone app is making?

Just the same way you can open the web inspector or activity window in Safari on your laptop and see all the HTTP requests any website has made, how do you do that on the iphone for an iPhone app, if the iPhone app is using HTML5 (or even if it's a native app)?


Solution 1:

indeed if you download charles and follow the instruction on this page (under iphone). You can monitor the http requests that your iPhone

http://www.charlesproxy.com/documentation/faqs/

Solution 2:

The easiest method is to install a debugging proxy and point your iPhone to it (specify the proxy address in the settings for the wifi network). Obviously, this'll only work over wifi and not via a cellular data connection. You'll then have access to all of the http(s) requests and responses sent and received by your iPhone.

As several commenters have mentioned (thanks!), a popular option is Charles, which supports Windows, macOS and Linux. There's also Paros, which is written in Java so will run on most platforms, but it was last updated in 2006.

Solution 3:

To watch the http(s) traffic, you will need to intercept the network traffic travelling between your iPhone and your Internet Service Provider (ISP).

To do this you need to set your phone to use WiFi and to pass network traffic through a proxy. Proxies include squid and Charles.

A good proxy will offer log files and allow you to see server addresses and, if not encrypted, requested URLs.