mac p配置android开发,Mac 下配置Android 环境变量
這里配置的是 android platform-tools 以及 tools
0. 首先,確定配置路徑,
這里我的路徑:
/Users/用戶名/downloads/adt-bundle-mac-x86_64-20140321/sdk/platform-tools
/Users/用戶名/downloads/adt-bundle-mac-x86_64-20140321/sdk/tools
1. 打開終端,輸入:vi .bash_profile 打開用戶配置文件
2. 按字母“i”鍵,進(jìn)如vi編輯器的輸入模式
3. 若文件空白,則在文件中輸入:(冒號(hào)間隔)
export PATH=${PATH}:/Users/用戶名/downloads/adt-bundle-mac-x86_64-20140321/sdk/platform-tools:/Users/用戶名/downloads/adt-bundle-mac-x86_64-20140321/sdk/tools
若文件已有內(nèi)容,則輸入:(冒號(hào)間隔)
:/Users/用戶名/downloads/adt-bundle-mac-x86_64-20140321/sdk/platform-tools:/Users/用戶名/downloads/adt-bundle-mac-x86_64-20140321/sdk/tools
4. 按“esc”鍵退出輸入模式
5. 輸入::wq 保存退出vi編輯器
6. 輸入: source .bash_profile 使修改立即生效。
7. 輸入:adb 測試,如果沒有出現(xiàn)提示“adb: command not found”,說明配置成功。
以上是使用 vi 命令配置,也可以使用 touch 命令,或者直接打開磁盤上的文件(參考下圖)。
1. 輸入:touch ./.bash_profile ?創(chuàng)建 .bash_profile 文件
2. 輸入:open -e .bash_profile 這時(shí)會(huì)用文檔編輯器打開文件.bash_profile
3. 同上面3,輸入路徑。
4. 保存,關(guān)掉文檔編輯器。
5. 輸入?source .bash_profile 使修改立即生效。
6. 測試,同上。
其它問題
1、windows 環(huán)境變量以“;”分號(hào)間隔,mac以“:”冒號(hào)間隔,注意區(qū)分。
2、.bash_profile 文件如果修改出錯(cuò),可能導(dǎo)致無法使用常規(guī)命令。
解決方法:直接從磁盤地址打開,位于用戶根目錄下,修改文件中出錯(cuò)部分
新人創(chuàng)作打卡挑戰(zhàn)賽發(fā)博客就能抽獎(jiǎng)!定制產(chǎn)品紅包拿不停!總結(jié)
以上是生活随笔為你收集整理的mac p配置android开发,Mac 下配置Android 环境变量的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 讨论用户注册有的几篇好文
- 下一篇: android http文件上传,And