Tcpdump & Wireshark with Android

Some necessary commands and files to use tcpdump and wireshark with any Android device with root. The necessary files can be download from here:

mount -o remount,rw /system
cp /sdcard/data/tcpdump system/bin
chmod 777 tcpdump
mount -o remount,ro /system

adb shell "su -c tcpdump -n -s 0 -w /sdcard/pcap.pcap"
tail -f /sdcard/pcap.pcap |netcat -l -p 2222
adb forward tcp:2222 tcp:2222 && netcat localhost 2222 |wireshark -k -S -i -
adb shell "rm -f /sdcard/pcap.pcap && su -c tcpdump -s 0 -i wlan0 -w /sdcard/pcap.pcap & sleep 2 && echo start && tail -f /sdcard/pcap.pcap |netcat -l -p 2222
adb pull /sdcard/pcap.pcap . && wireshark -Y http pcap.pcap