Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why cmd give error when we open uiautomatorviewer?

When I run the following command in the command prompt that time I am getting the following error.

Command: C:\Users\ob>uiautomatorviewer

Error:

-Djava.ext.dirs=..\lib\x86_64;..\lib is not supported.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
like image 603
Jaimisha Patel Avatar asked May 18 '19 08:05

Jaimisha Patel


People also ask

How do I open Uiautomatorviewer in Windows?

Open UIAutomatorViewer entering uiautomatorviewer in the command prompt. opening uiautomatorviewer. bat file in the Android installation folder with the following command: Android >> Android-SDK >> Tools >> UIAutomatorViewer. bat.

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”.


2 Answers

Pre-Check - Verify the java Version installed in your system.
VERIFY - java -version

java version "1.8.0_221" Java(TM) SE Runtime Environment (build 1.8.0_221-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)

If this message appears that means you have JAVA 8 install and uiautomatorviewer only supports till JAVA 8.

So install JAVA 8 from here and if you already have JAVA install down grade it to JAVA 8

like image 50
Ajinkya Gangawane Avatar answered Oct 20 '22 04:10

Ajinkya Gangawane


Set your all android path properly.

Add variable in system environment as mention below.

ANDROID_SWT : C:\Users\chetan\AppData\Local\Android\Sdk\tools\lib\x86_64

ANDROID_HOME : C:\Users\chetan\AppData\Local\Android\Sdk

ANDROID_PLATFORM_TOOLS : C:\Users\chetan\AppData\Local\Android\Sdk\platform-tools

Add below mention Path in Path Variable in system environment.

C:\Program Files\Java\jdk\bin;

C:\Users\chetan\AppData\Local\Android\Sdk\tools\bin;

C:\Users\chetan\AppData\Local\Android\Sdk\tools;

C:\Users\chetan\AppData\Local\Android\Sdk\platform-tools;

C:\Program Files\nodejs\node_modules\npm\bin;

C:\Users\chetan\AppData\Local\Android\Sdk;

C:\Users\chetan\AppData\Local\Android\Sdk\tools\lib\x86_64\swt.jar;

like image 6
T.Che Avatar answered Oct 20 '22 03:10

T.Che