mac 下真機調試 android 手機

來源:互聯網
上載者:User

標籤:android   使用   io   檔案   資料   art   ar   div   

第一步: 查看usb裝置資訊

在 終端輸入:system_profiler SPUSBDataType     可以查看串連的usb裝置的資訊

比如我的usb資訊如下(部分內容):

Spreadtrum phone:

 

              Product ID: 0x5d04

              Vendor ID: 0x1782

              Version:  2.29

              Serial Number: 19761202

              Speed: Up to 480 Mb/sec

              Manufacturer: Spreadtrum

              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不能顯示串連裝置,需要拔掉資料線,多插幾次,並且退出終端,然後重新開啟,再輸入命令就能發現串連的裝置

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.