I have a very weird issue on my Ubuntu machine when trying to run the fastboot command.

When I run:

fastboot devices

I get

no permissions   fastboot

So I run the command with adminidtrator permissions:

sudo fastboot devices

And then I get the result

sudo: fastboot: command not found

How can this be? I have the directory in my PATH and everything works correctly without sudo.

share|improve this question
    
chmod +x? 5 more to go...I'm done. – Igor Filippov Nov 19 '14 at 13:04
up vote 28 down vote accepted

Instead of forcing permissions via sudo each time you need to run fastboot, you can permanently fix the issue:

  1. use lsusb to identify your device USB VendorID
  2. configure udev to set proper permissions when your device is plugged in
  3. profit!

As a bonus - it will be fixed for adb too.

For example, in my case (for 'Megafon SP-A20i') :

$ fastboot devices
no permissions  fastboot
$ sudo fastboot devices
[sudo] password for kaa: 
MedfieldA9055F28    fastboot
$ 

Let's fix:

First, we need to identify the device:

a) look for usb bus number (hack: I know the device is 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) look for 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 are not smartphones definetely, so - USB vendorID we need is "8087".

Second, configure udev (you must replace "idVendor" value with 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 your device to allow udev to 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!

share|improve this answer

You can use

sudo $(which fastboot) devices

share|improve this answer
1  
Thanks. Worked like a charm. How can I fix this though? To work normally as "sudo fastboot devices"? – nlmm01 Feb 4 '15 at 22:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.