简体   繁体   English

“adb devices”在 Ubuntu 上返回空的“附加设备列表”

[英]“adb devices” returns empty “List of devices attached” on Ubuntu

Based on react native documentation ( https://facebook.github.io/react-native/docs/running-on-device ) I wanted to connect to ADB in my ubuntu vm (Ubuntu 18.04.2 LTS) but my problem is that i keep getting an empty list. Based on react native documentation ( https://facebook.github.io/react-native/docs/running-on-device ) I wanted to connect to ADB in my ubuntu vm (Ubuntu 18.04.2 LTS) but my problem is that我不断收到一个空列表。

So what steps I have followed:那么我遵循了哪些步骤:

  1. lsusb to extract mobile model (in my case 2a45) lsusb 提取移动 model(在我的情况下为 2a45)

devnull@greg_server:~$ lsusb

Bus 001 Device 004: ID 2a45 :2008 Meizu Corp. MX Phone (MTP) Bus 001 Device 004: ID 2a45 :2008 Meizu Corp. MX Phone (MTP)

Bus 001 Device 002: ID 80ee:0021 VirtualBox USB Tablet总线 001 设备 002:ID 80ee:0021 VirtualBox USB 平板电脑

Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub总线 001 设备 001:ID 1d6b:0001 Linux Foundation 1.1 根集线器

  1. input this into your udev rules in order to get up and running将此输入到您的 udev 规则中以启动并运行

echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="2a45", MODE="0666", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/51-android-usb.rules

  1. show adb list显示亚行列表

devnull@greg_server:~$ adb devices

List of devices attached附加设备列表

In order to troubleshoot based on为了排除故障

“List of devices attached” is empty on Ubuntu 16.04 using "adb devices" 使用“adb devices”的 Ubuntu 16.04 上的“附加设备列表”为空

I followed the below steps:我按照以下步骤操作:

  1. created adb_usb.ini file and restarted adb server创建 adb_usb.ini 文件并重新启动 adb 服务器

devnull@greg_server:~$ cat ~/.android/adb_usb.ini

0x2a45 0x2a45

devnull@greg_server:~$ adb kill-server

devnull@greg_server:~$ adb start-server;

daemon not running;守护进程没有运行; starting now at tcp:5037从现在开始 tcp:5037

daemon started successfully守护进程成功启动

devnull@greg_server:~$ adb devices

List of devices attached附加设备列表

  1. enabled usb debugging and checked again adb devices启用 usb 调试并再次检查 adb devices

In this case I noticed that lsusb doesn't identify my mobile and adb devices command returns again an empty list as shown below在这种情况下,我注意到 lsusb 无法识别我的手机,并且 adb devices 命令再次返回一个空列表,如下所示

devnull@greg_server:~$ lsusb

Bus 001 Device 002: ID 80ee:0021 VirtualBox USB Tablet总线 001 设备 002:ID 80ee:0021 VirtualBox USB 平板电脑

Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub总线 001 设备 001:ID 1d6b:0001 Linux Foundation 1.1 根集线器

devnull@greg_server:~$ adb devices

List of devices attached附加设备列表

  1. checked android usb file configuration检查android usb文件配置

root@greg_server:/etc/udev/rules.d# pwd

/etc/udev/rules.d /etc/udev/rules.d

root@greg_server:/etc/udev/rules.d# ls -lst

total 64共 64

4 -rw-r--r-- 1 root root 71 Oct 24 07:18 51-android-usb.rules 4 -rw-r--r-- 1 根 71 Oct 24 07:18 51-android-usb.rules

60 -rw-r--r-- 1 root root 58549 May 8 06:28 70-snap.core.rules 60 -rw-r--r-- 1 根 58549 5 月 8 日 06:28 70-snap.core.rules

root@greg_server:/etc/udev/rules.d# cat 51-android-usb.rules

SUBSYSTEM=="usb", ATTR{idVendor}=="2a45", MODE="0666", GROUP="plugdev" SUBSYSTEM=="usb", ATTR{idVendor}=="2a45", MODE="0666", GROUP="plugdev"

Any help on what might be the case?关于可能是什么情况的任何帮助?

I'm attempting to get ADB up and running on an older version of ubuntu, but my problems are more fundamental (I'm trying to do this in Virtualbox as well).我试图让 ADB 在旧版本的 ubuntu 上启动并运行,但我的问题更为根本(我也在 Virtualbox 中尝试这样做)。

However - I noticed that this answer didn't contain something which has fixed the issue for others - the USB configuration mode (a developer option which should be under the dev settings somewhere).但是 - 我注意到这个答案没有包含为其他人解决问题的东西 - USB 配置模式(开发人员选项应该在某处的开发设置下)。

On the device I'm using, this was under "Default USB Configuration" - advice from others appears to be that selecting PTP is the way to go.在我使用的设备上,这是在“默认 USB 配置”下 - 其他人的建议似乎是选择 PTP 是通往 go 的方法。

Hope that might help out.希望这可能会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Split function 总是返回空数组 [Browserstack, IOS devices] - Split function always returns empty array [Browserstack, IOS devices] “哪个adb”命令显示adb的路径,但“ adb设备”表示没有这样的文件或目录 - “which adb” command shows the path of adb but “adb devices” says no such file or directory fb.ui供稿对话框在Chrome和移动设备中返回空的回调 - fb.ui feed dialog returns empty callback in chrome and mobile devices moment()。format(…)在某些设备上返回本地时间,在其他设备上返回UTC - moment().format(…) returns local time on some devices and UTC on other devices 使用exec()在cmd行中的电子js上执行命令'ADB设备' - Executing command 'ADB devices' on electron js in cmd line using exec() 执行命令“adb devices”Visual Studio 代码时出错 - Error while executing command 'adb devices' visual studio code 有没有办法从 HTML 页面运行“adb 设备”? - Is there any way to run "adb devices" from HTML page? HTC Android设备上的Javascript console.log()和adb logcat - Javascript console.log() on HTC Android devices and adb logcat 重复的BLE设备列表 - List of BLE devices being duplicated 获取 WebUSB API 中可用 USB 设备的列表 - Get list of available USB devices in WebUSB API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM