In my new MacBook, I installed latest Android Studio. Then, in terminal, I created the .bash_profile, and added following lines to the file:
export ANDROID_HOME=~/Library/Android/sdk
export ANDROID_TOOLS=$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform_tools
export PATH=$PATH:$ANDROID_TOOLS
After that, I run command source .bash_profile
, then I type adb
command, but get error that adb is not recognized as a command. Why? I also echo $PATH
, I saw the platform_tools
directory of Android sdk is there & there is adb file under that directory.
====== UPDATE =====
It is interesting, if I do following, it works:
export PATH=$PATH:/Users/myname/Library/Android/sdk/platform-tools
export PATH=$PATH:/Users/myname/Library/Android/sdk/tools
export ANDROID_HOME=/Users/myname/Library/Android/sdk
WHY? Isn't ~
above identical to /Users/myname
? Why my original script doesn't work but the above one works? I don't understand....Please someone explain to me.