Ubuntu 下Android adb devices显示no permission

Setting up a Device for Development

With an Android-powered device, you can develop and debug your Android applications just as you would on the emulator. Before you can start, there are just a few things to do:

  1. Declare your application as "debuggable" in your Android Manifest.

    In Eclipse, you can do this from the Application tab when viewing the Manifest (on the right side, set Debuggable to true). Otherwise, in theAndroidManifest.xml file, add android:debuggable="true" to the <application> element.

  2. Turn on "USB Debugging" on your device.

    On the device, go to the home screen, press MENU, select Applications > Development, then enable USB debugging.

  3. Setup your system to detect your device.
    • If you're developing on Windows, you need to install a USB driver for adb. See the Windows USB Driver documentation.
    • If you're developing on Mac OS X, it just works. Skip this step.
    • If you're developing on Ubuntu Linux, you need to add a rules file that contains a USB configuration for each type of device you want to use for development. Each device manufacturer uses a different vendor ID. The example rules files below show how to add an entry for a single vendor ID (the HTC vendor ID). In order to support more devices, you will need additional lines of the same format that provide a different value for the SYSFS{idVendor} property. For other IDs, see the table of USB Vendor IDs, below.
      1. Log in as root and create this file: /etc/udev/rules.d/51-android.rules.

        For Gusty/Hardy, edit the file to read:
        SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"

        For Dapper, edit the file to read:
        SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4", MODE="0666"

      2. Now execute:
        chmod a+r /etc/udev/rules.d/51-android.rules

You can verify that your device is connected by executing adb devices from your SDK tools/ directory. If connected, you'll see the device name listed as a "device."

If using Eclipse, run or debug as usual. You will be presented with a Device Chooser dialog that lists the available emulator(s) and connected device(s). Select the device upon which you want to install and run the application.

If using the Android Debug Bridge (adb), you can issue commands with the -d flag to target your connected device.

USB Vendor IDs

This table provides a reference to the vendor IDs needed in order to add USB device support on Linux. The USB Vendor ID is the value given to the SYSFS{idVendor}property in the rules file, as described in step 3, above.

Manufacturer USB Vendor ID
Acer 0502
Dell 413c
Foxconn 0489
Garmin-Asus 091E
HTC 0bb4
Huawei 12d1
Kyocera 0482
LG 1004
Motorola 22b8
Nvidia 0955
Pantech 10A9
Samsung 04e8
Sharp 04dd
Sony Ericsson 0fce
ZTE 19D2
-------------------------------------------------------------------------------------------------------------

My shiny new Google Nexus One wasn’t connecting properly over USB to my Ubuntu 9.10 (Karmic) notebook using the Android SDK.  Here’s how I fixed it.

After a few days of debating whether or not to buy a Nexus One, I finally gave in a bought one.  Rachael ended up getting a Droid Eris (Verizon) for Christmas, so in the course of a few weeks I gained access to two fantastic Android-powered phones.  I had been compiling a list of mobile application ideas and the fact that I now have the hardware to test on motivated me to start looking into Android development.

After getting the Android SDK setup I needed to connect my N1 and push an application to it for testing on real hardware.  I found some Android documentation that discussed connecting up an Android device over USB.  However, after following the steps on this page, I was still seeing strange output when running adb devices:
List of devices attached
????????????    no permissions

This led to some searching which turned up a blog post.  Basically, the Google Android team hasn’t added the Vendor ID for the Nexus One.  Apparently HTC’s USB Vendor ID isn’t correct.  So, I followed these steps to fix it:

  1. Create/edit a udev rules file:
    sudo vim /etc/udev/rules.d/51-android.rules
  2. Add the following line to this file:
    SUBSYSTEM=="usb", SYSFS{idVendor}=="18D1", MODE="0666"
    (Note the vendor ID of 18D1. This was changed from the HTC vendor code of 0BB4.)
  3. Restart udev using either
    sudo reload udev
    or
    sudo service udev reload
  4. Connect your Nexus One.
  5. Run
    adb devices
    and you should see something like
    List of devices attached
    ############ device

Hopefully Google updates the documentation to include the Vendor ID 18D1 rather than making us hunt for this number ourselves.  Enjoy!

--------------------------------------------------------------------------------------------------------------------

