原文: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
注: rules 文件中的双引号需手动改。
我的是motorola ID是22b8
发表评论
-
android 查看 cpu
2012-05-28 10:02 701cat /proc/cpuinfo -
32位系统编译android2.3.4
2011-10-21 09:24 727修改这几个文件,该回到32位编译环境即可: exte ... -
用自己编译后的system.img
2011-10-21 09:24 1145自己编译后的system.img替换掉/home/abc/an ... -
android mk 文件
2011-10-21 09:25 707LOCAL_PATH:= $(call my-dir) in ... -
android编译某个模块
2011-10-21 09:25 1744编译模块 android中的一个应用程序可以单独编译,编译后要 ... -
SQLite
2011-07-20 08:59 3591)创建数据库文件: >SQLite3 d: ... -
android life cycle
2011-07-07 10:42 754There two Activity. 1.First pre ... -
apk的反编译
2011-06-10 10:22 546需要使用的工具: 1. dex2jar:http://c ... -
sdcard in emulator
2011-06-03 14:22 1004http://blog.jayway.com/2009/04/ ... -
Human Interface Principles
2011-06-02 09:50 827http://developer.apple.com/libr ... -
全屏显示
2011-05-04 16:09 777//--全屏-->> thi ... -
相关资料链接
2011-04-01 10:41 875android镜像站点:http://developer.an ... -
service 的调用【转】
2011-03-24 09:50 846Service的调用 Context.sta ... -
android笔记和第一个例子的代码
2010-12-24 18:00 15491.android.app.Activity 1) 活 ... -
android学习笔记-1-环境搭建
2010-12-22 09:36 8131.安装JDK1.6,Eclipse3.6 2.安装andr ...
相关推荐
压缩包内的两份PDF文档——"Android_GNSS_Driver_v2.3_public_release_notes_(UBX-14038410).pdf"和"Android_GNSS_Driver_Application_note_(UBX-1300136-R04).pdf",分别提供了驱动的发布说明和技术应用指南。...
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 ...
为这些芯片在Linux和Android操作系统上提供合适的驱动程序是至关重要的,因为没有驱动,系统将无法识别和利用无线网卡的功能。 首先,我们来了解一下这两个芯片的区别。RTL8188CUS主要针对USB 2.0接口,而RTL8188...
本主题聚焦于"RM500Q 5G android 驱动",这是一款针对RM500Q 5G模组的Android驱动程序,用于在Android操作系统上实现5G通信功能。以下是对相关知识点的详细说明: 1. **RM500Q 5G模组**:RM500Q是一款高性能的5G...
1. **获取源码**:从官方或第三方仓库获取SR9700的驱动源代码,例如在`sr9700_android_LINUX3.4.5_android4.2.1`这个文件中可能包含驱动源码。 2. **配置内核**:在Linux内核配置阶段,选择SR9700相关的驱动选项,...
在Android系统中,驱动程序是连接硬件设备与操作系统的关键部分,它使得系统能够识别并控制硬件设备,使其能正常工作。本话题主要围绕MT7668驱动在Android系统和Linux内核中的应用进行深入解析。 首先,我们要理解...
在"Mt76x8(7668+7638+7663)driver.rar"压缩包中,包含的源码是这些驱动的实现,开发者可以通过阅读源码了解驱动的实现细节,进行定制化修改或调试。源码的分析和理解可以帮助我们更好地优化无线网络性能,解决兼容性...
此外,有时还需要根据不同的手机品牌(如华为、小米等)下载特定的USB驱动,因为它们可能不使用标准的Android USB驱动。 总的来说,Android Studio找不到真机的问题主要是由于USB驱动未正确安装或更新导致的。通过...
描述中提到的"openNI_2.3.0.55.zip"是一个包含多种平台驱动的压缩包,其中包括安卓(Android)、Windows、Linux以及UVC(Universal Video Class)演示。OpenNI(开源自然交互)是一个开放源代码的框架,它为开发人员...
虽然本文档并未详细展开在Ubuntu环境下为Android系统编写内核驱动程序的过程,但可以简单介绍这一过程的一些基本要点: - **虚拟设备**:“Hello”虚拟设备被用来作为示例,这个设备包含一个4字节的寄存器,可用于...
【Android 平台 GT818 驱动移植详解】 在Android系统中,GT818驱动的移植是一项关键任务,特别是在开发基于特定硬件平台(如华天正科技的Real6410,搭载S3C6410处理器)的设备时。此驱动程序不仅支持多指触控,还能...
- `USB driver for GSM and CDMA modems` 4. 完成配置后,保存并退出。 **2.2.2 增加具体设备驱动** 为了支持特定的NL668产品,还需要修改内核源码文件`option.c`(路径一般为`drivers/usb/serial/option.c`),...
1. **驱动程序(Driver)**: 驱动程序是连接硬件设备与操作系统之间的桥梁,使得操作系统能够识别并控制硬件设备。魅族MX4的驱动程序确保了手机与计算机之间的通信,这对于进行刷机、数据备份或者开发者调试等工作至...
1. **获取USB驱动**:从`Android_Training_Prepare\Release_Demo\usb_driver_atmel.rar`目录下找到。 2. **安装SAM-BA**:SAM-BA是一个用于对SAM MCU进行编程和调试的工具。 #### 构建与部署 完成以上步骤后,即可...
在Android系统中,Rndis驱动通常用于USB Tethering,即通过USB线将手机作为网络热点,提供网络给电脑或其他设备使用。用户只需在手机设置中开启USB tethering,系统就会自动启动Rndis驱动,使得电脑可以通过USB连接...
这种技术基于Remote Network Driver Interface Specification(远程网络驱动接口规范,简称RNDIS),使得Android设备可以模拟成一个网络设备,如以太网卡,从而在没有Wi-Fi或移动数据的情况下,利用电脑的网络连接...
"Android SDK"可能是因为PL2303芯片也常用于Android设备的调试,SDK可能包含了相关的驱动和工具,方便开发者进行设备连接和调试。而"Linux"目录可能包含Linux系统的驱动源码或者编译好的二进制模块,对于需要手动...
本文将详细探讨如何为奕力(Ilitek)触控芯片 ili2511 编写和移植Linux I2C驱动,并在Ubuntu操作系统上的Jetson TX2平台上进行应用。 首先,了解 ili2511 芯片。ili2511 是Ilitek公司生产的一款专用于触摸屏的控制...
pcf8563_i2c1_r8_ruoge_ov2640通过给RTC驱动增加设备节点读取秒钟成功+直接读取I2C1获取秒钟值20160626_2201.7z http://blog.csdn.net/21cnbao/article/details/7919055 在Android源码树中添加userspace I2C读写...
包含: Quectel_EC200T_Linux_USB_Driver_User_Guide_V1.0 Quectel_LTE&5G_Linux_USB_Driver_User_Guide_V2.0 Quectel_Linux_USB_Serial_Option_Driver_V1.0 KBA_EC200&UC200_Linux&Android_USB_driver_移植说明