Previously when I’ve needed to monitor web traffic from my iPhone I would use my laptop to redistribute my wifi as a 2nd network with another network card and use a tool like WireShark or Charles to monitor everything that’s being sent and received from my iPhone after I connected to the 2nd network. This was overcomplicating things, hidden in the iPhone’s settings is the ability to connect to a proxy server, meaning you can debug web traffic without the need for any 2nd networks or ethernet cables.
Get Charles, a free web debugger (there is a paid version as well without the waiting times).
Connect both your computer and iPhone to the same wireless network. Open System Preferences and under the network section select the wifi option on the left. Below your status you will see a message following the lines of “Wi-Fi is connected to YourWifiNetwork and has the IP address 192.168.1.71.”. The last part is your IP address on your network, it will be different for each person reading this, take note of it, we will connect to it later. This step is obviously different on a Windows computer.
Open Charles, click the Proxy menu and open the Proxy settings. The port field should already be populated with port 8888. If there’s nothing there, enter 8888. If there’s something else, note it down.
Now in your iPhone, open the Settings app and in the Wifi section locate your network on the list. Click the blue arrow on the right side of the network. Scroll to the bottom and in the HTTP proxy settings select manual. Enter the details you gathered from above. My Server is 192.168.1.71 and my Port is 8888.
The first time you make a request from your iPhone charles will prompt you, click Allow.
That’s pretty much it, you can now monitor all HTTP traffic going to and from the iPhone. Of course this will not work yet for monitoring SSL connections, which is something I will cover next week.