3

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).

Dan J
  • 25,433
  • 17
  • 100
  • 173
  • As fare as I know you cannot do that. Reason for this is simple because you have obfuscated and in a way encrypted your release build. If this was possible then a hacker could get information from your apk. I´ll be exited to si if you get an answer going your way – Erik Oct 02 '13 at 22:01
  • I think obfuscation just changes the class and method names. I would expect an HPROF to work, but you'd see your obfuscated class names. Most big system objects would still show up too, like android.graphics.bitmap. FYI, you can use dex2jar and then browse your obfuscated classes too, so a hacker can always at least get that information from your APK. – Dan J Oct 02 '13 at 22:29

1 Answers1

6

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.

Joe
  • 14,039
  • 2
  • 39
  • 49
  • Thanks for the info! Haven't had a chance to test it yet, but awarding the bounty now on the assumption that it will work. – Dan J Oct 11 '13 at 22:44