rvictl 是 Xcode Command Line Tools 中的实用工具,通过它可以将指定 UDID 的设备的网络接口暴露给 mac。
rvictl [-h][-l][-s <udid1> ... <udidN>][-x <udid1> ... <udidN>]
Remote Virtual Interface Tool starts and stops a remote packet capture instance
for any set of attached mobile devices. It can also provide feedback on any attached
devices that are currently relaying packets back to this host.
Options:
-l, -L List currently active devices
-s, -S Start a device or set of devices
-x, -X Stop a device or set of devices
这个工具需要知道目标设备的 UDID,获取方式也很简单,Xcode 或者 iTunes 均可。
这里只演示使用 iTunes 的方法:
看到图示区域这里的如果不是 UDID,点击即可转换:
然后打开终端,输入 rvictl -s <UUID>
开启该网络接口:
注意到这里网络接口 rvi0
,我们可以通过它获取设备的网络数据包,比如使用 Wireshark。
输入 rvictl -x <UUID>
关闭该网络接口。