MAC 配置android adb命令的環境變量

1,打開終端,敲入命令:sudo vi .bash_profile  (若是有密碼就爲本機登陸密碼)(若是沒有這個文件就會建立一個新的)android

默認終端目錄如圖,生成的文件爲隱藏文件:web

(顯示隱藏文件命令:defaults write com.apple.finder AppleShowAllFiles -bool truebash

(隱藏命令:defaults write com.apple.finder AppleShowAllFiles -bool falseapp

2,在文件中寫入一下內容:
eclipse

export PATH=${PATH}:/Users/yujianbinmac/Documents/softwear_package/yjb_eclipse/goole_eclipse/adt-bundle-mac-x86_64-20130522/sdk/platform-toolsspa

export PATH=${PATH}:/Users/yujianbinmac/Documents/softwear_package/yjb_eclipse/goole_eclipse/adt-bundle-mac-x86_64-20130522/sdk/toolsorm

export PATH=${PATH}:/Users/yujianbinmac/Documents/softwear_package/yjb_eclipse/NDK/android-ndk-r9cip

A_NDK_ROOT=/Users/yujianbinmac/Documents/softwear_package/yjb_eclipse/NDK/android-ndk-r9cit

export A_NDK_ROOTform

其中:/Users/yujianbinmac/Documents/softwear_package/yjb_eclipse/goole_eclipse/adt-bundle-mac-x86_64-20130522/sdk/tools:不是固定的,它指向android SDK的tools目

3,寫完以後,按鍵盤上面的esc鍵,在按shift+:   結束編輯;

4,接着敲入wq,按回車。(保存退出)

5,重啓終端,

6,驗證:輸入adb回車。若是未顯示command not found,說明此命令有效,環境便亮設置完成。

問題:

若是這麼配置了仍是不成功,那麼有多是.pash_profile文件建立重複了;

用上面顯示隱藏文件命令,將.pash_profile類型文件列出來,刪掉重複的,或者都刪掉在從新建立,配置!(這也是我遇到的問題)

相關文章
相關標籤/搜索