How do I edit $PATH (.bash_profile) on OS X?

I am trying to edit an entry to PATH, as I did something wrong.

I am using Mac OS X v10.10.3 (Yosemite)

I have tried:

touch ~/.bash_profile; open ~/.bash_profile

But the file editor opens with nothing inside.

My problem:

I am trying to install ANDROID_HOME to my PATH

I misspelled it, but when I closed the terminal and went back it was gone, so I tried again:

export ANDROID_HOME=/<installation location>/android-sdk-macosx
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

This time, I typed the command correctly but, when I closed the terminal, my settings disappeared again.

How do I execute my desired settings?

If I was to edit bash.profile, how would I enter the above code?

11 Answers
11

Leave a Comment