Search code examples
androidhprof

Can't convert dump HPROF file from Android Studio to MAT format


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?


Solution

  • 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