I myself have the same issue. 
I'm looking for  a way to automatically generate the hprof data without 
having to click DDMS buttons.
I'm particularly interested in running an app , say, using monkey, send 
some random events and take the dump.

it seems kill -10 <pid> doesn't work for icecream sandwich simulator.

Can anybody suggest a reliable command-line based tool, or some python/java 
api that lets me do that?

thanks !

On Wednesday, June 16, 2010 12:32:20 AM UTC-5, Natraj wrote:
>
> In my application , i have an option to capture the hprof dump. I 
> used 
>
> android.os.Debug.dumpHprofData (String fileName) 
>
> Initially i though the hprof data generated by the method above is for 
> the entire device , which is not so . The hprof data generated is only 
> for my process. 
>
> Now i am trying to generate hprof data for other process as well. I 
> need to get the Hprof dump for all the running processes from 
> application code. 
>
> from adb shell i tried "kill -10 <pid>" , This command will generate 
> the hprof file for the corresponding  process in the data/misc folder. 
>
> Now the problem is this command is working perfectly from the adb 
> shell prompt , but i am not able to embed the command to mycode. 
>
> My code is like 
>
> Runtime.getRuntime().exec("chmod 777 /data/misc") 
> Runtime.getRunTime().exec("kill -10 <pid>") 
>
> No exceptions are thrown , but somehow  it is not working. The same 
> code above is capturing Hprof dump for my process, when i give my 
> process ID. 
>
> I tried with "android.os.Process.sendSignal (int pid, 
> android.os.Process.SIGNAL_USR1) ;" also.Getting the same problem.It is 
> capturing Hprof dump for my process. For other processes it is not 
> working. 
>
> Do we need to have any special permission to kill other process from 
> our process ? Or is it a built issue ? can you please suggest some 
> possible way to get Hprof dump for other processes from application 
> code?. 
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to