sudo echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/lubuntu/Tools/android-sdk-linux/platform-tools
adb exists in /home/lubuntu/Tools/android-sdk-linux/platform-tools
Then I executed adb start-server
:
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
Then sudo adb install test.apk
sudo: adb: command not found
I have added adb in the environment variable $PATH, but sudo couldn't find it. Why?
sudo
means you're switching to root, and that does not necessarily mean that your environment comes along. That could be dangerous.
At your risk, add the -E
option to inherit the calling environment.
The problem is the PATH var is set for that user, and root don't have the aditional PATH entry, so it can't found the program.
You should setup adb for root too:
adb Environmental Variables
Open ~/.bashrc
and add the following to the very bottom
export PATH=${PATH}:<sdk>/tools:<sdk>/platform-tools
Change <sdk>
to the actual path. ie /home/user/android-sdk-linux
Close and re-open your terminal to refresh variables.
from adb setup
If doesn't work, make symbolic links from adb and other binaries to /usr/local/bin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With