Hierarchy Viewer wants a forwarded port, how?

I am trying to run a hierarchy viewer to examine one screen of my application on an Android device (Samsung Galaxy S4, developer version).

HV starts up but displays a blank screen in a tree view with these error messages

[2014-06-10 16:52:22 - ViewServerDevice]Unable to debug device: samsung-gt_i9505g-86d22a7c [2014-06-10 16:52:23 - hierarchyviewer]Missing forwarded port for 86d22a7c [2014-06-10 16:52:23 - hierarchyviewer]Unable to get the focused window from device 86d22a7c 

What are the steps to provide the HV forwarded port that it wants? This is on MacOS 10.7.5

screendump of hv

+6
source share
1 answer

To resolve this issue, follow these steps:

  • First check if the application is running in debug mode. If so, exit debug mode and launch the application from the launch icon on the device. In addition, it is preferable to start the monitor of the Android device from the terminal, i.e. go to /Users/<user>/Library/Android/sdk/tools then enter ANDROID_HVPROTO=ddm monitor .

  • If it still does not work, try running the android command on the terminal, if it says that the command was not found or something like that, try this (or check d. Danailov ):

    vim ~/.bash_profile

Then enter these 3 lines in Vim insert mode.

 export ANDROID_HOME=/Users/<Username>/Library/Android/sdk (path to your sdk) export PATH=$ANDROID_HOME/tools:$PATH export PATH=$ANDROID_HOME/platform-tools:$PATH 
  1. Then restart the terminal and enter android on the terminal.

  2. Now start the Android device monitor from the ie terminal by going to /Users/<Username>/Library/Android/sdk/tools then enter ANDROID_HVPROTO=ddm monitor .

Hope this helps.

0
source

Source: https://habr.com/ru/post/970660/


All Articles