1. monkey命令:adb shell monkey -p 包名 --ignore-crashes --ignore-timeouts --kill-process-after-error --ignore-security-exceptions --hprof --pct-touch 0 --pct-trackball 0 --throttle 500 100000 -v > monkey.log
2. monkey运行结束后,使用dump命令将hprof文件dump出来:如:adb shell am dumpheap com.example.test /data/monkeytest/new.hprof
adb shell am dumpheap 进程名 保存路径
3. adb pull /data/monkeytest/new.hprof D:/
4. 用android studio profile load file打开后分析即可