MAC 配置环境变量
MAC 配置环境变量
缘由
想使用 adb
之类的工具,而不想每次都输入路径才能调用。所以要配置下环境变量。
怎么做
这两个路径想要添加进环境变量:
- ~/Library/Android/sdk/platform-tools/
- ~/Library/Android/sdk/tools/
有几个关键文件(没有的话就创建):
/etc/profile
:当有用户登录时执行/etc/bashrc
:当有用户运行 bash shell 时执行/etc/zshrc
:当有用户运行 zsh shell 时执行~/.profile
:当有此文件的用户登录时执行~/.bashrc
:当有此文件的用户运行 bash shell 时执行~/.zshrc
:当有此文件的用户运行 zsh shell 时执行
接下来就好办了,~/.profile
:
然后分别在 ~/.bashrc
和 ~/.zshrc
中添加:
tips
echo $PATH
:查看当前环境变量
bashrc
、zshrc
中的 rc
:是 Run Commands
的缩写。
* http://superuser.com/questions/173165/what-does-the-rc-in-bashrc-etc-mean
* http://askubuntu.com/questions/23482/what-does-rc-in-bashrc-nanorc-stand-for