Linux 에서 adb devices 결과가 no permissions 인경우 해결방법.

Debian Lenny (5.0.3)에서 adb devices 를 했더니…

$ adb devices
List of devices attached
???????????? no permissions

검색을 해보니.. /etc/udev/rules.d/99-android.rules 에 디바이스 정보를 넣으라고 한다.
그러나.. 여전히 no permissions 이다.

좀더 찾아보니…

adb kill-server
adb start-server 를 root 권한으로 실행해보란다.

$ adb kill-server
$ adb start-server
* daemon not running. starting it now *
* daemon started successfully *
$ adb devices
List of devices attached
0403766B11005015 device

잘되네.. ㅡ.ㅡ

eclipse 에서도 application 실행도 잘 된다. :)

매번 저걸 넣기는 귀찮으니.. udev 에 룰을 등록하자.

먼저 장치가 연결될때 실행할 스크립트를 작성하자.

#!/bin/sh

TOOL_DIR=/home/eunchul/apps/android-sdk-linux_86/tools
${TOOL_DIR}/adb kill-server
${TOOL_DIR}/adb start-server

이 파일을 init_motoroi.sh 라 저장하고 적당한 디렉토리에 위치 시킨다. (나는 /home/eunchul/sbin/init_motoroi.sh)
이제는 udev 의 룰을 작성하자.

이 작업은 root 로 해야 한다.

# cd /etc/udev/rules.d
# touch 99-android.rules

99-android.rules 의 내용은..

# android
#

# motoroi
SUBSYSTEM==”usb”,ATTR{idVendor}==”22b8″,ATTR{idProduct}==”41db”,SYMLINK+=”motoroi_adb”,MODE=”0666″,RUN+=”/home/eunchul/sbin/init_motoroi.sh”

ATTR{idVendor} 과 ATTR{idProduct} 의 값은 lsusb 를 했을때 장치의 아이디 값이다.

# lsusb
Bus 007 Device 009: ID 22b8:41db Motorola PCS Motorola Droid (USB Debug)
Bus 007 Device 003: ID 05a9:2640 OmniVision Technologies, Inc. OV2640 Webcam
Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 0461:4d15 Primax Electronics, Ltd Dell Optical Mouse
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 0a5c:4503 Broadcom Corp.
Bus 001 Device 003: ID 0a5c:4502 Broadcom Corp. Keyboard (Boot Interface Subclass)
Bus 001 Device 002: ID 0a5c:4500 Broadcom Corp. BCM2046B1 USB 2.0 Hub (part of BCM2046 Bluetooth)
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

이제는 udev 데몬을 재시작 해주면 된다.

# /etc/init.d/udev restart

이렇게 되면, usb 에 motoroi 가 연결이 될때마다 /home/eunchul/sbin/init_motoroi.sh 를 실행해준다.

참고: Developing on a Device, Nexus One Help Fourm

This entry was posted in android, bash, debian, development, linux and tagged , , , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Spam Protection by WP-SpamFree