无法将转储 HPROF 文件从 Android Studio 转换为 MAT 格式

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

当我尝试将 android studio 终端中的 HPROF 文件转换为 MAT 格式时:

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

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

我也有同样的答案:

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.

但是 android 平台工具中没有 hprof-conf 命令。

我应该如何转换文件?

我也被困在这个问题上有一段时间了。您似乎已经找到了 hprof-conv.exe 并且 运行 是您应该找到的。对我有用的是将文件放入 'platform-tools/' 然后 运行 的位置,就像这样:

hprof-conv myinputdump.hprof myoutputdump.hprof

我这样写的时候收到了你的回复:

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

并在命令中的任何地方放置 -z 都没有得到我的任何地方。

所以,只需使用 hprof-conv,然后是文件名,然后是输出文件名。我知道放置像“~/”这样的路径字符和你的 'D:/' 应该无关紧要,但排除它们对我有用,它可能对你有用。

我有这个问题,我认为它与权限有关。

可以通过将输入 .hprof 文件复制到 "platform-tools/ " 目录并将输出文件指定到没有权限的地方来修复。

例如

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