原文: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
最新文章
opporeno5怎么恢复出厂设置 opporeno5恢复出厂设置教程oppo手机如何恢复出厂设置「opporeno5怎么恢复出厂设置 opporeno5恢复出厂设置教程」
如何在OPPO Reno 5上进行出厂设置的还原?许多用户可能对此感到困惑。接下来我们将提供详细的步骤指南。1. 打开手机并进入“设置
智慧桌面也太好用了吧!vivo手机这个神技能你get到了吗?卡片手机「智慧桌面也太好用了吧!vivo手机这个神技能你get到了吗?」
近几年VIVO手机可谓是飞速发展,其品牌产品不仅丰富多样,黑科技也是层出不穷,因此深受消费者喜爱。vivo手机除了万众皆知优秀的
OPPO们想把手机卖得更贵 本土供应链资源争夺战加剧手机供应商「OPPO们想把手机卖得更贵 本土供应链资源争夺战加剧」
原标题:OPPO们想把手机卖得更贵,本土供应链资源争夺战由此加剧 来源:第一财经周刊 中国手机市场的晴雨表就在深圳华
华为nova6、小米9Pro和IQOOPro,都是5G手机咋选?小米9手机「华为nova6、小米9Pro和IQOOPro,都是5G手机咋选?」
小米9 Pro(8GB/256GB/全网通/5G版)vivo iQOO Pro(8GB/256GB/5G全网通)小米9 Pro(12GB/256GB/全网通/5G版)华为nova 6 5G(8
南部战区组织直属单位“两支队伍”专题培训
近日,南部战区组织为期3天的直属单位“两支队伍”专题培训,基层党支部保卫委员、思想工作骨干和营(连)主官、分队长共同参加
安卓手机手电筒在哪里手机手电筒在哪里打开「安卓手机手电筒在哪里」
在智能手机日益普及的今天,手电筒功能已成为安卓手机中不可或缺的一项实用工具。无论是夜晚行走、寻找遗失物品,还是在光线不足
新年新手机?几乎零差评,看看!新上市的手机「新年新手机?几乎零差评,看看!」
安卓旗舰机的市场上可谓是风起云涌呀,各大品牌新机纷纷上市,属实是让人难以抉择。不过大家放轻松,今天我就给大家盘一盘这些新
沉迷于玩手机很伤身 带来4大危害让你害怕玩手机的危害「沉迷于玩手机很伤身 带来4大危害让你害怕」
说到手机现在发展的也是非常的迅速,它由以前的老年机到如今人人都有的智能机可谓是越来越先进,越来越让人爱不释手,因此现在不
(乡村行·看振兴)浙江武义深耕“茶+”经济 山间翠色促农增收
中新网金华4月8日电(董易鑫 陈芮)春深四月,“中国有机茶之乡”——浙江省金华市武义县的12.58万亩茶园正值采制黄金期。
赵佳臻主导推出千亿扶持计划,未来三年拼多多拟投入资源超千亿元
(图片来源:)公司情报专家《财经涂鸦》获悉,4月3日,拼多多“商家权益保护委员会”(以下简称“商保会”)宣布,平台将推出重
推荐文章
相关文章