Mac Appium ANDROID_HOME 环境变量问题

macOS 版本:10.15.4 (19E287)

appium版本:1.18.3

 

遇到的问题:

先是报这个:An unknown server-side error occurred while processing the command. Original error: Neither ANDROID_HOME nor ANDROID_SDK_ROOT environment variable was exported. Read https://developer.android.com/studio/command-line/variables for more details

各种配置了一通后报这个:An unknown server-side error occurred while processing the command. Original error: The JAVA_HOME environment variable must be set for Android Tools to work properly

 

在尝试了各种方式都没有得到解决,刚开始就按照提示检查ANDROID_HOME、ANDROID_SDK_ROOT,各种配置了一通

~/.bash_profile无果,检查了echo $ANDROID_HOME 也是没错。最终参考https://testerhome.com/topics/7170得到了解决

.bash_profile 配置的是用户变量

.zshrc 配置的是环境变量

 

目前的配置:

open .zshrc 

export ANDROID_HOME=/Users/apple/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
source ~/.bash_profile

 

open .bash_profile (折腾bash_profile 的时候被我删的只剩下这一点了,用来排查哪里配错了,不过有备份,现在可以去加回去了。。。)

export PATH=/usr/local/bin:/usr/local/sbin:~/bin:$PATH

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH
export CLASS_PATH=$JAVA_HOME/lib

 

posted @ 2020-11-15 13:55  小披风的小蝴蝶  阅读(2222)  评论(0编辑  收藏  举报