不管是在Windows系统还是在Linux系统中,相信不少用户或开发者都遇到过手机adb连接不上的情况。其实出现这种问题很多时候是由于adb冲突导致的,毕竟很多软件都有自己的adb链接。那么,出现这种问题该怎么办呢?下面就给大家介绍下Mac或者linux下adb连接失败的解决办法。
1.查看设备VenderID
在mac下或者Linux打开终端(Terminal),linux下可以按快捷键(CTRL+T,忘了具体是不是大家去试试或者查查),mac下Control+space,输入Terminal打开。打开终端后,输入命令
mac下:
system_profilerSPUSBDataType
linux下:
lsusb
结果如下:
USB:
USB3.0Bus:
HostControllerDriver:AppleUSBXHCILPTH
PCIDeviceID:0x8c31
PCIRevisionID:0x0005
PCIVendorID:0x8086
AppleInternalKeyboard/Trackpad:
ProductID:0x0262
VendorID:0x05ac(AppleInc.)
Version:2.25
Speed:Upto12Mb/sec
Manufacturer:AppleInc.
LocationID:0x14400000/4
CurrentAvailable(mA):1000
CurrentRequired(mA):40
ExtraOperatingCurrent(mA):0
Built-In:Yes
BRCM20702Hub:
ProductID:0x4500
VendorID:0x0a5c(BroadcomCorp.)
Version:1.00
Speed:Upto12Mb/sec
Manufacturer:AppleInc.
LocationID:0x14300000/3
CurrentAvailable(mA):1000
CurrentRequired(mA):94
ExtraOperatingCurrent(mA):0
Built-In:Yes
BluetoothUSBHostController:
ProductID:0x8289
VendorID:0x05ac(AppleInc.)
Version:1.18
Speed:Upto12Mb/sec
Manufacturer:AppleInc.
LocationID:0x14330000/7
CurrentAvailable(mA):1000
CurrentRequired(mA):0
ExtraOperatingCurrent(mA):0
Built-In:Yes
USBMouse:
ProductID:0x00fb
VendorID:0x0e8f
Version:0.01
Speed:Upto1.5Mb/sec
Manufacturer:YSTEK
LocationID:0x14200000/2
CurrentAvailable(mA):1000
CurrentRequired(mA):100
ExtraOperatingCurrent(mA):0
MX4Pro:
ProductID:0x0c02
VendorID:0x2a45
Version:ff.ff
SerialNumber:0123456789ABCDEF
Speed:Upto480Mb/sec
Manufacturer:Meizu
LocationID:0x14100000/29
CurrentAvailable(mA):1000
CurrentRequired(mA):500
ExtraOperatingCurrent(mA):0
我的是MX4Pro,所以VendorID:0x2a45
2.添加VendorID
进入/Users/user/.android,.android为隐藏文件夹,可以通过终端进入直接:
cd/Users/user/.android
ls
应该有个adb_usb.ini文件,在windows用户目录下也有该文件。添加上上面的VendorID
#ANDROID3RDPARTYUSBVENDORIDLIST--DONOTEDIT.
#USE‘androidupdateadb’TOGENERATE.
#1USBVENDORIDPERLINE.
0x2a45
3.重启adb命令
在终端下一次输入:
adbkill-server
adbstart-server
以上就是Mac或者linux下adb连接失败的解决办法,还不清楚的用户可以根据上面的步骤操作来解决问题。