Setting Environment Variables for Android Studio

19,213

In the console just type these (remember to change to your current location)

export ANDROID_HOME=/usr/local/android-sdk-linux/tools
export PATH="$PATH:/usr/local/android-sdk-linux/platform-tools"

If you want to make it permanent just add those lines in the ~/.bashrc file.

Share:
19,213

Related videos on Youtube

SA__
Author by

SA__

Updated on September 18, 2022

Comments

  • SA__
    SA__ almost 2 years

    I am running cordova, so i wanted to install android-sdk. Here is the path

    Android-Studio Path = /home/apps/android-studio
    Android- /Android/Sdk
    

    Whenever i tried to add via export.. it seems to be included. But i got the error always

    ERROR: Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
    Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.
    

    How can i add the environment variables manually.

    In the /etc/environment, i tried to add the environment variables manually.

    But i got the same got the same error.

    Here is what i have in the /opt/environment so far

    PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
    

    What should i add next to make the command work cordova run android

    • Yatin
      Yatin about 8 years
      Hi did you figure this out @SA_ , I want to do the xact same thing