Friday, November 16, 2012

Monitor Network Traffic on iOS Simulator

1) Install WireShark: http://www.wireshark.org/download.html

2) Add Wireshark bin directory to your path.  If you are using tcsh, edit your ~/.cshrc file and add in the following:

set path=(/Applications/Wireshark.app/Contents/Resources/bin $path)

3) In Terminal, run the following:

tshark 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'

4) Run the iOS Simulator, and browse to something.  You'll see the HTTP connections made in Terminal.

No comments: