2

enter image description hereI am using moto-g4 plus, my device is detected in ddms but its not showing app in hierarchy viewer.

I have also followed steps from

https://developer.android.com/studio/profile/hierarchy-viewer-setup.html#hvproto-variable

Android version on device - 6.0

Console log:

 [2016-12-06 16:05:31 - hierarchyviewer]Unable to get view server protocol version from device ZY223FMT2T
[2016-12-06 16:05:32 - ViewServerDevice]Unable to debug device: motorola-moto_g__4_-ZY223FMT2T
[2016-12-06 16:05:33 - hierarchyviewer]Missing forwarded port for ZY223FMT2T
[2016-12-06 16:05:33 - hierarchyviewer]Unable to get the focused window from device ZY223FMT2T
MobDev
  • 464
  • 4
  • 14

2 Answers2

0

To use the hierarchy viewer on a real device you need to use the ddm rather the ddms protocol.

Add export ANDROID_HVPROTO=ddm to your .bash_profile then source ./.bash_profile.

Then restart your Android Studio and remove the installed app.

Try it again, it should works now. Refer this post for more.

LF00
  • 27,015
  • 29
  • 156
  • 295
-1

Its working fine for me for Window as well as MAC. The only hack is this after making the changes as per the link, you have to restart the system and start again for Hierarchy view

Sachin Tyagi
  • 1,257
  • 15
  • 21