原文: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 文件中的双引号需手动改。
android driver for ubuntu 手机驱动android手机驱动「android driver for ubuntu 手机驱动」
2025-02-19 08:49
最新文章
2025中国房企综合实力TOP100研究成果发布!
2025年3月14日,亿翰智库重磅发布《2025中国房企综合实力TOP100》。2024年行业仍旧是在深度调整中,可以说已经是超调,原先政策
格力电器:从未委托或授权任何第三方机构受理消费者的售后服务
7月25日,通过官方平台发布声明,明确否认委托任何第三方机构开展售后服务业务。格力电器声明强调:“格力电器从未委托或授权任
央八即将开播!又来16集反特大剧!廖凡、朱珠领衔,要熬夜狂追了
沉寂许久,必将迎来爆发!我敢说,这部剧一播,将要成为“收视率吸取器”,完全榨干当下国产剧收视率大盘。也许有朋友会问,什么
电话营销机器人电话软件
电话营销机器人系统自从进入电销行业,已经成为电销企业必不可少的辅助工具,机器人替代人工筛选客户,每天最少可以拨打3000通电
供应 HC300BF PP 北欧化工
PP HC300BF特性:1.冲击强度:悬壁梁缺口冲击强度:588J/m2.良好的熔体强度,熔流率:05g/10min3.清晰度高,良好的表面光洁度.用途:1
云南省昆明市回收烟酒礼品茅台酒
昆明金尊烟酒回收公司,欢迎来到高价回收烟酒网站,我们位于美丽的春城昆明市。 具体地址是云南省昆明市西山区陆家路怡康温泉新
中秋国庆境内游前瞻:北京仍是最火目的地,热门航线机票价格涨幅环比超4倍
距离中秋国庆假期已不足月,境内游的预订显著增长。9月8日,北京商报记者从多家在线旅游及出行平台、旅行社获悉,中秋国庆假期北
泰康人寿“瘦身”,13家分支机构密集关停
合规问题频发之下,裁撤风波又将如何平息?来源 | 中国保险家杂志泰康人寿的日子越来越不好过了。近期,泰康人寿迎来了机构撤销
上半年保险业保费收入3.7万亿元 6月寿险保费大增21.05%
央广网北京7月29日消息(记者冯方)近日,国家金融监管总局公布6月保险业经营情况。数据显示,上半年保险业实现原保险保费收入(
丁云鹏字画的近期成交价格
此图所绘的列位尊者到底是谁?显着的是降龙罗汉和伏虎罗汉。其他的十六尊者,我们可从宋代苏轼所作的《十八大阿罗汉颂》与《
推荐文章
相关文章