Set environment variables on Mac OS X Lion

后端 未结 16 1208
余生分开走
余生分开走 2020-11-22 11:01

When someone says \"edit your .plist file\" or \"your .profile\" or \".bash_profile\" etc, this just confuses me. I have no idea where these files are, how to create them if

16条回答
  •  清酒与你
    2020-11-22 11:23

    Setup your PATH environment variable on Mac OS

    Open the Terminal program (this is in your Applications/Utilites 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 everytime you open the Terminal program you PATH will included the Android SDK.

提交回复
热议问题