3

When I try to convert HPROF file in android studio terminal to MAT format:

1) hprof-conv [-z] d:/dump.hprof d:/outfile.hprof

2) hprof-conv d:/dump.hprof d:/outfile.hprof

I have the same answer:

Usage: hprof-conf [-z] infile outfile

-z: exclude non-app heaps, such as Zygote

Specify '-' for either or both files to use stdin/stdout.

Copyright (C) 2009 The Android Open Source Project

This software is built from source code licensed under the Apache License, Version 2.0 (the "License"). You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

See the associated NOTICE file for this software for further details.

But hprof-conf command is not present in android platform tools.

What shall I do to convert file?

Delphian
  • 1,650
  • 3
  • 15
  • 31

2 Answers2

7

I had this problem, it has something to do with permissions I think.

It can be fixed by copying the input .hprof file into the "platform-tools/ " directory and specifying the output file to be somewhere with no permissions.

eg.

hprof-conv in.hprof C:/Users/whatever_name/Desktop/out.hprof

Richard Bamford
  • 1,835
  • 3
  • 15
  • 19
3

I was stuck on this for quite some time too. It seems you found hprof-conv.exe already and are running it as you should. What worked for me was putting the file into the location so in the 'platform-tools/' and then running it like this:

hprof-conv myinputdump.hprof myoutputdump.hprof

I was getting your response when I wrote it like this:

hprof-conv ~/in.hprof ~/out.hprof

and putting -z anywhere in the command didn't get my anywhere.

So, just use the hprof-conv and then the file name then the output file name. I know putting the path characters like '~/' and your 'D:/' shouldn't matter, but excluding them worked for me and it might work for you.

Stephen
  • 1,072
  • 1
  • 19
  • 33
  • I wrote like hprof-conv ~/in.hprof ~/out.hprof and then try hprof-conv in.hprof out.hprof. Don't work. Write the same answer about the license. May be I should download the license but where and how? – Delphian Aug 19 '16 at 09:22