My UIautomator is not starting in mac. I have done everything possible

245 Views Asked by At

I am learning appium and I have set up everything that is required. I have setup paths, installed android studio, run appium and created a virtual android device too. But when i am writing uiautomatorviewer its giving me an error

mac@Macs-MacBook-Pro ~ % uiautomatorviewer                                    
-Djava.ext.dirs=/Users/mac/Library/Android/sdk/tools/lib/x86_64:/Users/mac/Library/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.
mac@Macs-MacBook-Pro ~ % 

Can anyone help me please

2

There are 2 best solutions below

0
rakeshsahu59 On

A. I encountered this issue once, sometime env var doesn't load and it throws error, open and load bash profile and run that command.

  1. open ~/.bash_profile
  2. source ~/.bash_profile
  3. uiautomatorviewer

B. if appium server is running, try to close it and run the command.

0
user18958634 On

Try the following command:

sudo ./uiautomatorviewer