Run Hierarchy Viewer the easy way, with ANROID_HVPROTO

Historically, Hierarchy viewer requires you to a) be on a rooted device, or b) install Romain Guy's "ViewServer" library off github to work (
Turns out, if you're profiling on JB or newer, then you don't need to do that any more.

Simply set the environment variable ANDROID_HVPROTO=ddm before running hierarchyviewer.bat , and everything will work like magic. This will let you use hv on debuggable apps, without requiring a rooted device

This environment variable causes HV to connect to the device, using that protocol , which is the same as the ddms protocol. The caveat is that there can be only one process on the host that connects, so you'll have to kill any other ddms session to run hv.

One thing to notice is the faster launch time, because it doesn't run 'profile' on the tree by default.

Major caveat, which might kill this for your purposes: It's only going to work back to the version of Android when this was first integrated, which is probably late JB mrs or KitKat. 

So if you're using a build earlier than that, then you need to revert to the old ways of a rooted phone, or using ViewServer (or just banging the device on a rock until all the "evil performance" leaves it's mortal coil....)
Shared publiclyView activity