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