首先,在命令行中调出editcap等命令是需要在安装wireshark时额外安装的,如果当时只安装了wireshark,那么请重新下载安装包:https://www.wireshark.org/download.html,然后点击“Add wireshark to the system path.pkg”安装包长这样:
如果之前安装过,因为未知原因导致环境变量缺失的,可以:
cd /Applications/Wireshark.app/Contents/MacOS/
这个目录下有 editcap 等工具