美文网首页
bash_profile文件和环境变量

bash_profile文件和环境变量

作者: 阳明先生_X自主 | 来源:发表于2021-03-08 22:17 被阅读0次

1.打开bash_profile文件编辑环境变量
open ~/.bash_profile

export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export PATH=/Users/zhangxiaomeng02/Desktop/flutter-1.22.5/bin:$PATH
export ANDROID_HOME="/Users/zhangxiaomeng02/Library/Android/sdk" 
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/platform-tools

alias ll='ls -hl'

2.执行环境变量

source ~/.bash_profile

运行 source $HOME/.bash_profile 刷新当前终端窗口.

注意:

如果你使用的是zsh,终端启动时 ~/.bash_profile 将不会被加载,解决办法就是修改 ~/.zshrc ,在其中添加:

source ~/.bash_profile

例子验证:
flutter pub get

相关文章

网友评论

      本文标题:bash_profile文件和环境变量

      本文链接:https://www.haomeiwen.com/subject/bkmmqltx.html