Environment Variable ANDROID_HOME Linux [duplicate]

0

I'm having trouble with the ANDROID_HOME environment variable, whenever I try to run the command to run an app on the emulator (or connected cell phone), this error message appears

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.

I tried several things I saw on the internet and nothing worked, could someone help me? I'm using Deepin Linux.

When running echo $ANDROID_HOME the result is /home/rafael/Android/Sdk

When I give echo $PATH

/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/opt/android-sdk/platform-tools:/opt/android-sdk/tools:/home/rafael/bin:/usr/local/java/jdk1.8.0_131/bin:/home/rafael/Android/Sdk/tools:/home/rafael/Android/Sdk/platform-tools:/home/rafael/Android/Sdk/tools:/home/rafael/Android/Sdk/platform-tools
    
asked by anonymous 05.06.2017 / 14:31

1 answer

2

You need to run the commands:

sudo gedit ~/.bashrc

In this file you need to add the following commands:


export ANDROID_HOME=caminho_do_SDK
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

Save and reload the .bashrc file:

source ~/.bashrc
    
05.06.2017 / 16:16