mac 下真機調試 android 手機

第一步: 查看usb設備信息android

在 終端輸入:system_profiler SPUSBDataType     能夠查看鏈接的usb設備的信息app

好比個人usb信息以下(部份內容):編輯器

Spreadtrum phone:ui


              Product ID: 0x5d04spa

              Vendor ID: 0x1782命令行

              Version:  2.29調試

              Serial Number: 19761202orm

              Speed: Up to 480 Mb/secserver

              Manufacturer: Spreadtrumit

              Location ID: 0xfa120000 / 6

              Current Available (mA): 500

              Current Required (mA): 500

查看到個人android手機的Vendor ID: 0x1782,記住這個id

第二步: 建立、修改adb_usb.ini文件

輸入: vi ~/.android/adb_usb.ini 命令,在打開的 adb_usb.ini文件中添加0x1782, 而後保存退出

或者使用其餘的文本編輯器去進行修改均可以的

(注:請保證ini裏面沒有空行,不然會有錯誤 ADB server didn't ack)

注意:第一次添加時,adb_usb.ini文件並無,須要本身建立一個,輸入內容後保存就行了,對應的路徑以下:

\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這個命令,

adb kill-server

adb start-server

adb devices

就能夠看到列表了!

第四部:進入DDMS,已經能夠找到的個人android手機了,開始調試吧!

有時 adb devices不能顯示鏈接設備,須要拔掉數據線,多插幾回,而且退出終端,而後從新打開,再輸入命令就能發現鏈接的設備

相關文章
相關標籤/搜索