0

I'm facing the problem, that i cannot set the ANDROID_HOME path variable.

I added the following lines to my bashrc file:

# Android Path
export ANDROID_HOME=~/android-sdk/Sdk/tools

But when i try to access android via the terminal i get this error:

android: command not found

How can i solve this problem?

johni07
  • 761
  • 1
  • 11
  • 31
  • Is the directory really named `Sdk` with a captial S? – Michael Aug 29 '16 at 15:05
  • you can check if variable is set by entering **echo $ANDROID_HOME** – Nishant Pardamwar Aug 29 '16 at 15:05
  • This Q is not about programming as defined for StackOverflow. It **may** be more appropriate on the S.E. related sites http://andriod.stackexchange.com OR http://askubuntu.com . Consider using the flag link at the bottom of your Q and ask the moderator to move it. Please don't post the same Q on 2 different sites. Thanks and Good Luck. – shellter Aug 29 '16 at 15:05

2 Answers2

2

You need to add the variable in your PATH as well. The aim is for your PATH variable to contain the complete folder path, in which the file 'android' is present.

export ANDROID_HOME=~/android-sdk/Sdk/tools
export PATH=$ANDROID_HOME:$PATH

Don't forget to source your bashrc after adding these lines

source ~/.bashrc

Again, the file 'android' should be present in the tools folder.

Karishma Gulati
  • 703
  • 7
  • 13
0

Follow the following steps:

1)Open the bashrc file from command line

nano ~/.bashrc

2) Add following lines at the top.

export PATH=${PATH}:~/android-sdk-linux/tools
export PATH=${PATH}:~/android-sdk-linux/platform-tools

3)Now, quit terminal and re-launch, and try typing:

adb -h
android -h

If both commands are giving you output, it means everything works fine.

orvi
  • 3,142
  • 1
  • 23
  • 36