使用流程
下載Wireshark最新版,官網(wǎng)下載地址:
https://www.wireshark.org/download.html
- 將手機通過usb口連在mac電腦上
- Mac連接iPhone,終端執(zhí)行
rvictl -s iphone設(shè)備id
如果要斷開鏈接
rvictl -x iphone設(shè)備id
查看UDID的方式有兩種:
1、手機瀏覽器打開蒲公英工具網(wǎng)址 https://www.pgyer.com/tools/udid
2、手機連接到電腦上,打開XCode ,打開 Window -> Devices and simulators

image.png
出現(xiàn)問題
1、The capture session could not be initiated on capture device "rvi0" (You don't have permission to capture on that device)
解決方法:
打開終端輸入命令sudo chmod 777 /dev/bpf*
在輸入密碼重新打開即可
2、Warning: That device doesn't support promiscuous mode.
終端輸入:
sudo tcpdump -i rvi0 -w trace.pcap

獲取數(shù)據(jù)成功
參考資料:
Mac下使用Wireshark抓iphone手機數(shù)據(jù)包
http://www.itdecent.cn/p/4b172e6d8569
http://www.itdecent.cn/p/67be96d313df