2
I have a Java app that runs on Android. This app starts a Tcpdump Process process = Runtime.getRuntime().exec("su -c tcpdump -s 0 -v -w /sdcard/capture.pcap
. This works and generates the file, capturing the passing packets on the device’s 3G network.
It turns out that, abruptly, the tcpdump process is eliminated (I was monitoring the list of active processes) after a while.
Would anyone have any idea why this happens? And any possible solution?
The code is cut, or one is missing
")
, I don’t know, put it like this, I don’t know if there are more things to reproduce the problem– Guilherme Nascimento
It kills only the tcpdump process? or your app too?
– Emerson Dallagnol
Oops, excuse me. The lack of the ") was just a problem when copying and pasting here. It’s like this: process = Runtime.getRuntime(). exec("su -c tcpdump -s 0 -v -w /sdcard/experiments/capture_"+name+". pcap");, where name is a string received as argument. Tcpdump incises perfectly, but later it is deleted crippled to my app (it should be the OS itself that eliminates it). Only Tcpdump is killed, my app keeps working perfectly.
– Jonas Pontes