4

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

muru
  • 197,895
  • 55
  • 485
  • 740
SA__
  • 141

1 Answers1

6

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.

muru
  • 197,895
  • 55
  • 485
  • 740