ubuntu ADB 文件配置

2021/8/4 7:08:30

本文主要是介绍ubuntu ADB 文件配置,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

参考 原文链接:https://blog.csdn.net/qq_31180471/article/details/104486102

1)问题现象:

ator@atorpc:~/workspace$ adb devices
List of devices attached
1234567    no permissions

解决方案:

1. lsusb

以下是我的输出(当前连的是小米手机)
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 004 Device 002: ID 062a:0000 Creative Labs Optical mouse

Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 003 Device 002: ID 413c:2105 Dell Computer Corp. Model L100 Keyboard

Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 001 Device 007: ID 18d1:9025 Google Inc.

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

注意上面输出的蓝色一行:
Bus 001 Device 007: ID 18d1:9025 Google Inc.
创建rules文件
sudo vi/etc/udev/rules.d/51-android.rules
在末尾增加文件内容:
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="9025", MODE="0600"
保存后给予权限:
sudo chmod a+rx/etc/udev/rules.d/51-android.rules
 sudo /etc/init.d/udev restart 或者 sudo restartudev

插拔USB 数据线
sudo ./adb kill-server
sudo ./adb start-server
sudo ./adb devices

2)问题现象:

ator@atorpc:~/workspace$ fastboot devices
no permissions (user in plugdev group; are your udev rules wrong?); see [http://developer.android.com/tools/device.html]fastboot

  解决方案:

Know the USB Vendor Id and Product Id of your android device using lsusb command as,

$ lsusb

Bus 001 Device 019: ID 2e04:c008

As seen above, For Our mobile idVendor is 2e04 and idProduct is c008, add this details to udev rule as, [ Replace idVendor and idProduct as per your device ]

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

SUBSYSTEM=="usb", ATTR{idVendor}=="2e04", ATTR{idProduct}=="c008", MODE="0666", GROUP="plugdev"

$ sudo udevadm control --reload-rules

$ adb kill-server

插拔USB 数据线

$ adb devices
————————————————

 



这篇关于ubuntu ADB 文件配置的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程