当前位置:   article > 正文

adb设置_配置adb密码登录

配置adb密码登录



一、把adb的路径配置到环境变量中

  1. jianguoliao@jianguoliao-OptiPlex-380:~$ echo $PATH
  2. /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
  3. jianguoliao@jianguoliao-OptiPlex-380:~$

  1. # sudo gedit ~/.bashrc
  2. 在文件的最后追加一下内容(your_android-sdk-linux_path是绝对路径):
  3. #set path for android sdk tools
  4. export PATH=$PATH:/your_android-sdk-linux_path/tools/
  5. export PATH=$PATH:/your_android-sdk-linux_path/platform-tools/

# source ~/.bashrc


二、查看usb

  1. jianguoliao@jianguoliao-OptiPlex-380:~$ lsusb
  2. Bus 001 Device 079: ID 18d1:0d02 Google Inc.
  3. Bus 003 Device 002: ID 046d:c077 Logitech, Inc.
  4. Bus 004 Device 002: ID 413c:2003 Dell Computer Corp. Keyboard
  5. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  6. Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
  7. Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
  8. Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
  9. Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
  10. jianguoliao@jianguoliao-OptiPlex-380:~$

echo 18d1 > ~/.android/adb_usb.ini

  1. jianguoliao@jianguoliao-OptiPlex-380:~$ cat ~/.android/adb_usb.ini
  2. 0x18d1
  3. 0x15a2
  4. jianguoliao@jianguoliao-OptiPlex-380:~$

三、给予权限

  1. jianguoliao@jianguoliao-OptiPlex-380:~$ cat /etc/udev/rules.d/70-android.rules
  2. # adb protocol on passion (Nexus One)
  3. SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="<tom>"
  4. # fastboot protocol on passion (Nexus One)
  5. SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0666", OWNER="<tom>"
  6. # adb protocol on crespo (Nexus S)
  7. SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="<tom>"
  8. # fastboot protocol on crespo (Nexus S)
  9. SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="<tom>"
  10. # liaojianguo add usb
  11. SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e41", MODE="0600", OWNER="<tom>"

增加一行

  1. # liaojianguo add usb
  2. SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="0d02", MODE="0600", OWNER="<tom>"

重启服务

  1. sudo chmod a+rx /etc/udev/rules.d/70-android.rules
  2. sudo service udev restart

  1. adb kill-server
  2. sudo adb start-server
  3. adb devices

  1. 报错处理:
  2. 如果按照上面的步骤进行了操作,
  3. $adb shell
  4. error: insufficient permissions for device
  5. 这种情况不要担心
  6. 解决办法如下:
  7. $sudo -s 使用超级用户登录
  8. #adb kill-server
  9. #adb start-server
  10. #exit 关闭,发起动完adb之后,再退回普通用户登录
  11. $adb shell 这次就应该没问题了!


本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号