原文:http://esausilva.com/2010/05/13/setting-up-adbusb-drivers-for-android-devices-in-linux-ubuntu/
If you are like me and like developing in Linux, then you will find this guide useful. When I was setting up everything for my Android development, I ran into the problem that Linux was not recognizing my Android phone, and took me some time figuring out how to make Linux recognize my phone. Finally, after some research I was able to put this little guide together and decided to share it with the rest of the world.
ADB (Android Debug Bridge) is a handy tool that comes with Android SDK that allows you to control and interface with your Android device.
Update: 02/04/11 – HTC changed its Vendor ID, older phones have different ID than newer phones. Refer to USB Vendor IDs table at the bottom of this tutorial to see the change.
Update: 01/02/11 – By mistake I had linked the ADB tool for OSX in step 3.1. Now it should be the correct one for Linux.
IMPORTANT Update 12/11/10 – There has been a change to the new Android SDK. ADB Tool has been moved to /android-sdk-linux_x86/plataform-tools, so if you have the old SDK, please download the new one and update your path (Step 9.2 of this tutorial). If this is your first time doing this, then disregard the update and continue with the tutorial.
Update: 09/21/10 – Working code with Ubuntu Lucid Lynx and added more USB vendor IDs.
1. Download the latest Android SDK from Google: Android SDK
2. Extract the TGZ file to your home/YOUR-USERNAME directory
3. To get ADB, you need to install the SDK: Installing the SDK
* If you are not a developer and not planning to develop, then just download the following zip file containing only the ADB tool and proceed with the tutorial: ADB
4. On your phone, click Settings > Applications > Development and make sure USB Debugging is on.
5. Login as root and create this file: /etc/udev/rules.d/##-android.rules
NOTE: In the above file replace ## with the number 50 if you are running Gusty/Hardy/Dapper (50-android.rules) or with the number 70 if you are running Karmic Koala/Lucid Lynx/Maverick Meerkat(70-android.rules)
* Or simply type in terminal sudo gedit /etc/udev/rules.d/##-android.rules then enter your password
6. The file should read:
* For Gusty/Hardy: SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb", MODE="0666"
* For Dapper: SUBSYSTEM==”usb_device”, SYSFS{idVendor}==”0bb4″, MODE=”0666″
* For Karmic Koala: SUBSYSTEM==”usb”, SYSFS{idVendor}==”0bb4″, MODE=”0666″
* For Lucid Lynx: SUBSYSTEM==”usb”, SYSFS{idVendor}==”0bb4″, MODE=”0666″
* For Maverick Meerkat: SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"
NOTE: In the above lines the code ”0bb4″ refers to a HTC device. If your phone is from a different manufacturer, replace the code with the appropriate from the table below.
NOTE: If you copy one of the lines mentioned above, make sure you replace the quotation marks with the ones in your keyboard, as these have different display code and it might give you a “no permissions” error.
7. Execute: sudo chmod a+rx /etc/udev/rules.d/70-android.rules
8. Reboot
9. To run ADB you need to add an environment variable to your bashrc file:
* Open a terminal window and type: sudo gedit .bashrc
* Add the following line at the end: export PATH=${PATH}:/home/YOUR-USERNAME/android-sdk-linux_x86/platform-tools
* Save and close
10. You should be ready to go, type adb devices in a terminal window with your phone plugged in.
If you see a serial number pop up that means you are done. Should look something like this:
List of devices attached
HT99PHF02521 device
11. If for some reasons when running adb devices gives you a “no permissions” error, try typing the following in terminal
* adb kill-server
* adb start-server
USB Vendor IDs
Manufacturer USB Vendor ID
Acer 0502
Dell 413c
Foxconn 0489
Garmin-Asus 091E
HTC (Older Phones) 0bb4
HTC (Newer phones) 18d1
Huawei 12d1
Kyocera 0482
LG 1004
Motorola 22b8
Nexus One/S 18d1
Nvidia 0955
Pantech 10A9
Samsung 04e8
Sharp 04dd
Sony Ericsson 0fce
ZTE 19D2
Common ADB Commands
- Lists which devices are currently attached to your computer
1.
adb devices
- Drops you into a basic linux command shell on your phone with no parameters, or lets you run commands directly
1.
adb shell
- Lets you install an Android application on your phone
1.
adb install
- Remounts your system in write mode – this lets you alter system files on your phone using ADB
1.
adb remount
- Rets you upload files to your phones filesystem
1.
adb push
- Lets you download files off your phones filesystem
1.
adb pull
- Starts dumping debugging information from your handset to the console – useful for debugging your apps
1.
adb logcat
Now, as for the credits, I took TheUnlockr “How To” for Windows as a base for this guide.
If you liked this tutorial, please retweet and/or share
注: rules 文件中的双引号需手动改。
我的是motorola ID是22b8
If you are like me and like developing in Linux, then you will find this guide useful. When I was setting up everything for my Android development, I ran into the problem that Linux was not recognizing my Android phone, and took me some time figuring out how to make Linux recognize my phone. Finally, after some research I was able to put this little guide together and decided to share it with the rest of the world.
ADB (Android Debug Bridge) is a handy tool that comes with Android SDK that allows you to control and interface with your Android device.
Update: 02/04/11 – HTC changed its Vendor ID, older phones have different ID than newer phones. Refer to USB Vendor IDs table at the bottom of this tutorial to see the change.
Update: 01/02/11 – By mistake I had linked the ADB tool for OSX in step 3.1. Now it should be the correct one for Linux.
IMPORTANT Update 12/11/10 – There has been a change to the new Android SDK. ADB Tool has been moved to /android-sdk-linux_x86/plataform-tools, so if you have the old SDK, please download the new one and update your path (Step 9.2 of this tutorial). If this is your first time doing this, then disregard the update and continue with the tutorial.
Update: 09/21/10 – Working code with Ubuntu Lucid Lynx and added more USB vendor IDs.
1. Download the latest Android SDK from Google: Android SDK
2. Extract the TGZ file to your home/YOUR-USERNAME directory
3. To get ADB, you need to install the SDK: Installing the SDK
* If you are not a developer and not planning to develop, then just download the following zip file containing only the ADB tool and proceed with the tutorial: ADB
4. On your phone, click Settings > Applications > Development and make sure USB Debugging is on.
5. Login as root and create this file: /etc/udev/rules.d/##-android.rules
NOTE: In the above file replace ## with the number 50 if you are running Gusty/Hardy/Dapper (50-android.rules) or with the number 70 if you are running Karmic Koala/Lucid Lynx/Maverick Meerkat(70-android.rules)
* Or simply type in terminal sudo gedit /etc/udev/rules.d/##-android.rules then enter your password
6. The file should read:
* For Gusty/Hardy: SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb", MODE="0666"
* For Dapper: SUBSYSTEM==”usb_device”, SYSFS{idVendor}==”0bb4″, MODE=”0666″
* For Karmic Koala: SUBSYSTEM==”usb”, SYSFS{idVendor}==”0bb4″, MODE=”0666″
* For Lucid Lynx: SUBSYSTEM==”usb”, SYSFS{idVendor}==”0bb4″, MODE=”0666″
* For Maverick Meerkat: SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"
NOTE: In the above lines the code ”0bb4″ refers to a HTC device. If your phone is from a different manufacturer, replace the code with the appropriate from the table below.
NOTE: If you copy one of the lines mentioned above, make sure you replace the quotation marks with the ones in your keyboard, as these have different display code and it might give you a “no permissions” error.
7. Execute: sudo chmod a+rx /etc/udev/rules.d/70-android.rules
8. Reboot
9. To run ADB you need to add an environment variable to your bashrc file:
* Open a terminal window and type: sudo gedit .bashrc
* Add the following line at the end: export PATH=${PATH}:/home/YOUR-USERNAME/android-sdk-linux_x86/platform-tools
* Save and close
10. You should be ready to go, type adb devices in a terminal window with your phone plugged in.
If you see a serial number pop up that means you are done. Should look something like this:
List of devices attached
HT99PHF02521 device
11. If for some reasons when running adb devices gives you a “no permissions” error, try typing the following in terminal
* adb kill-server
* adb start-server
USB Vendor IDs
Manufacturer USB Vendor ID
Acer 0502
Dell 413c
Foxconn 0489
Garmin-Asus 091E
HTC (Older Phones) 0bb4
HTC (Newer phones) 18d1
Huawei 12d1
Kyocera 0482
LG 1004
Motorola 22b8
Nexus One/S 18d1
Nvidia 0955
Pantech 10A9
Samsung 04e8
Sharp 04dd
Sony Ericsson 0fce
ZTE 19D2
Common ADB Commands
- Lists which devices are currently attached to your computer
1.
adb devices
- Drops you into a basic linux command shell on your phone with no parameters, or lets you run commands directly
1.
adb shell
- Lets you install an Android application on your phone
1.
adb install
- Remounts your system in write mode – this lets you alter system files on your phone using ADB
1.
adb remount
- Rets you upload files to your phones filesystem
1.
adb push
- Lets you download files off your phones filesystem
1.
adb pull
- Starts dumping debugging information from your handset to the console – useful for debugging your apps
1.
adb logcat
Now, as for the credits, I took TheUnlockr “How To” for Windows as a base for this guide.
If you liked this tutorial, please retweet and/or share
![](/images/smiles/icon_smile.gif)
注: rules 文件中的双引号需手动改。
我的是motorola ID是22b8
发表评论
-
android 查看 cpu
2012-05-28 10:02 670cat /proc/cpuinfo -
32位系统编译android2.3.4
2011-10-21 09:24 705修改这几个文件,该回到32位编译环境即可: exte ... -
用自己编译后的system.img
2011-10-21 09:24 1112自己编译后的system.img替换掉/home/abc/an ... -
android mk 文件
2011-10-21 09:25 681LOCAL_PATH:= $(call my-dir) in ... -
android编译某个模块
2011-10-21 09:25 1720编译模块 android中的一个应用程序可以单独编译,编译后要 ... -
SQLite
2011-07-20 08:59 3361)创建数据库文件: >SQLite3 d: ... -
android life cycle
2011-07-07 10:42 725There two Activity. 1.First pre ... -
apk的反编译
2011-06-10 10:22 520需要使用的工具: 1. dex2jar:http://c ... -
sdcard in emulator
2011-06-03 14:22 968http://blog.jayway.com/2009/04/ ... -
Human Interface Principles
2011-06-02 09:50 798http://developer.apple.com/libr ... -
全屏显示
2011-05-04 16:09 754//--全屏-->> thi ... -
相关资料链接
2011-04-01 10:41 835android镜像站点:http://developer.an ... -
service 的调用【转】
2011-03-24 09:50 815Service的调用 Context.sta ... -
android笔记和第一个例子的代码
2010-12-24 18:00 15051.android.app.Activity 1) 活 ... -
android学习笔记-1-环境搭建
2010-12-22 09:36 7681.安装JDK1.6,Eclipse3.6 2.安装andr ...
相关推荐
系统:ubuntu 20.04 GPU型号:A10 英伟达驱动:550 CUDA驱动:12.4
把下载的360wifi.tar.gz驱动放在Ubuntu桌面 打开Ubuntu终端,输入cd /home/administrator/Desktop回车 注意:这里的“administrator”是自己的用户名,每个人的一般是不一样的 然后输入tar zxvf wifi.tar.gz回车...
Motorola Android USB Driver for Windows,为了我的Milestone在网上找的,分享给大家。
ubuntu可用的rtl8822be驱动 安装方法请自行百度.sh安装方法
android 手机驱动开发 需要安装的驱动程式
安卓连接小米手机驱动 调试 ADB Driver(小米通用驱动ADB驱动安装包) ,通用安装。ADB Driver是小米手机安卓系统在XP-Win7系统下通用的ADB驱动安装包。支持WINXP/7/8/10 32位或者64位系统。 使用说明 1、通过USB连接...
Android HTC USB Driver,HTC手机USB驱动。
ubuntu18.04 Driver:kernel 5.7.13,linux-firmware1.83 解决ubuntu18.04网卡显卡驱动
RTL8111B/RTL8168B/RTL8111/...所支持的系统如下 LINUX driver for kernel up to 4.7 FreeBSD 7.x and 8.0 SCO Unix 5.0.6 and 5.0.7 Linux driver for kernel 2.4.x (Support x86 and x64) 多个文件。多内核都可以执行
Non PS 驱动程序,适用于Mac10.X OS 操作系统。 注意:当安装Non PS驱动程序时,搜索 ‘FX Print Driver for Mac OS X v1.5' 或直接输入驱动版本 ’1.5‘ 以选择 Non PS 驱动。 然后单击[好]。
ublox 模块安卓驱动 版本为V2.3,支持安卓4.0-4.4
SQL Server 2000 Driver for JDBC SP3驱动,内容:在EClipse中把SQL Server 2000 driver for JDBC安装后生成的三个jar文件加到classpath中的方法、msbase.jar、mssqlserver.jar、msutil.jar三个文件
Android 平台 xp上的USB驱动,用于调试呀
解压后进入目录执行 sudo make install INTERFACE=usb
1)按上述地址下载驱动包; 2)将DLL文件解压到 PHP extension dir 目录 extension dir "X: PHP ext" 3)在php ini配置文件内引用相应的动态链接库文件 extension php sqlsrv 52 ts vc6 dll ...
EC20 Pcie 4G模块,在ubuntu 16.04 kernel 4.15 版本以上。驱动编译不成功。 Quectel_WCDMA<E;_Linux&Android;_GobiNet_Driver_V1.3.0 里面的内核文件比较旧,只能适配到kernel 4.05 版本。 ubuntu 16.04 kernel ...
英特尔Android安卓设备USB驱动是英特尔专为安卓手机打造的一款驱动程序,安装驱动后可将手机连接电脑,进行文件传输、共享、下载等功能,欢迎下载!英特尔安卓usb驱动简介英特尔AtomZ2460处理器是英特尔公司首款针对...
andorid 2.3 usb driver 手机驱动
android driver.rar
Qt5 mysql driver for Android, libqsqlmysql.so是放在Qt Android mysql driver对应的地方, libmariadb.so添加到项目的Additional Libraries里面