Advertisement
bigrushdog

adb_fix

Oct 18th, 2011
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.85 KB | None | 0 0
  1. #!/bin/bash
  2. #This Script is for the auto install of adb under linux
  3. #Made By: LrdElderon from the #koush channel irc.freenode.net
  4. ##############################################################
  5. #Run by making sure the script is chmod +x and then sudo run it
  6. ##############################################################
  7. nameis=$SUDO_USER
  8.  
  9.   cd /etc/udev/rules.d
  10.   echo "Creating USB rule file for droid device"
  11.   sudo touch 99-android.rules
  12.  
  13. #test try and get phone vendor id from lsusb command to iput into udev rule
  14.  
  15. phoneid=$(sudo lsusb | egrep -o '0502|0bb4|12d1|1004|22b8|04e8|0fce')
  16.  
  17. sudo echo SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"phone\", SYMLINK+=\"android_adb\", MODE=\"0666\", OWNER=\"USERNAME \" >> 99-android.rules
  18. sudo sed "s/USERNAME/$nameis/g" 99-android.rules > tempfile1
  19. sudo cat tempfile1>99-android.rules
  20. sudo sed "s/phone/$phoneid/g" 99-android.rules > tempfile4
  21. sudo cat tempfile4 > 99-android.rules
  22. sudo chmod a+r 99-android.rules
  23. echo "DONE and restarting UDEV"
  24. sudo restart udev
  25. echo "DONE now cleaning up"
  26. sudo rm tempfile1
  27. sudo rm tempfile4
  28. sudo rm /usr/local/android-sdk_r05-linux_86.tgz
  29. echo "."
  30. echo ","
  31. echo ","
  32. echo                              "ALL DONE!"
  33. echo           "Please make sure debugging is turned on in your phone"
  34. echo           "If the phone was already plugged in please unplug and replug back in now"
  35. echo           "AND TYPE: adb, after it starts up try, adb devices or adb shell"
  36. echo           "Thanks for using my adb installer for linux - LrdElderon"
  37. echo "."
  38. echo "."
  39. echo  " if you found this to be helpful I urge you to please donate I take"
  40. echo  "                    a lot of time to help users                      "
  41. echo                     "They are not however required "
  42. echo "."
  43. echo "."
  44. echo          "         PAYPAL DONATONS TO: Elderon@gmail.com      "                    
  45.    
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement