2

I am trying to run Hierarchy Viewer. developer.android.com says to

"Connect your device or launch an emulator.

From a terminal, launch hierarchyviewer from your SDK /tools directory."

I tried finding the hierarchy viewer in sdk/tools, but couldn't find it. I realize my difficulty may just be the result of me being a total noob so I could just be missing something basic.

How do I run hierarchyviewer?

Thanks!

LuxuryMode
  • 33,401
  • 34
  • 117
  • 188

5 Answers5

2

(Sorry, I was meant to add this as a comment to Mayra's answer below)

I was using SDK_r06 and HierarchyViewer.exe was in the /tools folder.

I upgraded to SDK_r07 (using Android SDK and AVD Manager) and now HierarchyViewer.exe is not in the /tools folder.

I re-downloaded the SDK from the Android website and it is not in the /tools folder.

Has it been left out of the SDK_r07 release of the SDK?

Aussie
  • 21
  • 2
2

in your tools directory create a file named hv.bat and add this code to that

java -Xmx512m  -jar ./lib/hierarchyviewer.jar

its a problem with windows file directory, but we know that hierarchyviewer.jar is in lib!!!!

or here is the original batch http://groups.google.com/group/android-developers/browse_thread/thread/30124afa7a708c96/c51b4fc2e979a721

Ads
  • 6,681
  • 12
  • 47
  • 72
1

I assume you are on windows.. to open a terminal window run start -> run and type "cmd". You should see a black window with a cursor.

You need to open the tools directory by typing cd C:\full\path\to\tools\directory filling in the path to where you installed the sdk.

If you type dir you should see a list of files located within the folder, one of which is hierarchyviewer.exe. Run that file (just type hierarchyviewer.exe)

Cheryl Simon
  • 46,552
  • 15
  • 93
  • 82
  • Thanks so much for the detailed response. The only place where I see hierarchyviewer is in the lib subfolder. Theres a Jar file there... – LuxuryMode Oct 19 '10 at 01:19
  • What version of the sdk did you download? It should definitly be in the tools folder, I don't have easy access to a windows box to see where it is in there though. Do you see other tools, like adb? – Cheryl Simon Oct 19 '10 at 01:34
  • I downloaded SDK_r07. I see other tools in there: adb, dmtracedump, emulator, etc1tool, fastboot, etc. – LuxuryMode Oct 19 '10 at 01:40
  • Wierd, that should have it. You might try just redownload the sdk. It might have gotten deleted somehow? – Cheryl Simon Oct 19 '10 at 02:18
  • Thanks. If I do that, should I just delete the entire directory that I installed SDK to or should I run an uninstall? – LuxuryMode Oct 19 '10 at 02:31
1

Just had the same issue. It looks like version 7 of SDK Tools does not include the executable for unknown reason (you may download the SDK and see that it's not there). Therefore, an update removes the executable even if it was there before. However, the executable is not an *.exe, but just a *.bat, which uses the HierarchyViewer.jar in the lib folder.

So I just copied the hierarchyviewer.bat file from the 6th version into the tools folder and it worked.
Note, that you have to type hierarchyviewer or hierarchyviewer.bat to start it, not hierarchyviewer.exe.

Coryffaeus
  • 390
  • 5
  • 8
  • Should I download Release 1.6 r1 from September 2009 ? If not, where can I get 6th version? – LuxuryMode Oct 20 '10 at 01:23
  • Looks like hierarchyviewr.bat has since been deprecated, and it is suggested that we use monitor.bat instead (which is located in the tools folder). Hope this helps someone! – LargeGlasses May 30 '14 at 18:42
0

launch your cmd if you on windows then type

cd\C:\android-sdk-windows\tools then enter now you are in tools folder then type hierarchyviewer
then enter , now you should see hierarchyviewer

and here's alink of how to open it and use it http://developer.android.com/guide/developing/debugging/debugging-ui.html and also good article http://mobile.tutsplus.com/tutorials/android/android-tools-using-the-hierarchy-viewer/

Weloo
  • 625
  • 4
  • 16