开发者

iPad - Monitor network traffic

开发者 https://www.devze.com 2023-01-26 11:29 出处:网络
I am debugging an iPad app that is running on an real iPad. Is there a way on my Mac to monitor the router\'s network traffic or just the iPad\'s network开发者_如何转开发 traffic?Much easier to isola

I am debugging an iPad app that is running on an real iPad.

Is there a way on my Mac to monitor the router's network traffic or just the iPad's network开发者_如何转开发 traffic?


Much easier to isolate network traffic with Charles

http://www.charlesproxy.com/


Definitely use Wireshark

http://www.wireshark.org/


OSX now supports packet capture on an attached device through their special rvi interface. To use it you firstly need to find UDID of the attached devices - either through Xcode or on the command line e.g.:

system_profiler SPUSBDataType | sed -n -E -e '/(iPhone|iPad)/,/Serial/s/ *Serial Number: *(.+)/\1/p'

Then use the resulting UDID in the following command to create a new associated rvi interface:

rvictl -s your_device_udid

Now one can capture packets from the i/Pad/Phone on rvi0 iface e.g.:

sudo tcpdump -i rvi0 -k A

Note: The -k argument is an Apple specific option, only supported in their version of tcpdump, which allows for display of additional metadata in this case it displays all metadata including interface name, process name & ID, etc. In this way one can see the traffic flowing over WiFi (en0) and Mobile (pdpX) interfaces, but not all interfaces such as ipsec0, etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消