第一步: 查看usb設備信息
html
在 終端輸入:system_profiler SPUSBDataType 能夠查看鏈接的usb設備的信息android
好比個人usb信息以下(部份內容):app
Android:
ui
Product ID: 0x0c02spa
Vendor ID: 0x2a45.net
Version: ff.ff命令行
Serial Number: 71MBBL324K7Q調試
Speed: Up to 480 Mb/secorm
Manufacturer: Meizuserver
Location ID: 0x14200000 / 10
Current Available (mA): 500
Current Required (mA): 500
查看到個人android手機的Vendor ID: 0x2a45,記住這個id
第二步: 建立、修改adb_usb.ini文件
輸入: vi ~/.android/adb_usb.ini 命令,在打開的 adb_usb.ini文件中添加0x22d9, 而後保存退出
個人設備只有一個,因此添加完畢後文件內容以下:
http://eachday.iguesth.com/default.html
0x22d9
(注:請保證ini裏面沒有空行,不然會有錯誤 ADB server didn't ack)
注意:第一次添加時,adb_usb.ini文件並無,須要本身建立一個,輸入內容後保存就行了。vi不會用的話,直接進入相應目錄修改文件也能夠,對應的路徑以下:
\Users\你的用戶\.android\adb_usb.ini
備註:
.android目錄是隱藏的,須要開啓隱藏目錄顯示。
命令行輸入顯示Mac隱藏文件的命令:defaults write com.apple.finder AppleShowAllFiles -bool true
(隱藏Mac隱藏文件的命令:defaults write com.apple.finder AppleShowAllFiles -bool false
)
輸完單擊Enter鍵,退出終端,從新啓動Finder就能夠了
重啓Finder:鼠標單擊窗口左上角的蘋果標誌-->強制退出-->Finder-->從新啓動
第三步:重啓adb
adb kill-server
adb start-server
adb devices
就能夠看到列表了!
第四部:進入DDMS,已經能夠找到的個人android手機了,開始調試吧!
有時 adb devices不能顯示鏈接設備,須要拔掉數據線,多插幾回,而且退出終端,而後從新打開,再輸入命令就能發現鏈接的設備。
內容參考:http://blog.csdn.net/w122079514/article/details/8499359
在其基礎上完善了下