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