ubuntu无法识别android手机相关推荐

  1. ubuntu下设置Android手机驱动

    如果下面的文章不好使,建议读一这个文章:http://forum.xda-developers.com/xperia-u/general/howto-usb-connection-to-ubuntu- ...

  2. 【问题解决】解决eclipse不识别Android手机的问题

    [问题&解决]解决eclipse不识别Android手机的问题 参考文章: (1)[问题&解决]解决eclipse不识别Android手机的问题 (2)https://www.cnbl ...

  3. Ubuntu配置连接android手机

    在Ubuntu系统中,默认情况下一般用户是不能直接访问USB设备的.因此,为了能够让Ubuntu连接上android手机,我们需要做一定的配置.以下介绍几种配置的方法. 方法一 android官方网站 ...

  4. 识别Android手机并检测驱动

    这是一篇流水账,只是讲下识别Android手机的思路.也许不是最好的办法,但是是可行的. 枚举USB控制器,得到每个USB设备的信息,主要是获取Vendor.Product和SerialNumber ...

  5. win10识别android,修复:Win10无法识别Android手机

    所以说到智能手机,我们都知道Android设备是最好的和最受欢迎的设备之一. 对于PC而言,Windows是可靠且流行的操作系统. 我们需要在Android设备和Windows 10 PC之间建立连接 ...

  6. adb 51 android.rules,使用51-android-rules解决ubuntu上不识别 android手机的问题

    此文系转载:http://blog.sina.com.cn/s/blog_96a11ddf0101t56b.html 首先我们在编译完一个项目后,在项目的输出档中将会有一个adb文件 /out/hos ...

  7. 关于android开发工具无法识别android手机的情况总结

     1.手机内部状态出了问题.一般来说,重新打开"USB调试"就可以解决这个问题,但是有时需要重启手机或PC才行. 2.USB供电不足.如果是这个原因,那么就需要更换USB连接线或者 ...

  8. 如何修改软件识别android手机型号

    今天看到QQ空间里别人发的心情下面显示发自手机iphone6,于是好奇QQ空间是如何识别手机型号的,经过百度发现.原来android手机System/build.prop文件可以实现修改手机型号的功能 ...

  9. Win7 PC无法识别android手机 / adb interface有黄色感叹号

    今天公司停电,因此把安卓项目带回宿舍做.宿舍的笔记本,装的是Win7 x64,手机连上电脑后,windows可以识别,但Eclipse的DDMS中却无法识别,什么都没有: 然后打开设备管理器查看,发现 ...

最新文章

  1. 使用crontab自动化调度jupyter notebook定时运行
  2. 【Android 插件化】Hook 插件化框架 ( 加载插件包资源 )
  3. android单选按钮空值,Android的 - 空指针异常的对话与单选按钮
  4. 解决audio自动播放无效问题
  5. Centos7安装、卸载、使用Docker
  6. 解读:计数器Counter
  7. js时间搓化为今天明天_做猪皮冻,记住“泡一泡,刮一刮,搓一搓”,皮冻晶莹剔透无异味...
  8. bzoj 3895: 取石子(博弈)
  9. python处理xps文件_如何在Windows 10系统中处理XPS文件
  10. C语言面试题---函数(一)
  11. U-BOOT 下载 GitHub
  12. 马哈蒂尔:马云思维超前于时代,阿里巴巴能助力马来西亚重回正轨
  13. python houdini_Houdini Python开发实战 课程笔记
  14. 变革:区块链上的政府和企业应用
  15. Automation Anywhere A360 Advance Certified认证 RPA Professional 真题和详细攻略
  16. 美食广场标杆品牌大食代积极布局中国西南市场
  17. socket主要函数说明
  18. 计算其标准体重c语言,C语言第三天
  19. 后端开发实践系列——Spring Boot项目模板
  20. 群表示论之用诱导表示求D4和Q8的不可约表示

热门文章

  1. python 倒数两列_相机标定之张正友标定法数学原理详解(含python源码)
  2. 工业机器人介绍及机器人学概述
  3. python 容联云测试短信接口
  4. Cardboard 凝视
  5. 2022年全球与中国视频显示控制器行业发展趋势及投资战略分析报告
  6. 核磁共振 Nuclear Magnetic Resonance (NMR), H1-NMR, C13-NMR, DEPT, COSY 等分析技术
  7. 使用同步锁来实现线程安全---生产者与消费者
  8. iOS之深入解析Memory内存
  9. css_radius-corner语法分析
  10. opencv各lib库的功能