Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to start uiautomatorviewer

I have :

  • Android SDK Tools, Revision 22

  • Android SDK Platform, API 18

I go to <android-sdk>/tools/ , I see there is one file named "uiautomatorviewer",

I execute command uiautomatorviewer from terminal under the above path, however I got the following message:

uiautomatorviewer: command not found

why?

like image 633
Mellon Avatar asked Sep 06 '13 12:09

Mellon


People also ask

Why my Uiautomatorviewer is not working?

This happens because of incompatible versions of java. uiautomatorviewer requires java 8 and if you've java version above 8 (for example in my case it's java 12) so it will fail to start. There is a hack to run uiautomatorviewer without downgrading java version.

Is Uiautomatorviewer deprecated?

"uiautomatorviewer" is now replaced with "monitor" starting with android studio 2.3. I saw that uiautomatorviewer is no longer available with Android Studio 2.3. There is another tool called “monitor” which has the option “Dump View Hierarchy for UI Automator”.


4 Answers

Because your tools/ directory is not in your PATH. Either use ./uiautomatorviewer or add tools/ (and probably platform-tools/ to your PATH. Note that this has nothing to do with programming and everything to do with your *nix-style OS (Linux, OS X, etc.).

like image 37
CommonsWare Avatar answered Oct 20 '22 21:10

CommonsWare


Please note that uiautomatorviewer executable has been moved in SDK Tools Revision 25.3.0 update (Feb 2017) to new location under <android-sdk>\tools\bin

like image 76
Leszek Jasek Avatar answered Oct 20 '22 21:10

Leszek Jasek


Navigate to tools folder, then launch terminal, launch monitor(Android Device Monitor) using ./monitor command.

ADM will get launched, left side of the window you may find uiautomatorviewer.

like image 2
Kiran Sk Avatar answered Oct 20 '22 20:10

Kiran Sk


Just follow these steps,

Open command prompt,Go to your bin folder inside tools folder of sdk location.

Example: C:\android-sdk\android-sdk\tools\bin.

Then in cmd type uiautomatorviewer and hit enter. It would immedialy open UI Automator Viewer.

C:\android-sdk\android-sdk\tools\bin>uiautomatorviewer

Refer screenshot

enter image description here

like image 2
R15 Avatar answered Oct 20 '22 21:10

R15