在終端運行uiautomatorviewer之后出現下面的錯誤,檢查以后發現環境變量也配置好了
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
解決方案:把jdk的版本改為8
然后執行
subl .bash_profile
命令打開配置文件輸入以下配置
JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home"
PATH="$JAVA_HOME/bin:$PATH:."
CLASSPATH=".:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar"
export JAVA_HOME
export PATH
export CLASSPATH
最后編譯source ~/.bash_profile
即可。
