As a noob I was struggling a lot with setting up the variable.I was creating copies of .bash_profile files, the text in file was not saving etc ..😳
So I documented the the steps that worked for me. It is simple and foolproof( but little lengthy ) way to do it ✌🏼
Step1. Go to Finder >Go(on top) , click on users, then your user account
you will see something like this :
{https://i.stack.imgur.com/8e9qX.png}
Step2. Now hold down ⌘ + ⇧ + . (dot) , this will now display hidden files and folders. It will look something like this:
{https://i.stack.imgur.com/apOoO.png}
PS: If the ⌘ + ⇧ +. does not work, please look up the keyboard shortcut relevant for your Mac Operating system name
Step3.
Scenario A :If .bash_profile
already exists
Step3.A.1 :Double click the .bash_profile. It should open up with TextEdit ( or alternatively right click >open with >TextEdit)
Step3.A.2 : Paste the variable text in the .bash_profile file using ⌘ + V
Step3.A.3 :Save the .bash_profile file using ⌘ + S
Scenario B :If .bash_profile
does NOT exist
This is kind silly way of doing it , but it worked perfectly for noob like me
Step3.B.1 : Download free BBEdit text editor which is pretty light weight. Whats special about this editor is that it lets you save file that starts with ". "
Step3.B.2 : Create a new file
Step3.B.3 : Save the file in your account folder . A warning will pop up , which looks something like this:
{https://i.stack.imgur.com/KLZmL.png}
Click Use"." button. Then the blank .bash_profile file will be saved
Step3.B.4 : Paste the variable text in the .bash_profile file using ⌘ + V
Step3.B.5 :Save the .bash_profile file using ⌘ + S
Step 4: Last and final step is to check if the above steps worked.
Open the bash and type echo $ANDROID_HOME
Your ANDROID_HOME variable should be now set.🤜🏻