Finding Android SDK on Mac and adding to PATH

前端 未结 7 2110
离开以前
离开以前 2020-12-07 07:28

I have installed Android Studio on my MacBook Air (OS Version 10.11 El Capitan) and have successfully written a small \"hello, world\" app and installed on device (Nexus 7)

7条回答
  •  盖世英雄少女心
    2020-12-07 08:07

    Find the Android SDK location

    Android Studio 
      > Preferences
      > Appearance & Behaviour
      > System Settings 
      > Android SDK
      > Android SDK Location
    

    Create a .bash_profile file for your environment variables

    • Open the Terminal app
    • Go to your home directory via cd ~
    • Create the file with touch .bash_profile

    Add the PATH variable to your .bash_profile

    • Open the file via open .bash_profile
    • Add export PATH=$PATH: [your SDK location] /platform-tools to the file and hit ⌘s to save it. By default it's:

      export PATH=$PATH:/Users/yourUserName/Library/Android/sdk/platform-tools

    • Go back to your Terminal App and load the variable with source ~/.bash_profile

提交回复
热议问题