原文: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
最新文章
垦利区积极推进“双备案”管理 让流动宴席飘起“安心香”
“以前办喜事找厨子全凭熟人介绍,食材安全心里没底。现在提前备案,社区和市场监管的同志上门指导,吃着踏实!”刚为儿子办完婚
海港区红十字会与秦皇岛市中心血站、海港医院联合开展无偿献血主题党日活动
8月8日上午,海港区红十字会与秦皇岛市中心血站、海港医院共同举办“党建引领献热血 医者仁心显担当”主题党日活动。活动在海港
【受权发布】北京8月15日发布积水内涝蓝色预警
千龙网北京8月15日讯 据北京市突发事件预警信息发布中心最新消息,北京市水务局与市气象局2025年8月15日17时联合发布积水内涝蓝
原创赵露思“先休息钱花完再想办法”
“先休息,钱花完再想办法。”——8月12日,赵露思在直播中轻飘飘甩出这句话,直接点燃热搜。这位常年霸屏的95花突然摆出“躺平
大兴2008年整箱茅台酒全国回收价2024年参考
大兴2008年整箱茅台酒全国回收价2024年参考2007年3月1日,16%,价格为358元,市场零售价在500元左右;2008年1月12日,22%,价格
玉溪出发去林芝七日游,这份攻略你真的不想看?(必看)
玉溪出发去林芝七日游,这份攻略你真的不想看?(必看)你是不是也想过从玉溪出发,一路向西穿越高山峡谷,最终抵达那片神秘的高
新华保险频繁加码金融版图背后:偿付能力持续下滑,投诉激增诉讼高企
证券之星 赵子祥在金融市场的版图中,新华人寿保险股份有限公司(下称“新华保险”)近期动作频频,一边豪掷约43亿入股杭州银行,
国际资讯AI速递:昨夜今晨国际热点一览 丨2025年8月7日
在全球瞬息万变的局势中,重要新闻时刻影响着各国政治、经济与社会发展。我们为您精心盘点昨夜今晨的国际热点事件,带您快速
羊年茅台酒空瓶回收全国收购现价交易
羊年茅台酒空瓶回收收购现价交易 羊年茅台酒瓶回收价格大约600元~~8000元不等,欢迎来电五十年茅台酒瓶(瓶子)回收4000元15年茅
原创杨瀚森在NBA是否能立足?美国记者的新分析引发担忧
经过四场夏季联赛的考察,开拓者队对于杨瀚森的表现做出了积极评价,外界也纷纷称赞他的表现可圈可点。然而,有人认为凭借这几场
推荐文章
相关文章