最佳实践:
使用mac电脑连接iPhone,mac上使用rvictl命令进行空口抓包。
准备环境:
iPhone (iOS5以上版本)
mac电脑(安装Xcode工具、Wireshark抓包软件)
操作步骤:
- mac安装Xcode工具。
Xcode官方中文页面
https://developer.apple.com/cn/support/xcode/
下载页面(英文)
https://developer.apple.com/download/
- mac安装Wireshark抓包软件。
下载页面:https://www.wireshark.org/download/osx/
- iPhone通过USB线缆接入到mac。
- 查看iPhone的UDID。
方法一:在iTune里面查看
Tips: 在“UDID”位置尝试点击,默认情况下该位置是“Serial Number”
方法二:在Xcode工具中查看
菜单Window->Devices and Simulators,Identifier位置
- 生成rvi接口。
在mac上调出CLI,输入命令:“rvictl -s <UUID>”
检查rvi0虚拟端口被激活,输入命令:“rvictl -l”
- 使用rvi接口抓包。
打开Wireshark软件,选择rvi0接口进行抓包,无论iPhone使用Wi-Fi还是3G/4G,都可以抓到数据。建议Wi-Fi抓包时直接把蜂窝关闭。
- 关闭rvi接口。
保持良好的习惯,rvi接口使用完毕以后,将它进行关闭,输入命令“rvictl -x <UUID>”