赞
踩
一、把adb的路径配置到环境变量中
- jianguoliao@jianguoliao-OptiPlex-380:~$ echo $PATH
- /work/soft/jdk1.6.0_35/bin:/work/soft/jdk1.6.0_35/jre/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/work/eclipse/adt-bundle-linux-x86_64-20131030/sdk/platform-tools:/work/eclipse/adt-bundle-linux-x86_64-20131030/sdk/tools
- jianguoliao@jianguoliao-OptiPlex-380:~$
- # sudo gedit ~/.bashrc
- 在文件的最后追加一下内容(your_android-sdk-linux_path是绝对路径):
- #set path for android sdk tools
- export PATH=$PATH:/your_android-sdk-linux_path/tools/
- export PATH=$PATH:/your_android-sdk-linux_path/platform-tools/
# source ~/.bashrc
二、查看usb
- jianguoliao@jianguoliao-OptiPlex-380:~$ lsusb
- Bus 001 Device 079: ID 18d1:0d02 Google Inc.
- Bus 003 Device 002: ID 046d:c077 Logitech, Inc.
- Bus 004 Device 002: ID 413c:2003 Dell Computer Corp. Keyboard
- Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
- Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
- Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
- Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
- Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
- jianguoliao@jianguoliao-OptiPlex-380:~$
echo 18d1 > ~/.android/adb_usb.ini
- jianguoliao@jianguoliao-OptiPlex-380:~$ cat ~/.android/adb_usb.ini
- 0x18d1
- 0x15a2
- jianguoliao@jianguoliao-OptiPlex-380:~$
- jianguoliao@jianguoliao-OptiPlex-380:~$ cat /etc/udev/rules.d/70-android.rules
- # adb protocol on passion (Nexus One)
- SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="<tom>"
- # fastboot protocol on passion (Nexus One)
- SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0666", OWNER="<tom>"
- # adb protocol on crespo (Nexus S)
- SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="<tom>"
- # fastboot protocol on crespo (Nexus S)
- SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="<tom>"
- # liaojianguo add usb
- SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e41", MODE="0600", OWNER="<tom>"
- # liaojianguo add usb
- SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="0d02", MODE="0600", OWNER="<tom>"
- sudo chmod a+rx /etc/udev/rules.d/70-android.rules
- sudo service udev restart
- adb kill-server
- sudo adb start-server
- adb devices
报错处理: 如果按照上面的步骤进行了操作, $adb shell error: insufficient permissions for device 这种情况不要担心 解决办法如下: $sudo -s 使用超级用户登录 #adb kill-server #adb start-server #exit 关闭,发起动完adb之后,再退回普通用户登录 $adb shell 这次就应该没问题了!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。