欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  科技

Linux或者Mac下adb连接失败如何解决

程序员文章站 2023-03-25 08:00:02
Linux下手机adb连接不上怎么办,今天小编就为大家带来Mac或者linux下adb连接失败的解决办法,来看看吧... 16-04-20...

不管是在windows系统还是在linux系统中,相信不少用户或开发者都遇到过手机adb连接不上的情况。其实出现这种问题很多时候是由于adb冲突导致的,毕竟很多软件都有自己的adb链接。那么,出现这种问题该怎么办呢?下面就给大家介绍下mac或者linux下adb连接失败的解决办法。

Linux或者Mac下adb连接失败如何解决

1.查看设备venderid

在mac下 或者linux打开终端(terminal),linux下可以按快捷键(ctrl+t,忘了具体是不是大家去试试或者查查),mac下control+space,输入terminal打开。打开终端后,输入命令

mac下:

system_profiler spusbdatatype

linux下:

lsusb

结果如下:

usb:

usb 3.0 bus:

host controller driver: appleusbxhcilpth

pci device id: 0x8c31

pci revision id: 0x0005

pci vendor id: 0x8086

apple internal keyboard / trackpad:

product id: 0x0262

vendor id: 0x05ac (apple inc.)

version: 2.25

speed: up to 12 mb/sec

manufacturer: apple inc.

location id: 0x14400000 / 4

current available (ma): 1000

current required (ma): 40

extra operating current (ma): 0

built-in: yes

brcm20702 hub:

product id: 0x4500

vendor id: 0x0a5c (broadcom corp.)

version: 1.00

speed: up to 12 mb/sec

manufacturer: apple inc.

location id: 0x14300000 / 3

current available (ma): 1000

current required (ma): 94

extra operating current (ma): 0

built-in: yes

bluetooth usb host controller:

product id: 0x8289

vendor id: 0x05ac (apple inc.)

version: 1.18

speed: up to 12 mb/sec

manufacturer: apple inc.

location id: 0x14330000 / 7

current available (ma): 1000

current required (ma): 0

extra operating current (ma): 0

built-in: yes

usb mouse:

product id: 0x00fb

vendor id: 0x0e8f

version: 0.01

speed: up to 1.5 mb/sec

manufacturer: ystek

location id: 0x14200000 / 2

current available (ma): 1000

current required (ma): 100

extra operating current (ma): 0

mx4 pro:

product id: 0x0c02

vendor id: 0x2a45

version: ff.ff

serial number: 0123456789abcdef

speed: up to 480 mb/sec

manufacturer: meizu

location id: 0x14100000 / 29

current available (ma): 1000

current required (ma): 500

extra operating current (ma): 0

我的是mx4 pro,所以vendor id: 0x2a45

2.添加vendorid

进入/users/user/.android,.android为隐藏文件夹,可以通过终端进入直接:

cd /users/user/.android

ls

应该有个adb_usb.ini文件,在windows用户目录下也有该文件。添加上上面的vendor id

# android 3rd party usb vendor id list -- do not edit.

# use ‘android update adb’ to generate.

# 1 usb vendor id per line.

0x2a45

3.重启adb命令

在终端下一次输入:

adb kill-server

adb start-server

以上就是mac或者linux下adb连接失败的解决办法,还不清楚的用户可以根据上面的步骤操作来解决问题。