Set ANDROID_HOME environment variable in mac

后端 未结 17 800
梦谈多话
梦谈多话 2020-12-04 07:36

I am new in developing native app using Salesforce SDK. I tried to create android project from command line using forcedroid tool but there is problem in setting environment

相关标签:
17条回答
  • 2020-12-04 08:16
    source ~/.bash_profile
    export ANDROID_HOME=/YOUR_PATH_TO/android-sdk
    export PATH=$ANDROID_HOME/platform-tools:$PATH
    
    0 讨论(0)
  • 2020-12-04 08:18

    Here are the steps:

    1. Open Terminal
    2. Type touch .bash_profile and press Enter
    3. Now Type open .bash_profile and again press Enter
    4. A textEdit file will be opened
    5. Now type export ANDROID_HOME="Users/Your_User_Name/Library/Android/sdk"
    6. Then in next line type export PATH="${PATH}:/$ANDROID_HOME/platform-tools:/$ANDROID_HOME/tools:/$ANDROID_HOME/tools/bin"
    7. Now save this .bash_profile file
    8. Close the Terminal

    To verify if Path is set successfully open terminal again and type adb if adb version and other details are displayed that means path is set properly.

    0 讨论(0)
  • 2020-12-04 08:21

    The only solution worked for me was @Tiago Gouvêa answer, after adding it android and emulator commands worked fine, but sdkmanager command was not working so I have added one extra line to his solution:

    nano ~/.bash_profile

    Add lines:

    export ANDROID_HOME=/YOUR_PATH_TO/android-sdk
    export PATH=$ANDROID_HOME/platform-tools:$PATH
    export PATH=$ANDROID_HOME/tools:$PATH
    export PATH=$ANDROID_HOME/tools/bin:$PATH
    
    0 讨论(0)
  • 2020-12-04 08:22

    If some one is still finding difficulties, i have made a video on this

    https://www.youtube.com/watch?v=tbLAHKhjjI4

    Because the new version of Apple does not support bash shell so i have explained in details how do we set variables in 2020.

    0 讨论(0)
  • 2020-12-04 08:23

    Open Terminal

    nano ~/.bash_profile
    
    
    export ANDROID_HOME=/Users/qss/Library/Android/sdk
    export PATH=$ANDROID_HOME/tools:$PATH
    export PATH=$ANDROID_HOME/platform-tools:$PATH
    
    Control+S to save
    Control+X to exit
    Y to save changes
    Update changes in terminal
    source ~/.bash_profile
    
    Validate Path:
    echo $PATH
    
    Confirm if all okay:
    adb devices
    
    0 讨论(0)
提交回复
热议问题