Android sdk location in linux

What is the default Android SDK path used by Android Studio?

When using Android Studio to download the Android SDK, what is the default path where it downloads to? I’m interested in knowing the paths for Linux, Mac, and Windows.

@Deming That link you provide refers to Xamarin not being able to find the Android SDK. This one is about the default location to where Android Studio downloads the SDK when not provided a custom path.

4 Answers 4

From searching in the web it seems to be:

I find it odd to have inconsistent paths and even the lower/upper case for Linux and Mac («Sdk» vs «sdk»), but it seems to be this way.

It’s actually a capital «Sdk» on Windows as well, it’s just case-insensitive by default, so it doesn’t matter. I’m not sure if the lowercase «sdk» is actually correct on Mac. It might be a similar situation as Windows, where it’s actually «Sdk», but it’s case-insensitive by default.

It was like that 3 years ago when I posted the answer. Things might have changed meanwhile, which makes sense, in order to make the paths more standard between the various platforms.

Linux /home/AccountName/Android/Sdk

enter image description here

Click this icon in Android Studio for the Android SDK manager:

enter image description here

And your android sdk location will be here:

I hope its helpful for you!

I need to know the actual paths on all the platforms, not «how to» find them out. This is because I do not have access to all the 3 mentioned platforms, yet I need to make some tools that download the SDK and put them in the correct folder, where Android studio would also download it to, so that if the Android Studio is installed in the future the SDK is already there.

@Arsian Developer those don’t look like Android Studio screenshots. Ok, the first one looks like a really old Android Studio version, but I’m pretty sure the Linux one is Netbeans which didn’t even ever receive official Android support. In any case, both of them seem to have custom paths, rather than the default one.

Источник

What is an appropriate directory in which to install Android SDK?

I don’t use java much so what are the common (best practice) locations to install components like this. I want to put them in a system directory so multiple users have access.

I’m not looking to do it half-assed. Unix software has common places such as /opt. I would like to know what is common for java/android packages and such.

i’ve said to you that it doesn’t matter where , create a new directory and define the autorisation to all user to acces it , and then , pass the path on your Eclipse to refer the sdk ,

Читайте также:  Android sdk command line tools linux

4 Answers 4

Common locations are /opt , /srv , and /usr/local . I tend to lean toward /usr/local .

Note that the Android SDK doesn’t really require you to install much, it’s mostly self-contained. All you need to do is tell Eclipse where it is. You may also want to add the tools and/or platform-tools directories to the system-wide PATH so that your users can use adb and other tools.

@caffinatedmonkey: Because it’s the «correct» location for locally-installed software that isn’t part of the standard distribution according to the Filesystem Hierarchy Standard. /opt is also perfectly valid, and some would argue that it’s even more appropriate since the Android SDK is self-contained and doesn’t itself follow the FHS. In fact, if I were to install the SDK today I might put it in /opt and then symlink to the binaries in /usr/local (since the latter location has the added benefit of being on the PATH by default).

Источник

Android SDK and Path

Since I’ve downloaded the Android development kit as a package (sdk, eclipse bundled together), I extracted it into /opt/android/sdk I ran the command nano ~/.bashrc command and opened the file. Now I set the path as below

export PATH=$:/opt/android/sdk/tools export PATH=$:/opt/android/sdk/platform-tools export ANDROID_SDK_HOME =:/opt/android/sdk 

But it doesn’t seem to help at all, when I run ddms in command prompt I get error message saying no command ddmds found . If we set the path variable in windows correctly the ddms command would work correctly. I assume its a problem with the way I set the path. Can someone please help me out. Thanks.

In case you weren’t aware, Google have made a (pre-release stages) all-in-one IDE and SDK handler called Android Studio.

2 Answers 2

The correct configuration in your case would look like this:

export ANDROID_HOME=/opt/android/sdk export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools 

Note that the environment variable is called ANDROID_HOME , not ANDROID_SDK_HOME . Also, the third line in your sample was missing a $ sign (and contained an additional space). Lastly, there is no need to repeat the same path (DRY) — just use the already defined variable.

