Search code examples
macosadb

adb: command not found after restarting OS X


I'm a bit of a noob at this, but every time I restart my machine and update OS X, I lose adb commands in terminal. I'm not sure how or why this happens or how to get them back aside from reinstalling adb tools, but I'm assuming there's a better way.


Solution

  • The adb tools need to be added to the paths so terminal searches the directory the tools are in.

    Assuming you are using a bash terminal you edit or create .bash_profile-file that defines the paths to search, in the example below using the nano-editor:

    nano ~/.bash_profile

    Enter the path to the adb tools as follows:

    export PATH=$PATH:/path/to/the/adb/tools

    Save the file (CTRL-X, choose Yes on Save), close the terminal window and open up a new one to load the .bash_profile. This should solve your problem.