“Command not found” errors
If the binary is installed on your computer and you see a “command not found
” type of error when entering your command into the terminal, the problem may be that the /platform-tools
directory (or whichever directory contains the binary such as ~/bin
) is not in the “path of execution” for your terminal session. This means that your computer doesn’t know where exactly the binary is located.
The solution to this is to add the directory containing the binary to your PATH.
Linux/OSX
On most Linux/OSX systems using the Bourne Again Shell (bash), you can do the following:
- Edit the
.bashrc
file in your home directory. You can use any text editor (the example below uses “gedit”) to make this change.-
$ gedit ~/.bashrc
-
- Add the following line (
/path/to/dir
below would need to be replaced with whatever directory you want added to your PATH)-
$ export PATH=/path/to/dir:$PATH
-
- Save the file, then use the
source
command from the Terminal to load your.bashrc
file:-
$ source ~/.bashrc
-
Alternately, you can simply open a new window or tab to load the changes in the new terminal.
That’s it!
Windows
On Windows systems, you can do the following:
- Right-click on My Computer and select Properties.
- Choose Advanced and click on the Environment Variables button.
- Navigate to System Variables and double-click on Path to edit.
- Enter the full path to the directory/folder you want added to your PATH.
Content of this page is based on informations from wiki.cyanogenmod.org, under CC BY-SA 3.0 licence.