Search for Android SDK on Mac and add to PATH

I installed Android Studio on my MacBook Air (OS version 10.11 El Capitan), successfully wrote a small Hello World application, installed it on my device (Nexus 7) and launched it on AVD. All I want to do now is create an application and install it on the device from the command line, and not in Android Studio. I follow the directions here:

http://developer.android.com/training/basics/firstapp/running-app.html

and the corresponding line:

Make sure that the Android SDK platform tools directory is included in the PATH environment variable, and then run:

The problem is that I cannot find the Android SDK on my machine! I assume it is there, because otherwise the program will not compile and run through Android Studio? Perhaps this is a bad guess? I'm new to Mac (I'm used to Windows), so I don’t know what is the best way to search for Android SDK. So my questions are:

  1. How to find Android SDK on my machine? Or prove to yourself it is not there?
  2. If it’s not there, how can I install it?
  3. How to change PATH to enable Android SDK?
+154
android android-studio android-sdk-tools macos
Dec 30 '15 at 15:10
source share
8 answers

1. How to find him

Open Android studio, go to Android Studio> Search for preferences for sdk and something similar to this (this is a Windows window, as you can see) will show Sorry Not A MAC Fan

You can see the location there, in most cases it is /Users/<name>/Library/Android/sdk

2. How to install if not

Just go to the Android Standalone SDK download page , download the zip file for OSX and unzip it to a directory Stand alone sdk download page

3. How to add it to the path

Open a terminal application and open the path file in nano by typing

 sudo nano /etc/paths 

Enter your password, go to the end of the line and enter the directory path. And you want to add: for example: -

 /Users/username/Libs/android-sdk-mac_x86/platform-tools 

Nano screenshot

Save it by pressing Ctrl + X, restart the terminal application and see if it works or not - enter the name of any file or binary file that are in the directories you added and make sure that it is open / executed.

+271
Dec 30 '15 at 15:22
source share

If you do not want to open Android Studio just to change your path ...

They live here with a standard installation:

 ${HOME}/Library/Android/sdk/tools ${HOME}/Library/Android/sdk/platform-tools 

Here you want to add to your .bashwhatever

 export PATH="${HOME}/Library/Android/sdk/tools:${HOME}/Library/Android/sdk/platform-tools:${PATH}" 
+39
Mar 29 '17 at 18:56
source share
  • How to find Android SDK on my machine? Or prove to yourself that this is not so?

When you install Android studio, it allows you to choose whether you want to download the SDK or not.

  1. If this is not the case, how can I install it?

you can get the SDK from here http://developer.android.com/sdk/index.html

  1. How do I change PATH to enable the Android SDK?

in Android Studio, click on the file → Settings enter image description here

+13
Dec 30 '15 at 15:30
source share

Find Android SDK Location

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

Create a .bash_profile file for environment variables

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

Add PATH variable to .bash_profile

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

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

  • Return to the Terminal application and load the variable using source ~/.bash_profile

+11
Jun 06 '17 at 6:39 on
source share

If Android Studio shows the path /Users/<name>/Library/Android/sdk but you can’t find it in your folder, just right-click and select “Show viewing option”. There you can select "Show library folder"; select it and you can access the SDK.

+6
Jun 28 '17 at 13:00
source share

The default path for the Android SDK /Users/<username>/Library/Android/sdk , you can refer to this post.

add this to your .bash_profile to add an environment variable

 export PATH="/Users/<username>/Library/Android/sdk/tools:/Users/<username>/Library/Android/sdk/build-tools:${PATH}" 

Then save the file.

upload it

 source ./.bash_profile 
+3
Jun 06 '17 at 6:06
source share

AndroidStudioFrontScreen I just double-clicked the Android dmg installation file that I saved on my hard drive, and when the first screen appeared, I dragged the Android Studio icon to the Applications folder, now I know where it is !!! In addition, when you launch it, do not forget to right-click Android Studio in the Dock and select "Options" → "Save to Docking Station". Everything else works. Dr. Roger Webster

0
Jan 16 '19 at 11:21
source share

Android Studio

Settings Appearance and behavior System settings Android SDK Android SDK Location

0
Apr 03 '19 at 7:35
source share



All Articles