作者:黄宗翰琼琦莉雯 | 来源:互联网 | 2023-07-31 09:11
Mac下运行一个ionic新项目,命令行敲ionic cordova run android,总是报错
1
| ERROR running one or more of the platforms: Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable. |
我的.bash_profile文件设置为
1 2 3
| export ANDROID_HOME=Users/wang/Library/Android/sdk
export PATH=${PATH}:${ANROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/platform-tools |
.zshrc文件是:
1 2 3
| export ANDROID_HOME=/Users/wang/Library/Android/sdk
export PATH=/usr/local/bin:$ANDROID_HOME/tools:$PATH:$ANDROID_HOME/platform-tools
source ~/.bash_profile |
执行adb命令有效,没有command not found。