android - fastboot and adb not working with sudo -
i have weird issue on ubuntu machine when trying run fastboot command.
when run:
fastboot devices
i get
no permissions fastboot
so run command adminidtrator permissions:
sudo fastboot devices
and result
sudo: fastboot: command not found
how can be? have directory in path , works correctly without sudo.
instead of forcing permissions via sudo
each time need run fastboot
, can permanently fix issue:
- use
lsusb
identify device usb vendorid - configure
udev
set proper permissions when device plugged in - profit!
as bonus - fixed adb
too.
for example, in case (for 'megafon sp-a20i') :
$ fastboot devices no permissions fastboot $ sudo fastboot devices [sudo] password kaa: medfielda9055f28 fastboot $
let's fix:
first, need identify device:
a) usb bus number (hack: know device intel-based one)
$ fastboot -l devices no permissions fastboot usb:1-1.2 $ lsusb |grep 001 |grep -i intel bus 001 device 044: id 8087:09ef intel corp. bus 001 device 002: id 8087:0020 intel corp. integrated rate matching hub $
b) other intel devices:
$ lsusb |grep 8087 bus 002 device 002: id 8087:0020 intel corp. integrated rate matching hub bus 001 device 044: id 8087:09ef intel corp. bus 001 device 002: id 8087:0020 intel corp. integrated rate matching hub $
hubs not smartphones definetely, - usb vendorid need "8087".
second, configure udev
(you must replace "idvendor" value yours) :
$ sudo sh -c "echo '# megafon sp-a20i' >> /etc/udev/rules.d/51-android.rules" $ sudo sh -c "echo 'subsystem==\"usb\", attr{idvendor}==\"8087\", mode=\"0666\", group=\"plugdev\"' >> /etc/udev/rules.d/51-android.rules" $ sudo service udev restart udev stop/waiting udev start/running, process 1821 $
third, re-plug device allow udev
perform it's magic.
final check:
$ fastboot -l devices medfielda9055f28 fastboot usb:1-1.2 $ adb devices list of devices attached $ fastboot reboot rebooting... finished. total time: 0.253s $ sleep 90 $ adb devices list of devices attached medfielda9055f28 device $
voila!
Comments
Post a Comment