Mac 運(yùn)行uiautomatorviewer報(bào)錯(cuò)解決,因?yàn)閖dk版本不匹配造成!

[轉(zhuǎn)載]

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.

[進(jìn)程已完成]

解決方案

jdk版本不匹配,回退版本至8,詳細(xì)如下

1.下載jdk1.8版本,并安裝

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

2.進(jìn)入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.運(yùn)行bash runuiautomatorviewer.sh即可正常啟動(dòng)uiautomatorviewer工具

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容