androidmemory-leaksmemory-dumpeclipse-memory-analyzer

Can't convert hprof dump


I try convert dump from Android Device Monitor to Eclipse Memory Analyzer format. I use next command

hprof-conv dump.hprof converted-dump.hprof

and i get error

hprof-conv: command not found

I do this in a /platform-tools folder. When I run the same command on another computer everything works fine.What is problem?


Solution

  • to run a binary from the current directory you need to prepend ./ to the name of the binary or use the full qualified path to the binary. E.g. if you are in platform-tools you can run

    ./hprof-conv /path/to/dump.hprof /path/to/converted-dump.hprof
    

    if you are in the directory where dump.hprof is stored you need

    /path/to/platform-tools/hprof-conv  dump.hprof converted-dump.hprof
    

    or you could add tools and platform-tools to $PATH. To do so, edit .bashrc. E.g.

    vim .bashrc
    export PATH=${PATH}:~/path/to/sdk/tools
    export PATH=${PATH}:~/path/to/sdk/platform-tools
    

    save it, and the run source /etc/profile, and you should be able to run every binary in tools and platform-tools without the path or the ./