分享好友 最新资讯首页 最新资讯分类 切换频道
android driver for ubuntu 手机驱动android手机驱动「android driver for ubuntu 手机驱动」
2025-02-19 08:49
原文: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 文件中的双引号需手动改。
最新文章
他有4个长寿投资秘诀
近日,95岁的著名投资人沃伦·巴菲特正式退休,从伯克希尔-哈撒韦公司的首席执行官岗位上卸任。 令人惊叹的是,近百岁的巴菲特依
遇到重庆乌江画廊旅游小吃?90%的人都做错了,
别急,今天手把手教你从怀化到重庆乌江画廊的吃喝玩乐全攻略省钱又避坑,不踩雷还能拍大片,
商南“文旅+”激活经济发展新动能|金丝峡|商南县|度假区|乡村旅游_网易新闻
2025年以来,商南县紧扣文旅康养融合发展方向,以项目建设为抓手、以品牌营销为突破、以业态创新为动力,推动文旅产业提档升级,
绍兴市委常委、组织部部长谢国民赴新昌县调研兴村共富链工作_网易新闻
4月17日下午,绍兴市委常委、组织部部长谢国民赴新昌县调研兴村共富链工作,强调要深入贯彻省委王浩书记在绍兴调研讲话精神,聚
向新而生,同“芯”向上,2025英特尔技术创新与产业生态大会在重庆举行
【TechWeb】2025年11月19日,重庆——2025英特尔技术创新与产业生态大会今天在重庆开幕。逾3000名与会嘉宾,包括政府、客户、产
英伟达AMD亮相CES 2026加速硬件进化 万兴科技引领应用层迭代_腾讯新闻
智通财经APP获悉,近日,全球科技盛会2026年国际消费电子展(CES 2026)在美国拉斯维加斯开幕。作为全球最具影响力的消费电子展会
工信部推进“人工智能+制造”行动
2025年12月25日至26日,全国工业和信息化工作会议在北京召开。会议部署2026年重点工作,提出推进“人工智能+制造”专项行动。将
赤沙镇中心小学 一“唱”润心启素养 一“动”启智育新人|学校_网易新闻
为全面贯彻党的教育方针,落实立德树人根本任务,进一步丰富校园文化生活,营造昂扬向上、生动活泼的校园文化氛围,促进学生身心
小字符喷码机什么品牌好?Linx领新通过全行业应用案例,展示品牌实力与价值_腾讯新闻
在现代工业生产与食品加工领域,小字符喷码机作为产品赋码追溯、合规上市的核心设备,其性能稳定性、操作便捷性与场景适配性直接
2025上半年总票房达292.36亿,同比增长22.89%- DoNews快讯
截至2025年6月30日21时,2025上半年(2024年1月1日-6月30日)累计总票房报收292.36亿元,同比增长22.89%。观影人次达到6.40亿,