How to generate an HPROF memory dump for applications that were built with Proguard / installed from Google Play

StackOverflow https://stackoverflow.com/questions/19147409

Question

If I launch my application directly from Eclipse, I can generate an HPROF file easily from the Eclipse DDMS perspective:

HPROF generation in Eclipse

However, if I create a release build (which uses Proguard) my process is not listed in DDMS, so I can't select it.

Can anybody give a list of the steps to run to generate an HPROF from an arbitrary app/process? If it is impossible, can you explain the options to enable it (since I control the generation of my release builds)?

A list of adb commands, or shell commands to run on a rooted phone would be great (e.g. if custom commands for launching the app are required).

Was it helpful?

Solution

Proguard is not the reason the release version of the app is not listed in DDMS. There is a debuggable flag in AndroidManifest.xml that you can add to make even the release version of your app to be listed in DDMS.

Additionally, if you run your app on a device where the framework is built with the development configuration is enabled (the userdebug or eng for BUILDTYPE), it will also be listed in the DDMS even if it was the release version. All the official emulator image are built this way.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top