Mac环境配置
基本概念:
苹果下的终端改成了zsh,所以需要这么创建
1.终端打开,确定在~目录,输入:
cd ~
touch .zshrc
2.记事本打开.zshrc文件添加如下代码
source ~/.bash_profile
也可以这样通过命令行输入:echo “source ~/.bash_profile” > .zshrc
3.输入以下命令
touch .bash_profile
4.记事本打开.bash_profile添加环境变量
export PATH=${PATH}:~/Library/Android/sdk/platform-tools
5.常用的路径
${HOME}表示用户目录,避免硬编码,防止出现换名称后就无法使用的问题
Brew环境配置
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
#Flutter环境配置
export FLUTTER_STORAGE_BASE_URL="https://mirrors.tuna.tsinghua.edu.cn/flutter"
export PUB_HOSTED_URL="https://mirrors.tuna.tsinghua.edu.cn/dart-pub"
export FLUTTER_ROOT=~/Library/Flutter/flutter2.8.1
#Android环境配置
export ANDROID_HOME=~/Library/Android/sdk
#JDK环境
export JAVA_11_HOME='/usr/libexec/java_home -v 11'
export JAVA_HOME=${JAVA_11_HOME}
export PATH=${PATH}:${JAVA_HOME}/bin
export PATH=${PATH}:${FLUTTER_ROOT}/bin
export PATH=${PATH}:${ANDROID_HOME}/platform-tools