Error: ANDROID_HOME is not set and “android” command not in your PATH. You must fulfill at least one of these conditions

后端 未结 6 1855
野的像风
野的像风 2020-12-31 05:01

I am MAC OS X Yosemite I have done all the export tutorial to set the android_home but non of it working for me

6条回答
  •  萌比男神i
    2020-12-31 05:42

    Making sure ANDROID_HOME is exported and adding the SDK tool directories to PATH should be more than enough to get you going.


    Using the terminal

    # First, we make sure we have a newline at the end of the .bash_profile
    echo >> /Users/abdi/.bash_profile
    
    # We set the ANDROID_HOME value in the .bash_profile
    echo "export ANDROID_HOME=/Users/abdi/adt/sdk" >> /Users/abdi/.bash_profile
    
    # We alter the PATH value a bit as well
    echo "export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools" >> /Users/abdi/.bash_profile
    
    # We then tell the terminal to update all the things
    . /Users/abdi/.bash_profile
    

    Using a GUI (mostly)

    You can also open the .bash_profile file in TextEdit using the open -e /Users/abdi/.bash_profile command. If you get some errors about missing files, try running touch /Users/abdi/.bash_profile and retry the open command. In the file that opens, add the following lines at the end.

    export ANDROID_HOME=/Users/abdi/adt/sdk
    export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
    

    Running . /Users/abdi/.bash_profile as in the terminal version after that should get you fully set up.

提交回复
热议问题