EDIT (2020-03-08):

While the ANDROID_SDK environment variable still continues to work for the most part, it has been deprecated by Google, and replaced with ANDROID_SDK_ROOT . So you might want to use the new name for a new setup.

Источник

How to install Android SDK on Ubuntu?

For my Ubuntu machine, I downloaded the latest version of Android SDK from this page. After extracting the downloaded .tgz file, I was trying to search for installation instructions and found:

To get started on Linux: Unpack the .zip file you’ve downloaded. The SDK files are download separately to a user-specified directory. Make a note of the name and location of the SDK directory on your system—you will need to refer to the SDK directory later when using the SDK tools from the command line.

there’s an easy install paolorotolo.github.io/android-studio — or check this tutorial on how do it manualy — youtube.com/watch?v=qfinKxwYYZs

@Tasos Any idea about the maintenance and long term support paolorotolo’s Android studio? This looks more of a personal project 🙁

Читайте также:  Intel linux lan drivers

Android Studio itself alerts you when there is a new update/upgrade so you do it from there. I dont think the person modified AS

from my last comment — however you can ask that question directly to the person here — github.com/PaoloRotolo/android-studio/issues

9 Answers 9

sudo apt update && sudo apt install android-sdk 

The location of Android SDK on Linux can be any of the following:

  • /home/AccountName/Android/Sdk
  • /usr/lib/android-sdk
  • /Library/Android/sdk/
  • /Users/[USER]/Library/Android/sdk
  • Download the Android Studio.
  • Extract downloaded .zip file. The extracted folder name will read somewhat like android-studio

To keep navigation easy, move this folder to Home directory.

  • After moving, copy the moved folder by right clicking it. This action will place folder’s location to clipboard.
  • Use Ctrl Alt T to open a terminal
  • Go to this folder’s directory using cd /home/(USER NAME)/android-studio/bin/
  • Type this command to make studio.sh executable: chmod +x studio.sh
  • Type ./studio.sh

A pop up will be shown asking for installation settings. In my particular case, it is a fresh install so I’ll go with selecting I do not have a previous version of Studio or I do not want to import my settings.

If you choose to import settings anyway, you may need to close any old project which is opened in order to get a working Android SDK.

From now onwards, setup wizard will guide you.

Android Studio can work with both Open JDK and Oracle’s JDK (recommended). Incase, Open JDK is installed the wizard will recommend installing Oracle Java JDK because some UI and performance issues are reported while using OpenJDK.

The downside with Oracle’s JDK is that it won’t update with the rest of your system like OpenJDK will.

The wizard may also prompt about the input problems with IDEA .

Verify installation settings

An emulator can also be configured as needed.

The wizard will start downloading the necessary SDK tools

The wizard may also show an error about Linux 32 Bit Libraries, which can be solved by using the below command:

sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1

After this, all the required components will be downloaded and installed automatically.

After everything is upto the mark, just click finish

To make a Desktop icon, go to ‘Configure’ and then click ‘Create Desktop Entry’

Источник

How to set ANDROID_HOME path in ubuntu?

The question was not related on setting a specific environment variable in Ubuntu; this stackoverflow.com/a/37368367/509565 is definitely the correct answer.

20 Answers 20

In the console just type these :

export ANDROID_HOME=$HOME/Android/Sdk export PATH=$PATH:$ANDROID_HOME/tools 

If you want to make it permanent just add those lines in the ~/.bashrc file

@Dinesh I think he refers to change the Android SDK location if it is different, for example, if you have chosen another directory when installing it.

I think the PATH should now be export PATH=$PATH:$ANDROID_HOME/platform-tools , see below. In the SDK 29.0.3 I just installed, there is no tools directory anymore.

I would like to share an answer that also demonstrates approach using the Android SDK provided by the Ubuntu repository:

Install Android SDK

sudo apt-get install android-sdk 

Export environmental variables

export ANDROID_HOME="/usr/lib/android-sdk/" export PATH="$:$tools/:$platform-tools/" 

Assuming you have the sdk extracted at ~/Android/Sdk ,

