Mac 下配置.bash_profile(环境变量)

  1. 进入当前用户的home目录
cd ~/
  1. 创建.bash_profile文件:(已有的可以直接打开)
touch .bash_profile
  1. 打开.bash_profile 并编辑
open .bash_profile
  1. 之后就打开了一个记事本,会显示你之前配置过的path,根据自己需要去配置
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export PATH=/Users/wangcan/flutter/flutter/bin:$PATH
export ANDROID_HOME=/Users/wangcan/Library/Android/sdk
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/PLATFORM-tools
export PATH="$PATH:/Users/wangcan/Desktop/depot_tools"
export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin
export NODE_HOME=/usr/local
export PATH=$PATH:$NODE_HOME/bin

[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
  1. 修改完之后,记得保存,然后关闭文件
  2. 修改后的配置,生效:
source .bash_profile

你可能感兴趣的:(Mac 下配置.bash_profile(环境变量))