原文: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
最新文章
苹果手机锁屏密码忘了怎么办?帮您解决难题苹果手机忘记密码「苹果手机锁屏密码忘了怎么办?帮您解决难题」
苹果手机锁屏密码忘了怎么办?大家都知道,苹果手机的安全性比较高,由于它拥有非常安全的密码,可以有效保障用户隐私安装。然而
定档6月20至22日,华为开发者大会在松山湖召开
华为邀您共赴东莞松山湖,在这一舞台上与全球开发者一起,用代码编织智慧时代的经纬。华为官方宣布,华为开发者大会2025将于6月2
2月运动户外品牌TOP15,用户为探险生活方式买单|世研消费指数品牌榜
本次监测周期内,李宁、阿迪达斯和耐克以1.90、1.87、1.80的综合热度位列榜单综合热度前三。李宁、耐克、lululemon三大品牌通过
小说阅读大全免费版手机阅读软件「小说阅读大全免费版」
《小说阅读大全免费版》是一款免费的阅读软件,提供海量小说资源,包括言情、玄幻、修仙、武侠等多种类型,满足用户的不同阅读需
华为智能手表怎么连接蓝牙智能手表如何连接手机「华为智能手表怎么连接蓝牙」
华为智能手表作为现代智能穿戴设备的代表,凭借其丰富的功能和便捷的操作,赢得了众多消费者的青睐。其中,蓝牙连接功能更是智能
湖南零陵:高山野生茶叶成为村民致富“金叶子”
青山吐新绿,又闻新茶香。近日,在湖南永州市零陵区邮亭圩镇大木源村海拔米的高山之上,数十名茶农穿梭在茂密的茶树林间,她们轻
小S大女儿elly纪念姨妈大S:最亮的那一颗,总让我多看一眼
大S离世小S全家至今没能走出阴影,徐妈黄春梅透露具俊晔每天都到金宝山“探望”女儿,陪女儿说话。时间的推移,只会让思念越来越
小鹏G9电动遮阳帘众筹计划达成:即刻研发 众筹价1599元
快科技4月17日消息,官方表示,智能电动遮阳帘众筹升级计划目标已达成。小鹏即刻启动研发动作,将尽快推进交付给车主,限时众筹
我i科大诗歌本手机版下载安装「我i科大」
我i科大为校园的生活提供服务,能够解决师生的各种问题,帮助师生清楚的了解校园里的公告信息,在线就能够快速的进行使用,
谁把日本料理捧上神坛?
撰文 | 魏水华头图 | canva2013年12月,联合国教科文组织将“和食”列入人类非物质文化遗产名录。在新闻发布会上,日本代表用金
推荐文章
相关文章