ANDROID_HOME PATH: Connecting Android studio on Mac to appium (version 1.5.3)

Hi

I am quietly losing my mind trying to install ANDROID_HOME.

How do I access ANDROID_HOME PATH on my mac book

I did vim ~/.bash_profile

but I don’t know what to do after that (I’m doing an on line training and what the training makes NO sense to me at all).

I just need someone to tell what I am supposed so I can start learning this thing.

After you did ‘vim ~/.bash_profile’, did you do the corresponding command, ‘source ~/.bash_profile’?

@wreed Ok I have have typed in both commands. I have got the following (seel below). Now what do I do?

From the shell:
open /Applications/TextEdit.app .bash_profile
Edit the file and save it.
You’ll add lines like:
export FOO=value

Close your shell windows and re-open.
You can do something like the following to verify what you set:
echo $FOO

If it doesn’t show up, check the file permissions.
ls –l .bash_profile

If it isn’t -rw-r–r—you’ll want to change it:
chmod 644 .bash_profile

Inside the shell, you can re-run the .bash_profile by executing:
.~/.bash_profile

The . command sources a shell script in your current environment. You can use that to quickly edit and test on the command line without quitting and re-opening the shell.

I’m a bit a of apple novice so l have done the following

1.I found the location of my Android studio
2.‘vim ~/.bash_profile’
3.source ~/.bash_profile
4. Source I typed

export ANDROID_HOME=//android-sdk-macosx
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

How how do I save this in in terminal?

Can i just close it ?

I also have java installed for selenium webdriver. I do I need to install anything else java related? Do I need to find install JAVA_HOME location as well?

How do I find the JAVA_HOME I am using the el capitan OS on mac

I often find that it’s best to point the new user to a tutorial. This is a pretty good one on setting an environment variable in bash:

I encourage you to read this, this is the kind of knowledge that will take you a long way in your career.

For your specific problem, JAVA_HOME should be set when Java is installed on the machine. If it’s not, on my machine (10.11.6) you can set it in your ~/.bash_profile to:

export JAVA_HOME=/usr/libexec/java_home

Which is a symbolic link to the actual Java installed on your machine. Once you’ve done that you can ‘source ~/.bash_profile’ to have the system add your changes and then you should be able to ‘echo $JAVA_HOME’ to verify that the environment variable is set.

Good Luck!

@wreed we have the same mac OS 10.11.6

You forgot one detail but overall that is how you set an environment variable. I don’t know if this is slightly different on other versions of OS X.

notice to newbies**

It seems that android SDK is no longer available to download separately. If you want to use android sdk you will have to download android studio. Once you are in android studio. Select ‘configure’ and select ‘sdk manger’ from the options.

New update:

If anyone is having problems installing Andriod studio I have FINALLY FIGURED IT OUT and it works mac os el capitan 10.11.6

  1. download Android Studio
    1a. Open terminal after download and installation
    2.‘vim ~/.bash_profile’
    3.source ~/.bash_profile
  2. Source bash profile I typed

export ANDROID_HOME=///Android/sdk
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
export JAVA_HOME=$(/usr/libexec/java_home)

to save

press esc button

type:
:wq

  1. Close terminal

  2. open new terminal

  3. type ‘android’ in terminal

This should open the Android SDK manager

  • ANDROID_HOME: place your Andriod SKD location in this area followed by /andriod/sdk. To find the correct location open android studio>configure >Android sdk> copy the location
  1. In SDK tools select most up to date platforms ( in Oct '16 it is 5.1 and 6.0) >install (it will take ages!)>reboot mac too

  2. Open Appium press Doctor (stethoscope icon) confirm that all items are successfully installed as you will see a number of green ticks

1 Like

I hope you found answer already. For Android Studio v2.2 and Java 1.8, below are my variables in ~/.bash_profile

export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)

export ANDROID_HOME=$HOME/Library/Android/sdk

1 Like

Thanks buddy. I successfully installed it last week. It was a massive relief