實現(xiàn)步驟:
- 打開終端
- 輸入 vim ~/.bash_profile
- 輸入i 打開編輯模式
- 輸入
export PATH=${PATH}:~/Library/Android/sdk/platform-tools
export PATH=${PATH}:~/Library/Android/sdk/tools
- 點esc推出按鈕
- 然后輸入:wq!保存并退出
- 輸入source .bash_profile
以上命令可能會出現(xiàn)警告:
Swap file "~/.bash_profile.swp" already exists!,出現(xiàn)這個警告的原因是:vim編輯過程中,由于某種原因異常退出正在編輯的文件,再次編輯該文件時,會出現(xiàn)該提示。此時按照提示點擊就行,比如編輯模式點擊字母o
摘自:http://www.itdecent.cn/p/8e51bc9cebfa
但是這時候,關(guān)閉終端輸入adb無效,解決辦法:
學習鏈接
https://www.cnblogs.com/xiaoyanguniang/p/16902959.html
具體步驟
- touch .zshrc 創(chuàng)建zshrc文件
- vi .zshrc
- cat .zshrc
- 此時應(yīng)該是編輯模式,輸入source ~/.bash_profile
- source ~/.zshrc
就可以了!