What is the proper way to modify environment variables like PATH in OS X?
I\'ve looked on Google a little bit and found three different files to edit:
Open the Terminal program (this is in your Applications/Utilities folder by default). Run the following command
touch ~/.bash_profile; open ~/.bash_profile
This will open the file in the your default text editor.
For Android SDK as example:
You need to add the path to your Android SDK platform-tools and tools directory. In my example I will use "/Development/android-sdk-macosx" as the directory the SDK is installed in. Add the following line:
export PATH=${PATH}:/Development/android-sdk-macosx/platform-tools:/Development/android-sdk-macosx/tools
Save the file and quit the text editor. Execute your .bash_profile to update your PATH:
source ~/.bash_profile
Now every time you open the Terminal program your PATH will include the Android SDK.