MAC 不能连接andorid调试解决方案

50 篇文章 0 订阅

Update for newer versions of adb, ~/.android/adb_usb.ini has to be removed.

Executive summary: Add the Vendor ID to ~/.android/adb_usb.ini and restart adb

Full Details: Most of the time nothing will need to be done to get the Mac to recognize the phone/device. Seriously, 99% of the time "it just works."

That being said, the quickest way to reset adb is to restart it with the following commands in sequence:

  adb kill-server
  adb devices

But every now and then the adb devices command just fails to find your device. Maybe if you're working with some experimental or prototype or out-of-the-ordinary device, maybe it's just unknown and won't show up.

You can help adb to find your device by telling it about your device's "Vendor ID," essentially providing it with a hint. This can be done by putting the hex Vendor ID in the file ~/.android/adb_usb.ini

But first you have to find the Vendor ID value. Fortunately on Mac this is pretty easy. Launch theSystem Information application. It is located in the /Applications/Utilities/ folder, or you can get to it via the Apple Menu in the top left corner of the screen, select "About this Mac", then click the "More Info..." button. Screen grab here:

System Information, Hardware USB tree

Expand the "Hardware" tree, select "USB", then look for your target device. In the above example, my device is named "SomeDevice" (I did that in photoshop to hide the real device manufacturer). Another example would be a Samsung tablet which shows up as "SAMSUNG_Android" (btw, I didn't have to do anything special to make the Samsung tablet work.) Anyway, click your device and the full details will display in the pane below. This is where it lists the Vendor ID. In my example from the screenshot the value is 0x9d17 -- use this value in the next command

echo 0x9d17 >> ~/.android/adb_usb.ini

It's okay if you didn't already have that adb_usb.ini file before this, most of the time it's just not needed for finding your device so it's not unusual for that file to not be present. The above command will create it or append to the bottom of it if it already exists. Now run the commands listed way above to restart adb and you should be good to go.

adb kill-server ; adb devices

* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached 
123ABC456DEF001 device
share | edit | flag
 
 
Note: The newer adb seems to want to manage the adb_usb.ini itself and says DO NOT EDIT so I'm not sure these directions are going to be accurate any longer. I would still suggest checking theSystem Information application to make sure your device shows up. –   dustmachine  Jan 14 '12 at 19:23
2
 
I was close to down-voting you just for using the words "executive summary", but when you ended up solving my problem I decided to up-vote you instead :-) –   Jason Whitehorn  Jul 5 '12 at 1:06
 
Oh man! This works like a charm!!! Ainol Novo7 Flame now works with adb! –   Gramotei  Mar 11 '13 at 17:54 
 
for new versions do android update adb, this will generate the adb_usb.ini file. –   Nathaniel  Mar 28 '13 at 16:32
1
 
Hopefully Google will index this comment to save other people the trouble of spending HOURS hunting down this solution. For anybody else who bought the $89 HP 7-inch Android tablet for Black Friday and can't get USB debugging to work. Just add 0x03f0 to your ~/.android/adb_usb.ini file. –  James Messinger  Nov 30 '13 at 0:58
show 4 more comments

Also make sure you check the vendors website for their "USB" drivers. I had this problem with my AT&T Galaxy Note (Running Android 2.3.6) and it wasn't being recognized by the adb without a driver install that I got from the samsung website.

share | edit | flag
  add comment

If you have installed the application EasyTether, this can interfere with ADB.

From this page you can execute the command:

sudo kextunload /System/Library/Extensions/EasyTetherUSBEthernet.kext 

this will unload your EasyTether extension.

If you need to re-enable EasyTether for tethering, I believe you can use:

sudo kextload /System/Library/Extensions/EasyTetherUSBEthernet.kext 

This worked on my Samsung Galaxy S2. It's been necessary in my case to execute the kextunload command everytime I reboot.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值