Debugging an iPhone’s network traffic.

One of the most frustrating things when writing an iPhone app (now that we have Swift to banish the hell that is Objective-C!) is the lack of debugging tools, in particular not having Wireshark available.

Fret no more however. It turns out that you can  mirror all your iPhone network traffic to your Mac by exposing a virtual network interface.

Simply launch Terminal, and enter:


$> rvictl -s <UDID of Phone>

e.g.


$> rvictl -s 4738101a4a910ffa9e368ef683fb2135dec12716

Starting device 4738101a4a910ffa9e368ef683fb2135dec12716 [SUCCEEDED] with interface rvi0

(your UDID can be determined via iTunes)

This will create a new network interface called rvi0 (or whatever the success message tells you) that you can listen on with Wireshark.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s