I'm trying to "Get Started" with Setting Up the Preview SDK | Android Developers to Install the L Preview System Image Android L Developer Preview | Android Developers on my Nexus 7 (Wifi) "razor".

I'm getting following error:

mbp:razor-lpv79 alexus$ ./flash-all.sh 
./flash-all.sh: line 17: fastboot: command not found
./flash-all.sh: line 18: fastboot: command not found
mbp:razor-lpv79 alexus$

here is my fastboot, it's in /Applications/Android Developer Tools/sdk/platform-tools/ folder:

mbp:razor-lpv79 alexus$ ls /Applications/Android\ Developer\ Tools/sdk/platform-tools/fastboot 
/Applications/Android Developer Tools/sdk/platform-tools/fastboot
mbp:razor-lpv79 alexus$ 

What can I do? I do NOT wish to modify flash-all.sh script (if possible).

  • Assuming you are using Mac/Linux OS, try using sudo ./ before all fastboot command. – user78712 Nov 3 '14 at 10:02

This isn't an Android problem at all. You can simply run the commands from flash-all.sh by hand, changing each one to name fastboot by its full path, or you can set the $PATH in your shell.

PATH="$PATH:/Applications/Android Developer Tools/sdk/platform-tools/"

You should also check that the fastboot executable is executable. This probably won't be the case if you've extracted the files onto a non-ext partition. The following output is a correct example: note the x in the fourth column, and that the files are owned by the user I'm running as.

z1@foyle platform-tools% ls -l
total 3292
-rwxr-xr-x 1 z1 z1 1355536 1105 27 Jun 14 adb
drwxr-xr-x 2 z1 z1    4096 1105 27 Jun 14 api
-rwxr-xr-x 1 z1 z1   47828 1105 27 Jun 14 dmtracedump
-rwxr-xr-x 1 z1 z1  225253 1105 27 Jun 14 etc1tool
-rwxr-xr-x 1 z1 z1  201380 1105 27 Jun 14 fastboot
-rwxr-xr-x 1 z1 z1   10071 1105 27 Jun 14 hprof-conv
-rw-r--r-- 1 z1 z1  720629 1105 27 Jun 14 NOTICE.txt
-rw-r--r-- 1 z1 z1   16520 1105 27 Jun 14 source.properties
-rwxr-xr-x 1 z1 z1  771959 1105 27 Jun 14 sqlite3
drwxr-xr-x 2 z1 z1    4096 1105 27 Jun 14 systrace
  • 1
    I ran export PATH=$PATH$:'/Applications/Android\ Developer\ Tools/sdk/platform-tools/' (echo $PATH returns updated $PATH), yet still getting -bash: fastboot: command not found. – alexus Jul 1 '14 at 15:14
  • There's an extra $ sign in your command. – Dan Hulme Jul 1 '14 at 15:32

I was running today into a similar issue as the one that you are pointing out. I downloaded my .img file from https://developers.google.com/android/nexus/images and tried to run:


But that was returning:

./flash-all.sh: line 17: fastboot: command not found
./flash-all.sh: line 18: fastboot: command not found

My solution (in my Mac) was to download the file RootNexus5.zip from http://downloadandroidfiles.org/download-rootnexus5-zip-2/ decompress the downloaded file and copy fastboot-mac into the same folder as flash-all.sh.

Now open flash-all.sh in your favourite editor (Sublime in my case) and change all the ocurrences of fastboot for ./fastboot-mac. Then try to run the file again. If you are not using a Mac simply use fastboot-linux.

Note: Linux users in my case was debian 9.8 stretch.

Make sure adb and fastboot are installed.

sudo apt-get install adb 
sudo apt-get install fastboot

fixed my error straight away. I already had adb but not fastboot.

  • I also mention that i do NOT wish to edit flash-all.sh, as I could easily change path to it and call it a day! – alexus Nov 19 '14 at 15:47
  • The (if possible) at the end tricked me then ;-) – tokenizer_fsj Nov 20 '14 at 6:21

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