第一步:配置.bash_profile
1)打開終端,輸入(打開并編輯.bash_profile文件):
open -e .bash_profile
2)如若提示command not found:open,輸入(暫時可以使用命令,關(guān)閉后又得重新輸入):
export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin
2)如若提示文件不存在,輸入(創(chuàng)建.bash_profile文件):
touch .bash_profile
3)繼續(xù)執(zhí)行輸入 (打開并編輯.bash_profile文件):
open -e .bash_profile
4)找到sdk位置,在.bash_profile文件中添加以下內(nèi)容:
export ANDROID_HOME=/Users/phoenix/Library/Android/sdk
export PATH=${PATH}:${ANDROID_HOME}/platform-tools
export PATH=${PATH}:${ANDROID_HOME}/tools
5、保存.bash_profile文件,輸入(讓編輯內(nèi)容立即生效):
source .bash_profile
第二步、配置 .zshrc 文件
1)輸入(打開并編輯.zshrc文件):
open -e .zshrc
2)如若提示command not found:open,輸入(暫時可以使用命令,關(guān)閉后又得重新輸入):
export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin
2)如若提示文件不存在,輸入(創(chuàng)建.zshrc文件):
touch .zshrc
3)繼續(xù)執(zhí)行輸入 (打開并編輯.zshrc文件):
open -e .zshrc
4)在zshrc文件中添加以下內(nèi)容:
source ~/.bash_profile
5、保存.zshrc,輸入(讓編輯內(nèi)容立即生效):
source .zshrc
第三步:驗證
輸入adb version
Version 33.0.1-8253317
大功告成!