简体   繁体   中英

Android SDK command line not working on mac

I have my ADT folder at /Users/username/Development/adt-bundle-mac-x86_64-20140702/ and I am trying to set the bash_profile file to work with it because whenever I type "android" or "adb" into the terminal, it returns "-bash: android: command not found". Right now, my .bash_profile (which is stored at /Users/username/) looks like:

export PATH=$PATH:~/bin
export ANDROID_HOME=/Developer/adt-bundle-mac-x86_64-20140702/
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

After each time I update the file to try something else, I save it and then type "source .bash_profile" into the terminal to refresh the file. Is it possible that I should be using a command?

I have gone through numerous tutorials on Stack Overflow and other sites, but none of them are working.

Thanks in advance for the help

Your variable ANDROID_HOME doesn't match the path that you say your ADT folder is located at. Try changing it to:

export PATH=$PATH:~/bin
export ANDROID_HOME=/Users/username/Development/adt-bundle-mac-x86_64-20140702/sdk
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

Have you checked the shell you are using is ksh or bash? I had same problem but after changing from ksh to bash,it worked every time! refer this answer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM