Unable to open UIAutomatorviewer on Mac High Sierra

核能气质少年 提交于 2019-11-28 02:04:04

问题


We have brand new MacBooks with High Sierra (10.13.6). Other system info:

JAVA Version: java version "11.0.1" 2018-10-16 LTS

Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)

JAVA_HOME: /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home

When tried to open Android UIAutomatorViwer we're getting following error:

/Library/Android/sdk/tools/bin/uiautomatorviewer ; exit;

/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. logout Saving session... ...copying shared history... ...saving history...truncating history files... ...completed. Deleting expired sessions...111 completed.

More details: Java is at: /usr/bin/java


回答1:


  • Installed older java(8) JDK
  • Updated Java version to 1.8 in JAVA_HOME

Commands used to update Java Version:

cd ~/
vim ~/.bash_profile
Updated the JAVA_HOME
Save in vim using :wq!
source ~/.bash_profile

  • Restart & UiAutomatorViewer is working!



回答2:


Work perfectly!

step 1: cd ~/ step 2: vim ~/.bash_profile

-Add text "export ANDROID_HOME ..." to end text.



来源:https://stackoverflow.com/questions/53778698/unable-to-open-uiautomatorviewer-on-mac-high-sierra

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!