Android 디버그 브리지 (adb) 기기-권한 없음 [중복]
이 질문에는 이미 답변이 있습니다.
디버깅 모드에서 HTC Wildfire A3333을 Fedora Linux 17과 연결하는 데 문제가 있습니다. Adb는 다음과 같이 말합니다.
./adb devices
List of devices attached
???????????? no permissions
내 udev 규칙 (Samsung의 첫 번째 규칙은 제대로 작동하고 HTC의 두 번째 규칙은 그렇지 않음) :
SUBSYSTEM=="usb",SYSFS{idVendor}=="04e8",SYMLINK+="android_adb",MODE="0666",GROUP="plugdev"
SUBSYSTEM=="usb",SYSFS{idVendor}=="0bb4",SYMLINK+="android_adb",MODE="0666",GROUP="plugdev"
삼성 기기의 경우 모든 것이 정상입니다.
./adb devices
List of devices attached
00198a9422618e device
나는 운 좋게도 simmilar 스레드에서 주어진 모든 답변을 시도 해왔다 : 안드로이드 개발을 위해 HTC 산불 사용하기
방금 Debian Wheezy 에서이 문제가 발생했습니다. sudo를 사용하여 adb 데몬을 다시 시작했습니다.
sudo ./adb kill-server
sudo ./adb start-server
sudo ./adb devices
모든 것이 작동합니다 :)
이 문제의 원인은 시스템 권한과 관련이 있습니다 (이 제안에 대해 @ IsaacCisneros에게 감사드립니다). 어쨌든 HTC Wildfire (및 기타)는 시스템에서 삼성 장치보다 더 많은 것을 필요로합니다. 간단한 해결책은 이클립스를 루트로 실행하는 것이지만 Fedora와 같은 비 Sudo Linux 시스템에는 적합하지 않습니다.
동일한 목표를 달성하는 또 다른 방법을 찾았습니다.이 방법은보다 사용자 친화적이며 수퍼 유저 권한으로 전체 IDE를 실행하는 것보다 보안 구멍이 적습니다. 이것은 여전히 문제의 해결 방법 일뿐입니다. 시스템 루트 사용은 관리 작업으로 만 최소화해야하며 "adb"는 SUID없이 일반 사용자 계정과 작동하도록 설계되었습니다. SUID의 올바른 설정이 상당히 안전하다는 사실에도 불구하고 모든 단일 권한 증가는 잠재적 인 시스템 보안 허점입니다.
1. adb 바이너리 (소유자 – 루트, 소유자 그룹-user_group)의 소유권 설정 :
chown root:user_group adb
2. SUID로 권한 설정 :
chmod 4550 adb
결과는 다음과 유사합니다 (ls -llh).
-r-sr-x---. 1 root user_name 1.2M Jan 8 11:42 adb
그 후에는 일반 사용자 계정을 사용하지만 adb를 루트로 실행할 수 있습니다. 일반 사용자로 Eclipse를 실행할 수 있으며 HTC가 올바르게 감지되어야합니다.
./adb devices
List of devices attached
HT0BPPY15230 device
비슷한 문제가 있습니다.
$ adb devices
List of devices attached
4df15d6e02a55f15 device
???????????? no permissions
조사
를 실행하면 lsusb
연결 한 장치와 위치를 확인할 수 있습니다.
$ lsusb
...
Bus 002 Device 050: ID 04e8:6860 Samsung Electronics Co., Ltd GT-I9100 Phone ...
Bus 002 Device 049: ID 18d1:4e42 Google Inc.
이것은 나의 보여주는 삼성 갤럭시 S3 내 넥서스 7 (2012) 에 연결합니다.
해당 권한을 확인하십시오.
$ ls -l /dev/bus/usb/002/{049,050}
crw-rw-r-- 1 root root 189, 176 Oct 10 10:09 /dev/bus/usb/002/049
crw-rw-r--+ 1 root plugdev 189, 177 Oct 10 10:12 /dev/bus/usb/002/050
기다림. 뭐? "plugdev"그룹은 어디에서 왔습니까?
$ cd /lib/udev/rules.d/
$ grep -R "6860.*plugdev" .
./40-libgphoto2-2.rules:ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="6860", \
ENV{ID_GPHOTO2}="1", ENV{GPHOTO2_DRIVER}="proprietary", \
ENV{ID_MEDIA_PLAYER}="1", MODE="0664", GROUP="plugdev"
./40-libgphoto2-2.rules:ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="6860", \
ENV{ID_GPHOTO2}="1", ENV{GPHOTO2_DRIVER}="proprietary", \
ENV{ID_MEDIA_PLAYER}="1", MODE="0664", GROUP="plugdev"
(나는 그 줄을 감쌌다)
GROUP="plugdev"
줄을 참고하십시오 . 또한 다른 기기 ID에서는 작동하지 않습니다.
$ grep -Ri "4e42.*plugdev" .
(아무것도 반환되지 않습니다)
그것을 고치기
OK. So what's the fix?
Add a rule
Create a file /etc/udev/rules.d/99-adb.rules
containing the following line:
ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4e42", ENV{ID_GPHOTO2}="1",
ENV{GPHOTO2_DRIVER}="proprietary", ENV{ID_MEDIA_PLAYER}="1",
MODE="0664", GROUP="plugdev"
This should be a single line, I've wrapped it here for readability
Restart udev
$ sudo udevadm control --reload-rules
$ sudo service udev restart
That's it
Unplug/replug your device.
Try it
$ adb devices
List of devices attached
4df15d6e02a55f15 device
015d2109ce67fa0c device
You udev rule seems wrong. I used this and it worked:
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
(ATTR
instead of SYSFS
)
under ubuntu 12.04, eclipse juno. I face the same issue. This what I found on Yi Yu Blog
The solution is same as same as Leon
sudo -s
adb kill-server
adb start-server
adb devices
Stephan's answer works (using sudo adb kill-server), but it is temporary. It must be re-issued after every reboot.
For a permanent solution, the udev config must be modified:
Witrant's answer is the right idea (copied from the official Android documentation). But it's just a template. If that doesn't work for your device, you need to fill in the correct device ID for your device(s).
lsusb
Bus 001 Device 002: ID 05c6:9025 Qualcomm, Inc.
Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
...
Find your android device in the list.
Then use the first half of the ID (4 digits) for the idVendor (the last half is the idProduct, but it is not necessary to get adb working).
sudo vi /etc/udev/rules.d/51-android.rules
and add one rule for each unique idVendor:
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666", GROUP="plugdev"
It's that simple. You don't need all those other fields given in some of the answers. Save the file.
Then reboot. The change is permanent. (Roger shows a way to restart udev, if you don't want to reboot).
...the OP’s own answer is wrong in so far, that there are no “special system permissions”. – The “no permission” problem boils down to ... no permissions.
Unfortunately it is not easy to debug, because adb makes it a secret which device it tries to access! On Linux, it tries to open the “USB serial converter” device of the phone, which is e.g. /dev/bus/usb/001/115 (your bus number and device address will vary). This is sometimes linked and used from /dev/android_adb.
lsusb
will help to find bus number and device address. Beware that the device address will change for sure if you re-plug, as might the bus number if the port gets confused about which speed to use (e.g. one physical port ends up on one logical bus or another).
An lsusb-line looks similar to this: Bus 001 Device 115: ID 4321:fedc bla bla bla
lsusb -v
might help you to find the device if the “bla bla bla” is not hint enough (sometimes it does neither contain the manufacturer, nor the model of the phone).
Once you know the device, check with your own eyes that ls -a /dev/bus/usb/001/115
is really accessible for the user in question! Then check that it works with chmod
and fix your udev setup.
PS1: /dev/android_adb can only point to one device, so make sure it does what you want.
PS2: Unrelated to this question, but less well known: adb has a fixed list of vendor ids it goes through. This list can be extended from ~/.android/adb_usb.ini, which should contain 0x4321 (if we follow my example lsusb line from above). – Not needed here, as you don’t even get a “no permissions” if the vendor id is not known.
Changing the USB Mode from phone did the trick for me. (I set it to File Transfer)
I'll prepend this postscript here at the top so it won't get lost in my earlier explanation.
I can reliably produce and resolve the no-permissions problem by simply changing the USB connection type from Camera (PTP) to Media device (MTP). The camera mode allows debugging; the media mode causes the no-permissions response in ADB.
The reasoning seems pretty evident after reflecting on that for a moment. Unsecured content on the device would be made accessible by the debugger in media server mode.
===========
The device is unpermissioned until you accept the RSA encryption warning on the debugged device. At some point after connecting, the device will ask to accept the debugging connection. It's a minimal security protocol that ensures you can access the device beyond the initial swipe lock. Developer mode needs to be enabled, I believe.
The "no permissions" flag is actually a good first indicator that adb recognizes the device as a valid debugging target. Notice that it doesn't list your other USB devices.
Details at the following and related pages.
http://developer.android.com/tools/device.html
Same problem with Pipo S1S after upgrading to 4.2.2 stock rom Jun 4.
$ adb devices
List of devices attached
???????????? no permissions
All of the above suggestions, while valid to get your usb device recognised, do not solve the problem for me. (Android Debug Bridge version 1.0.31 running on Mint 15.)
Updating android sdk tools etc resets ~/.android/adb_usb.ini
.
To recognise Pipo VendorID 0x2207 do these steps
Add to line /etc/udev/rules.d/51-android.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="0x2207", MODE="0666", GROUP="plugdev"
Add line to ~/.android/adb_usb.ini
:
0x2207
Then remove the adbkey files
rm -f ~/.android/adbkey ~/.android/adbkey.pub
and reconnect your device to rebuild the key files with a correct adb connection. Some devices will ask to re-authorize.
sudo adb kill-server
sudo adb start-server
adb devices
I encountered the same problem today.
I followed the official instructions, but I didn't noticed that I SHOULD run command
"chmod a+r /etc/udev/rules.d/51-android.rules"
After I set this file to world readable and re-plug my usb cable,the status became unauthorized. Then just grant the permission and everything goes fine.
Had the same issue. It was a problem with udev rules. Tried a few of the rules mentioned above but didnot fix the issue. Found a set of rules here, https://github.com/M0Rf30/android-udev-rules. Followed the guide there and, voila, fixed.
I agree with Robert Siemer and Michaël Witrant. If it's not working, try to debug with strace
strace adb devices
In my case it helps to kill all instances and remove socket file /tmp/ADB_PORT
(the default is /tmp/5037
).
Another possible source of this issue is USB tethering. If you have used USB tethering, turn it off, then unplug the device from USB, plug it back in, then do
adb kill-server
adb devices
That did the trick in my case (Ubuntu 12.04, Nexus S, SDK in home dir, never needed root to get it running). Depending on your device, you may need to run adb devices
as root, though.
Try "android update adb" command. It helps me with samsung galaxy gear.
The output of ls -al /usr/bin/adb
should show that it is owned by user root
and group root
. You can use Linux ACL (Access Control Lists) to give your local user permissions for adb
as follows:
setfacl -m "u:userName:rwx" /usr/bin/adb
This is preferable to setting the SUID bit on /usr/bin/adb
and also limits the users who can use adb
to userName and root.
The answer is weaved amongst the various posts here, I'll so my best, but it looks like a really simple and obvious reason.
1) is that there usually is a "user" variable in the udev rule some thing like USER="your_user" probably right after the GROUP="plugdev"
2) You need to use the correct SYSFS{idVendor}==”####″ and SYSFS{idProduct}=="####" values for your device/s. If you have devices from more than one manufacture, say like one from Samsung and one from HTC, then you need to have an entry(rule) for each vendor, not an entry for each device but for each different vendor you will use, so you need an entry for HTC and Samsung. It looks like you have your entry for Samsung now you need another. Remember the USER="your_user". Use 'lsusb' like Robert Seimer suggests to find the idVendor and idProduct, they are usually some numbers and letters in this format X#X#:#X#X I think the first one is the idVendor and the second idProduct but your going to need to do this for each brand of phone/tablet you have.
3) I havent figured out how 51-adb.rules and 99-adb.rules are different or why.
4) maybe try adding "plugdev" group to your user with "usermod -a -G plugdev your_user", Try that at your own risk, though I don't thinks it anyriskier than launching a gui as root but I believe if necessary you should at least use "gksudo eclipse" instead.
I hope that helped clearify some things, the udev rules syntax is a bit of a mystery to me aswell, but from what I hear it can be different for different systems so try some things out, one ate a time, and note what change works.
Close running
adb
, could be closing running android-studio.list devices,
/usr/local/android-studio/sdk/platform-tools/adb devices
On THL W100 running the device as root (as described above) worked only together with tethering enabled (I used AirDroid for that).
I had the same situation where three devices connected to one same host but only one had 'no permissions' others were online.
Adding SUID or SGID on adb was another issue for me. Devices seen offline every time adb restarts - until you acknowledge on the devices every time.
I solved this 'no permissions' issue by adding 'o+w' permission for a device file.
chmod o+w /dev/bus/usb/00n/xxx
참고URL : https://stackoverflow.com/questions/14460656/android-debug-bridge-adb-device-no-permissions