手機adb shell問題

2021-08-28 10:35:25 字數 1544 閱讀 4093

今天在linux下連線平板usb,試用adb shell時出現error: insufficient permissions for device,

而且我們輸入adb devices顯示:

xxnan@xxnan-pt:~$ adb devices

list of devices attached 

????????????    device

那麼我們怎麼解決它呢?

首先在終端檢視usb的id,輸入lsusb命令,我們可以看到我們剛插如usb的id號,如:

xxnan@xxnan-pt:~$ lsusb

bus 001 device 001: id 1d6b:0002 linux foundation 2.0 root hub

bus 002 device 001: id 1d6b:0002 linux foundation 2.0 root hub

bus 001 device 002: id 8087:0020 intel corp. integrated rate matching hub

bus 002 device 002: id 8087:0020 intel corp. integrated rate matching hub

bus 001 device 003: id 0461:4d80 primax electronics, ltd 

bus 001 device 004: id 1c7a:0801 lightuning technology inc. fingerprint reader

bus 002 device 003: id 5986:0190 acer, inc 

bus 001 device 019: id 0bb4:0c02 high tech computer corp. dream / adp1 / g1 / magic / tattoo (debug)

紅色的就是我們插入usb的id號。

那麼我們進入到cd /etc/udev/rules.d/下,新建乙個51-android.rules檔案(sudo  vim  51-android.rules),在這個檔案中寫上:

subsystem=="usb", attrs==" 0bb4", attrs=="0c02",mode="0666"

儲存,再為51-android.rules加上許可權(sudo chmod a+x 51-android.rules).

拔掉usb重新插上就可以了,如:

xxnan@xxnan-pt:~$ adb devices

list of devices attached 

ab100607    device

這樣就解決了不能識別usb的問題

target連上ubuntu,打adb shell後出現insufficient permissions for device錯誤 

解決辦法:用root許可權 

cmd**  

sudo -s  

adb kill-server  

adb devices  

ubuntu 下解決android ddms連線permissions問題

adb shell 手機按鍵模擬命令

比如使用adb shell input keyevent命令,不同的 keycode 能實現不同的功能,完整的 keycode 列表詳見 keyevent 摘引部分我覺得有意思的如下 keycode含義3 home 鍵 4返回鍵 5開啟撥號應用 6結束通話 24增加音量 25降低音量 26電源鍵 2...

root後adb shell許可權問題

1adb shell su c sleep 1 2adb start server 3adb push tcpdump data local tcpdump adbd insecure 超級adbd 說明 1.開啟adbd,勾選啟動超級adbd,這樣就可以直接有root許可權執行adb shell命...

使用adb shell 遇到小問題

寫了乙個有while的指令碼,push到android上,sh filename 執行各種報錯,折騰了一晚上。詭異的地方在於 相同的 複製貼上到命令列執行時正常的,但是sh filename 是,就是各種報錯,不是while 有問題,就是done有問題 syntax error done unexp...