添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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
                This answer is outdated (although it was current when posted). Still, this same location is still used in google's official instructions here: developer.android.com/training/testing/ui-testing/… . @CommonsWare do you know what is the procedure to alter this documentation?
– Boris Strandjev
                Feb 28, 2019 at 11:50
                @BorisStrandjev: "do you know what is the procedure to alter this documentation?" -- file an issue, then pray that Google pays attention to it.
– CommonsWare
                Feb 28, 2019 at 12:05
                Now the question is how do I open an issue about their issue creation form not working (component dropdown does not load anything in Chrome for Linux) :) At least my prayers are spared
– Boris Strandjev
                Feb 28, 2019 at 12:19

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.

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

I Get the following error, and I don't understand what I am doing wrong (Bash on Ubuntu): -Djava.ext.dirs=<android-sdk>/tools/lib/x86_64:<android-sdk>/tools/lib is not supported. Use -classpath instead. Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. – MahNas92 Jan 8, 2021 at 9:33

First, follow this tutorial to add ANDROID_HOME and Path variables.

Setup Android Environment Variables

Then, add this variable as variables in the tutorial.

Variable name: JAVA_HOME
Variable value: C:\Program Files (x86)\Java\jdk1.8.0_171

Now you can run uiautomatorviewer in C:\Users\%USERNAME%\AppData\Local\Android\Sdk\tools\bin.

It's path issue only so don't worry just put this path "%ANDROID_HOME%\tools\bin" in your system path. Now you can run uiautomatorviewer

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center. – Community Nov 26, 2021 at 12:17

For anyone trying to find it still on a fresh Android SDK download: this has been removed from the standard tools in API level 27. To install it, uncheck "Hide Obsolete Packages" and select "Android SDK Tools (Obsolete)" v 26.1.1..

and after this point, see other answers here.

See the Deprecation notice for more info, there's no explicit mention of uiautomatorviewer removal, but after 9 major releases (if you don't see 9+ yet, see here) of Command Line tools there's no sign of it in the cmdline-tools/latest folder.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.