【问题标题】:How do I make ADB work on linux with a motorola如何使用摩托罗拉使 ADB 在 linux 上工作
【发布时间】:2013-07-03 18:56:48
【问题描述】:

正如标题所说,我在 linux 上使用 ADB 时遇到了困难。我有一个运行姜饼 2.3.4 的摩托罗拉 Droid X 影子。我有一台装有 Ubuntu 13.04 的笔记本电脑。我需要能够使用 ADB 建立从计算机到手机的连接。

  1. 我从 google 安装了 ADB(到 ~/android-sdk-linux)
  2. 我把手机调试(设置->应用->开发->usb调试)
  3. 我安装了udev rules。 (请参阅this 了解更多信息)
  4. 我重启了电脑和手机
  5. 我连接了两个(手机说正在充电)
  6. 我试过 ./adb devices

我有一个空的设备列表

sam@Aristotle:~$ ls -ahl /etc/udev/rules.d/51-android.rules 

    -rwxr-xr-x 1 root root 2.7K Jun 19 14:03 /etc/udev/rules.d/51-android.rules

sam@Aristotle:~$ cat /etc/udev/rules.d/51-android.rules 
    <!-- snip -->
    SUBSYSTEM==”usb”, ATTR{idVendor}==”22B8″, MODE=”0666″, GROUP=”plugdev”
    <!-- snip -->

然后我重新启动机器。一旦它启动,我插入手机。

root@Aristotle:/home/sam/android-sdk-linux/platform-tools# ./adb devices
    List of devices attached 

root@Aristotle:/home/sam/android-sdk-linux/platform-tools# ./adb kill-server
root@Aristotle:/home/sam/android-sdk-linux/platform-tools# ./adb start-server
    * daemon not running. starting it now on port 5037 *
    * daemon started successfully *
root@Aristotle:/home/sam/android-sdk-linux/platform-tools# ./adb devices
    List of devices attached 

root@Aristotle:/home/sam/android-sdk-linux/platform-tools# 

我也以用户“sam”的身份尝试过这个(sam 在plugdevs 中)。我还尝试在笔记本电脑上使用多个 USB 端口。

我在想我可以使用 this app 之类的东西通过 wifi 与手机通信,但这需要 root,而唯一“安全”的 root 方法需要 adb。

我打开了udev调试,又试了一次。然后我打开 /var/log/udev。它很长,所以我搜索了'22b8'(不区分大小写),因为根据here,那是摩托罗拉的USB供应商ID,但我的搜索找不到任何结果。我不认为我放置 /etc/udev/rules.d/ 的规则出于某种原因正在触发。

找到here 的输出到sudo lsusb -vv(太长,无法发布)。

我也试过安装 p2kmoto

root@Aristotle:/home/sam/android-sdk-linux/platform-tools# p2ktest 
P2k Test
Device list:
1d6b:0001: [Linux 3.8.0-26-generic ohci_hcd] [OHCI Host Controller]
0461:4d16: [] [USB Optical Mouse]
1d6b:0001: [Linux 3.8.0-26-generic ohci_hcd] [OHCI Host Controller]
1d6b:0001: [Linux 3.8.0-26-generic ohci_hcd] [OHCI Host Controller]
1d6b:0001: [Linux 3.8.0-26-generic ohci_hcd] [OHCI Host Controller]
04f2:b044: [Chicony Electronics Co., Ltd.] [CNF7017]
1d6b:0002: [Linux 3.8.0-26-generic ehci_hcd] [EHCI Host Controller]
1d6b:0002: [Linux 3.8.0-26-generic ehci_hcd] [EHCI Host Controller]
No phone found.

【问题讨论】:

  • lsusb 的输出是什么?重启手机后usb开发者选项是否依然开启?
  • 您以 root 权限运行 adb - 您的问题与 udev 规则无关(仅允许 adb 访问普通用户)
  • 通常“非root”问题表现为检测到设备但状态=??????
  • @QuentinSwain 这是 lsusb 输出:dl.dropboxusercontent.com/u/33591459/lsusb.txt
  • 你的 lsusb 输出中没有安卓设备。即使手机显示正在充电 - 我会尝试使用另一根 USB 数据线。

标签: android linux ubuntu adb


【解决方案1】:

从 lsusb 的结果来看,似乎没有显示 android 设备。你在手机上启用了usb调试吗?详情请查看video

【讨论】:

  • 除了开启usb调试。如果运行 4.2.2,则需要在设备提示时授权设备连接的机器。
  • 事情在usb调试模式。我重新启动了手机,它仍然处于调试模式。我正在运行 2.3.4。 lsusb 输出中没有任何变化。我究竟在 lsusb 输出中寻找什么?
猜你喜欢
  • 2013-02-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-04-16
相关资源
最近更新 更多