【发布时间】:2015-10-12 21:42:18
【问题描述】:
从 Windows 迁移到 Debian 后,我遇到了大问题。我无法运行在 Android Studio 中开发的任何应用程序。 “设备选择器”看不到我的任何设备(LG G2 和 LG G4),“adb 设备”也没有结果:
adb 设备:
nomader@ideapad:~$ adb devices
List of devices attached
但电话已明确连接:
lsusb:
nomader@ideapad:~$ lsusb
Bus 004 Device 003: ID 04f2:b2f1 Chicony Electronics Co., Ltd
Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 003: ID 09da:9090 A4 Tech Co., Ltd XL-750BK Laser Mouse
Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 1004:633e LG Electronics, Inc.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
我在 /etc/udev/rules.d 中添加了规则
51-android.rules:
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666", GROUP="plugdev"
并编辑 adb_usb.ini:
# ANDROID 3RD PARTY USB VENDOR ID LIST -- DO NOT EDIT.
# USE 'android update adb' TO GENERATE.
# 1 USB VENDOR ID PER LINE.
0x1004
但这些都不起作用,我仍然无法检测到我的设备。
有什么想法吗?
编辑:在 Windows 上一切正常
【问题讨论】:
-
几乎没有一个对我有用。我只在
lsusb -v中找到了与文章中的一个匹配的接口描述符,但我已经将 0x1004 添加到 adb_usb.ini 并且~$ find -L /sys/bus/usb/devices -maxdepth 2 -path "*/modalias" -printf "%h\t" -exec cat {} \; | \ awk -F: '/icFFisc42ip0/ {print $1}' | xargs -i cat {}/idVendor | awk '{print"0x"$1}'没有给出任何输出。我的硬件工作正常,因为在 Windows 上一切正常。 -
忘记
adb_usb.ini。不再需要它(自平台工具 v23 起)。但find -L /sys/bus/usb/devices -maxdepth 2 -path "*/modalias" -printf "%h\t" -exec cat {} \; | grep 'icFFisc42ip01'没有输出意味着USB Debugging在您的设备上未开启(或正常工作)。 -
如果在 Windows 上一切正常,USB 调试是否有可能在我的设备上无法正常工作?我可以更改任何设置以使其在 Debian 上工作吗?
-
我找到了解决方案。我非常绝望,所以我开始在手机上切换设置,结果发现将 USB 连接从 MTP 更改为 PTP 解决了这个问题。感谢您的帮助:)
标签: android android-studio debian adb udev