美文网首页
Mac 运行uiautomatorviewer报错解决,因为jd

Mac 运行uiautomatorviewer报错解决,因为jd

作者: 苏村的南哥 | 来源:发表于2023-03-29 10:39 被阅读0次

[转载]

Last login: Thu Mar 30 10:35:19 on ttys000
/Users/knight/MyResources/FileInstall/Installfile/android-sdk-macosx/tools/uiautomatorviewer ; exit;
~ /Users/knight/MyResources/FileInstall/Installfile/android-sdk-macosx/tools/uiautomatorviewer ; exit;
-Djava.ext.dirs=/Users/knight/MyResources/FileInstall/Installfile/android-sdk-macosx/tools/lib/x86_64:/Users/knight/MyResources/FileInstall/Installfile/android-sdk-macosx/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.

Saving session...completed.

[进程已完成]

解决方案

jdk版本不匹配,回退版本至8,详细如下

1.下载jdk1.8版本,并安装

下载地址:https://www.oracle.com/java/technologies/javase-jdk8-downloads.html

2.进入sdk/tools目录,vi runuiautomatorviewer.sh

#runuiautomatorviewer.sh
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home
export JAVA_BIN=/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home/bin
export PATH=$JAVA_BIN:$JAVA_HOME:$PATH
./uiautomatorviewer

3.运行bash runuiautomatorviewer.sh即可正常启动uiautomatorviewer工具

相关文章

网友评论

      本文标题:Mac 运行uiautomatorviewer报错解决,因为jd

      本文链接:https://www.haomeiwen.com/subject/dnlfddtx.html