I've added tcpdump binary file to my android device using this command
./adb push ~/tcpdump-4.2.1/tcpdump /data/local
The binary is added to the android device successfully. But, when I try to execute the tcpdump file from the adb shell, using following commands
./adb shell
cd data/local
./tcpdump
It gives me this error
/system/bin/sh: ./tcpdump: not executable: magic 7F45
I've also tried changing permissions using chmod 777 tcpdump
but in vain.
How do I overcome this issue? Thanks.
Make sure USB debugging is enabled and USB is physically plugged in. Make sure everything is ok with the ADB drivers, double-check the device manager. Check if the device appears in "adb devices", make sure its authorized on the device. Try actual adb shell and other relevant adb stuff.
To use ADB with your Android device, you must enable a feature called “USB Debugging.” Open your phone's app drawer, tap the Settings icon, and select “About Phone”. Scroll all the way down and tap the “Build Number” item seven times. You should get a message saying you are now a developer.
You can find an Android version of tcpdump here. This build is somewhat outdated, and only relevant for ARM devices. You should follow these instructions to build the binary from official source.
There are detailed instructions re how to run tcpdump on Android. Note that you need a rooted device to begin with.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With