---
title: "linux下android的开发正确识别真机调试"
author: "007007jing"
date: "2012-07-04T17:53:51Z"
tags: ["API", "Android", "demo"]
categories: ["移动开发"]
slug: "linux-android"
draft: false
lastmod: "2012-07-12T08:35:05Z"
id: 1576863
url: "https://007007jing.iteye.com/blog/1576863"
---

linux下不需要安装驱动，只需要配置相应的规则就可以。

首先、确定手机usb连接正常并开启开发调试功能，在linux下使用／sbin／isusb查看usb连接状态：

```
[root@localhost angie]# /sbin/lsusb
Bus 001 Device 005: ID 18d1:4e12 Google Inc. Nexus One Phone (Debug)
Bus 001 Device 001: ID 0000:0000  
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 004: ID 045e:078c Microsoft Corp. 
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 0000:0000  
Bus 002 Device 003: ID 0461:4d81 Primax Electronics, Ltd 
```

 第一行显示的就是我的手机usb连接的信息 id: 18d1:4e12  记住这个后面需要用到

其次、创建规则文件

```
[root@localhost angie]# vi /etc/udev/rules.d/50-android.rules
／／内容
SUBSYSTEM=="usb",SYSFS{idVendor}=="18d1", MODE="0666"
```

 根据自己的手机的id修改4e12这个地址。重新启动udev

```
[root@localhost angie]# /sbin/udevd restart
```

 最后到sdk的目录中

```
[root@localhost platform-tools]# ./adb kill-server
[root@localhost platform-tools]# ./adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
[root@localhost platform-tools]# ./adb devices
List of devices attached 
HT08WP802156    offline
```

 正确识别出手机，现在可以代开eclipse真机调试了。。