關於 mac 電腦上如何用終端配置 android 開發環境adb 和 識別手機裝置的方法

來源:互聯網
上載者:User

標籤:

Mac adb配置

1.找到android sdk的本地路徑,

  adb命令在platform-tool下面,記為XXXX

  我的路徑是(/Applications/eclipse/android-sdk-mac_x86/platform-tools)

2.開啟終端輸入

touch .bash_profile   

open -e .bash_profile  點斷行符號

3.添加路徑

.bash_profile開啟了,我們在這裡添加路徑,

如果開啟的文檔裡面已經有內容,我們只要之後添加;XXXX(注意前面一定要用分號隔開),

如果是一個空白文檔的話,我們就輸入一下內容

export PATH=${PATH}:XXXX

儲存,關掉這個文檔,

4.終端輸入命令  source .bash_profile

5.終端輸入命令 adb點斷行符號,如果未顯示command not found,說明此命令有效,環境便亮設定完成。



解決Mac下無法識別Android手機的問題

1. 插上手機開啟終端,輸入:system_profiler SPUSBDataType,將輸出結果記住。

 2. 拔下手機,重複以上動作。


兩者結果對比後會獲得一個Vendor ID:

Composite

 Device:

 

          Product

 ID: 0x0010

          Vendor

 ID: 0x2207 


(Fuzhou Rockchip Electronics Co., Ltd.)

          Version: 

2.22

          Serial

 Number: 0123456789ABCDEF

          Speed:

 Up to 480


Mb/sec

          Manufacturer:

 rockchip

          Location

 ID: 0x14100000


/ 12

          Current

 Available (mA): 500

          Current

 Required (mA): 500

          Capacity:

14.08


GB (14,084,472,832


bytes)

          Removable

 Media: Yes

          Detachable

 Drive: Yes

          BSD

 Name: disk1

          Partition

 Map Type: Unknown

          S.M.A.R.T.

 status: Not Supported


3.在終端裡輸入echo "0x2207" > ~/.android/adb_usb.ini


紅色為你的裝置VendorID

4.adb kill-server

(注意這裡可能會提示找不到adb命令,需要在mac終端關聯下adb,就類似於windows的配置環境變數

進入到/usr/bin目錄下sudo ln -s *你的adb的路徑* adb)

搞定

關於 mac 電腦上如何用終端配置 android 開發環境adb 和 識別手機裝置的方法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.