Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #This Script is for the auto install of adb under linux
- #Made By: LrdElderon from the #koush channel irc.freenode.net
- ##############################################################
- #Run by making sure the script is chmod +x and then sudo run it
- ##############################################################
- nameis=$SUDO_USER
- cd /etc/udev/rules.d
- echo "Creating USB rule file for droid device"
- sudo touch 99-android.rules
- #test try and get phone vendor id from lsusb command to iput into udev rule
- phoneid=$(sudo lsusb | egrep -o '0502|0bb4|12d1|1004|22b8|04e8|0fce')
- sudo echo SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"phone\", SYMLINK+=\"android_adb\", MODE=\"0666\", OWNER=\"USERNAME \" >> 99-android.rules
- sudo sed "s/USERNAME/$nameis/g" 99-android.rules > tempfile1
- sudo cat tempfile1>99-android.rules
- sudo sed "s/phone/$phoneid/g" 99-android.rules > tempfile4
- sudo cat tempfile4 > 99-android.rules
- sudo chmod a+r 99-android.rules
- echo "DONE and restarting UDEV"
- sudo restart udev
- echo "DONE now cleaning up"
- sudo rm tempfile1
- sudo rm tempfile4
- sudo rm /usr/local/android-sdk_r05-linux_86.tgz
- echo "."
- echo ","
- echo ","
- echo "ALL DONE!"
- echo "Please make sure debugging is turned on in your phone"
- echo "If the phone was already plugged in please unplug and replug back in now"
- echo "AND TYPE: adb, after it starts up try, adb devices or adb shell"
- echo "Thanks for using my adb installer for linux - LrdElderon"
- echo "."
- echo "."
- echo " if you found this to be helpful I urge you to please donate I take"
- echo " a lot of time to help users "
- echo "They are not however required "
- echo "."
- echo "."
- echo " PAYPAL DONATONS TO: Elderon@gmail.com "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement