ADB调试安卓

First Post:

Last Update:

Word Count:
267

Read Time:
1 min

ADB调试安卓

Install:

1
sudo pacman -S adb

在手机上设置开发者模式,usb调试安装等。

redmi note9设置: https://zhidao.baidu.com/question/206891065776523485.html

设置好后发现adb devices下没有权限,

通过lsusb查看usb id号:

1
lsusb

输出

1
2
3
4
5
6
7
8
9
10
11
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 04f2:b67c Chicony Electronics Co., Ltd Integrated Camera
Bus 003 Device 002: ID 0cf3:e300 Qualcomm Atheros Communications QCA61x4 Bluetooth 4.0
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 2109:0817 VIA Labs, Inc. USB3.0 Hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 009: ID 18d1:4ee7 Google Inc. Nexus/Pixel Device (charging + debug)
Bus 001 Device 004: ID 0bda:8152 Realtek Semiconductor Corp. RTL8152 Fast Ethernet Adapter
Bus 001 Device 003: ID 2109:2817 VIA Labs, Inc. USB2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

这里就是18d1:4ee7

1
sudo vim /etc/udev/rules.d/51-android.rules

添加:

1
SUBSYSTEM==“usb”, ATTRS{idVendor}“0bb4”,ATTRS{idProduct}“0c87”,MODE="0666"

其中0bb4和0c87替换成之前我们记下的id就可以;

给予权限

1
sudo chmod a+rx /etc/udev/rules.d/51-android.rules

拔掉设备,重启adb

1
2
sudo adb kill-server
sudo adb start-server

ref:

打赏点小钱
支付宝 | Alipay
微信 | WeChat