export ANDROID_HOME=$HOME/Android/Sdk export PATH=$PATH:$ANDROID_HOME/tools export PATH=$PATH:$ANDROID_HOME/platform-tools 
  1. Add the above lines to the file ~/.bashrc (located at home/username/.bashrc ) to make it permanent for the current user. Run source ~/.bashrc to apply the changes or restart your terminal. (or)
  2. Run the above lines on a terminal window to make it available for the session.
Читайте также:  Linux параметры монтирования дисков

To test if you have set it up correctly,

Run the below commands on a terminal window

user@host:~$ echo $ANDROID_HOME /home//Android/Sdk 
user@host:~$ which android /home//Android/Sdk/tools/android 

Note that you have to restart the terminal before those echo commands will work. I usually run exec $SHELL .

@Mate / all — It says: «The «android» command is deprecated. (. ) For command-line tools, use tools/bin/sdkmanager . « : therefore add (per above): export PATH=$PATH:$ANDROID_HOME/tools/bin then source ~/.profile (or .bashrc) if you don’t want to logout.. then try running ‘sdkmanager —licenses’. Then try compiling.

better way is to reuse ANDROID_HOME variable in path variable. if your ANDROID_HOME variable changes you just have to make change at one place.

export ANDROID_HOME=/home/arshid/Android/Sdk export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools 

Could you expand your answer a little bit more, please ? Try to detail what you are doing and why it is a «better way». Thank you !

Initially go to your home and press Ctrl + H it will show you hidden files now look for .bashrc file, open it with any text editor then place below lines at the end of file.

export ANDROID_HOME=/home/varun/Android/Sdk export PATH=$PATH:/home/varun/Android/Sdk/tools export PATH=$PATH:/home/varun/Android/Sdk/platform-tools 

Please change /home/varun/Android/Sdk path to your SDK path. Do the same for tools and platform-tools.

After this save .bashrc file and close it.

Now you are ready to use ADB commands on terminal.

Add the following to your ~/.bashrc file. Log-out and log-in. I have my sdk in $HOME/Documents/Android/sdk you have to replace it with where you keep your sdk folder

# Android Path PATH=$PATH:$HOME/Documents/Android/sdk:$HOME/Documents/Android/sdk/tools export PATH # For SDK version r_08 and higher, also add this for adb: PATH=$PATH:$HOME/Documents/Android/sdk/platform-tools export PATH 

first open the .bashrc file by gedit ~/.bashrc

# Added ANDROID_HOME variable. export ANDROID_HOME=$HOME/Android/Sdk export PATH=$PATH:$ANDROID_HOME/tools export PATH=$PATH:$ANDROID_HOME/platform-tools

save the file and reopen the terminal

it will show the path like /home/pathTo/Android/Sdk

Applies to Ubuntu and Linux Mint

export ANDROID_HOME=$/Android/Sdk export PATH=$:$/platform-tools:$/tools 

Restart the terminal and doing: echo $ HOME or $ PATH, you can know these variables.

Download the Android SDK to the machine. (Suppose that the location is /home/zelong/Android/Sdk) (home/username/Android/Sdk)

Add these lines to the file ~/.bashrc (located at home/username/.bashrc)

export ANDROID_HOME="/home/zelong/Android/Sdk" export PATH=$PATH:$ANDROID_HOME/tools export PATH=$PATH:$ANDROID_HOME/platform-tools 

This will make it permanent for the current user because every time the machine boots, it will run this script and set the enviroment path.

After making this change, remember to save it.

Then run source ~/.bashrc to apply the changes or restart your terminal.

Test if it works:

zelong@zelong-ThinkPad-T430:~$ echo $ANDROID_HOME /home/zelong/Android/Sdk zelong@zelong-ThinkPad-T430:~$ which android /home/zelong/Android/Sdk/tools/android zelong@zelong-ThinkPad-T430:~$ which adb /home/zelong/Android/Sdk/platform-tools/adb 

android command line locates under tools

adb command line locates under platform-tools

Источник

Оцените статью
Adblock
detector