Reputation: 8641
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) and ran on AVD. All I want to do now is be able to build the app and install it on device from the command line as opposed to Android Studio. I'm following the directions here:
http://developer.android.com/training/basics/firstapp/running-app.html
and the relevant line is:
Make sure the Android SDK platform-tools/ directory is included in your PATH environment variable, then execute:
The problem is I can't find the Android SDK on my machine! I assume it's there because otherwise the program wouldn't compile and run through Android Studio? Perhaps that's a bad assumption? I'm new to Macs (I'm used to Windows) so I don't know the best way to search for the Android SDK. So my questions:
Upvotes: 328
Views: 580556
Reputation: 3865
The link to the standalone SDK download page no longer seems to work, obsoleting many existing answers to this question. I struggled with this for a few hours before simply clicking the "Edit" link next to the empty SDK location box. This opens up a dialog that allows you to install the SDK and IDE tools.
Upvotes: 0
Reputation: 11766
sdk
You can see the location there – most of the time it is:
/Users/<name>/Library/Android/sdk
Open your Terminal edit your ~/.bash_profile
file in nano by typing:
nano ~/.bash_profile
If you use Zsh, edit ~/.zshrc
instead.
Go to the end of the file and add the directory path to your $PATH
:
export PATH="${HOME}/Library/Android/sdk/tools:${HOME}/Library/Android/sdk/platform-tools:${PATH}"
Ctrl+X
adb
) and verify it is opened/executedUpvotes: 557
Reputation: 197
I found it here: /Users//Library/Android/sdk
and Platform-tools is available as well
Upvotes: 9
Reputation: 69
In my case, I had to create local.properties file with sdk.dir=PATH_TO_ANDROID_SDK in my machine. It seems that, it's regarding the android sdk path setup. Hence, it could also be set in ANDROID_HOME env. variable too.
Upvotes: 0
Reputation: 609
For Visual Studio for Mac users (e.g. who installed Android SDK together with VS):
You can find JDK, Android NDK and Android SDK localizations there (if installed and selected). If no Android SDK path found, you may try to find it using Android Studio (if it is installed)
Upvotes: 0
Reputation: 929
AndroidStudioFrontScreenI simply double clicked the Android dmg install file that I saved on the hard drive and when the initial screen came up I dragged the icon for Android Studio into the Applications folder, now I know where it is!!! Also when you run it, be sure to right click the Android Studio while on the Dock and select "Options" -> "Keep on Dock". Everything else works. Dr. Roger Webster
Upvotes: 0
Reputation:
If Android Studio shows you the path /Users/<name>/Library/Android/sdk
but you can not find it in your folder, just right-click and select "Show View Option". There you will be able to select "Show Library Folder"; select it and you can access the SDK.
Upvotes: 9
Reputation: 4701
Android Studio
> Preferences
> Appearance & Behaviour
> System Settings
> Android SDK
> Android SDK Location
.bash_profile
file for your environment variablescd ~
touch .bash_profile
.bash_profile
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
Upvotes: 22
Reputation: 28554
The default path of Android SDK is /Users/<username>/Library/Android/sdk
, you can refer to this post.
add this to your .bash_profile to add the environment variable
export PATH="/Users/<username>/Library/Android/sdk/tools:/Users/<username>/Library/Android/sdk/build-tools:${PATH}"
Then save the file.
load it
source ./.bash_profile
Upvotes: 6
Reputation: 32076
If you don't want to open Android Studio just to modify your path...
${HOME}/Library/Android/sdk/tools
${HOME}/Library/Android/sdk/platform-tools
.bashwhatever
export PATH="${HOME}/Library/Android/sdk/tools:${HOME}/Library/Android/sdk/platform-tools:${PATH}"
Upvotes: 60
Reputation: 4549
- How do I find Android SDK on my machine? Or prove to myself it's not there?
When you install Android studio, it allows you to choose if you want to download SDK or not
- If it's not there how do I install it?
you can get SDK from here http://developer.android.com/sdk/index.html
- How do I change PATH to include Android SDK?
in Android Studio click in File >> Settings
Upvotes: 13