Why have I got two Android directories on my Mac?
Both are under ~/Library.
One is Android (which contains a 9.4GB sdk folder) and the other is android-sdk-mac_86 (which contains a 1.7GB system-images folder and a 1.7GB add-ons folder).
What's the difference and can I delete one of them?
The first question is which of the SDKs you use from your IDE (Android Studio?).
If it's not declared in your Android Studio preferences, it might be in a system variable (try echo $ANDROID_HOME from terminal)
My guess is that you're using the android-sdk-mac_x86, and you should keep that one. this looks like the latest official Stand-alone SDK, as written in the developer site:
Unpack the ZIP file you've downloaded. By default, it's unpacked into
a directory named android-sdk-mac_x86. Move it to an appropriate
location on your machine, such as a "Development" directory in your
home 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.
The folders you mentioned also fit what this SDK comes with.
If you are still not sure, you can rename one of them and see if everything still ticks.
I would personally delete both, and start with a fresh SDK that fits your current SDK packages, we usually carry junk from the past we don't actually need (http://developer.android.com/sdk/installing/adding-packages.html)
The Android directory contains Android studio and all the relevant files, while the other directory contains the stand alone SDK tools. You have the option to download either or both from their website.
You can delete both of them given you have the privileges.
Related
I am having the damnedest time getting Flutter to find the SDK command-line tools. I am trying to install the latter by downloading the zip provided at that link and unpacking it in say ${HOME}/Android. This produces a tools directory, and if I run the executable
${HOME}/Android/tools/bin/sdkmanager
directly (whith any number of options, etc.) I always get an error as documented in this other post. The solution recommended there actually works: move the tools directory further down the tree to get the path
${HOME}/Android/cmdline-tools/tools/bin/sdkmanager
That new intermediate directory must be named cmdline-tools though; I've tried other things (Sdk, sdk_manager, etc.) to no effect: the same errors occur.
Now, poking around in the cloned Flutter repo, I see in the file dev/bots/download_android_sdk.sh that I'm supposed to have the executable
$ANDROID_SDK_ROOT/tools/bin/sdkmanager
This tips me off that in my setup I need
ANDROID_SDK_ROOT=${HOME}/Android/cmdline-tools
exporting that and running a bunch of sdkmanager installation commands (like say
$ANDROID_SDK_ROOT/tools/bin/sdkmanager platform-tools
and the like) I see that my ${HOME}/Android directory is starting to get populated with the corresponding directories platform-tools, build-tools, etc. So those newly-installed directories live at the same level as my $ANDROID_SDK_ROOT which remember, as I'm doing this, is set to $HOME/Android/cmdline-tools.
On the other hand though, when I then go look (in the same Flutter repo) in the file
packages/flutter_tools/lib/src/android/android_sdk.dart
I see that I'm supposed to have the directory $ANDROID_SDK_ROOT/build-tools. This is in direct contradiction with the previous observation that build-tools and the like are supposed to be at the same level as $ANDROID_SDK_ROOT, and not under it.
My problem is I don't know how to square this apparent self-contradiction in the Flutter codebase. Which is it? In my setup, is ANDROID_SDK_ROOT supposed to be $HOME/Android or $HOME/Android/cmdline-tools?
PS
I understand that $ANDROID_SDK_ROOT is supposed to be "the SDK installation directory", but in this context this tells me nothing: after all, installing SDK is precisely what I'm trying to do.
You got a couple comments on GitHub as well, but just be aware that the files in the dev/ folder in the Flutter repository are mainly intended for CI purposes and for people who are developing the Flutter framework itself.
The scripts you're pointing out are actually stale files that used to help set up some tests we ran on CI. We now set those tests up differently, but forgot to delete the files - so thanks for pointing this out, they're soon to be gone!
The best way to set up your Android SDK is by following the instructions at the Android Studio site. You can either use Studio to do it, or just download the SDK bundle(s) themselves.
My windows is on a 128GB ssd hard drive and it's running out of space. the folder
C:\Users\User\AppData\Local\Android has 2 folders android-sdk and sdk folders that use about 30GB of space.
Is it possible to move these folders to an external hard drive?
If it is possible, what changes should I make in the android studio?
I do the same thing. In Android Studio go to Settings, select Appearance and Behaviour then System Settings then Android SDK
You can choose the SDK location at the top.
You'll need to copy/paste the files to that location to save yourself the downloading time.
Its very simple just copy the sdk to wherever you want and then change the sdk path in android studio. For that just open the local.properties file and set the path like this:
sdk.dir=your path here
To keep the most used simulator in SSD drive and the others used for testing in the slow drive i created Symbolic. They are NTFS objects that appear in a folder as a sub folder but can that point to another folder on another drive.
To create then, move to C:\Users\<user>\.android\avd and do this:
mklink /d W10.1_WXGA_Tablet_API_28.avd d:\androidSimulators\W10.1_WXGA_Tablet_API_28.avd
MDLink info here.
If using Linux based systems you can also do this with linked directories.
For windows 10 users, emulators are stored by default at here:
C:\Users\<user>\.android\avd
I saw that I need to direct Unity to the SDK file which I want to use in the application(the supported versions of android).
So I got into Edit--> Preferences --> External Tools ---> SDK file location
When I browse, I have a folder called SDK, which contains many folders in it, including one named "Platforms". There I saw the API version I downloaded from the SDK manager. I got into that folder, I went in the API folder(which is called android- 15), and then I pressed SELECT FOLDER. How ever, it didn't work.
I tried several different folders and files, but it didn't work as well.
Which file exactly should I direct to, and in which folder will it be?
https://developer.android.com/sdk/index.html
scroll to the bottom to download an android SDK standalone and just select this folder?
You should select sdk folder, (the folder whith contains "Platforms" folder )
When the downloading is finish,it comes a warning:"The Android SDK folder can no longer be inside the application folder.Please move it to a different location such as your home folder.When the IDE restart it will prompt you to enter the new location......"
And I restart it and choose a different loaction,but it didn't work.
"The Android SDK folder can no longer be inside the application
folder.Please move it to a different location such as your home
folder.When the IDE restart it will prompt you to enter the new
location"
Open the folder where you put your android studio, on Mac is (Applications/Android\ Studio.app/) and on Windows is %LOCALAPPDATA%\Android\android-studio\sdk, and move the sdk folder you find inside in another location. After you moved it in another location, press the retry button.
Cut sdk folder from (This is default location, you may have installed it somewhere else)
C:\Users\[Username]\AppData\Local\Android\android-studio
and paste it somewhere else then try to update.
Once it get updated then set the path your sdk in studio.
From Android Tools Project Site
To proceed, you should open up a file explorer or finder window, go to
the Android Studio installation (e.g. /Applications/Android
Studio.app) and move the sdk/ folder over to a different location,
such as your home directory. Once done, press Retry to finish
installing the patch. The reason this is necessary is two-fold: First,
we have made a lot of improvements to make the patch updater more
accurate, and in order for installation signatures to match, you
cannot have non-application folders inside the application directory.
Second, placing the SDK folder inside the application directory was
probably not a good idea to begin with: this folder should typically
be writable and in a directory with a lot of extra diskspace, such
that users can easily download and install additional libraries,
system images and so on. We are doing some work on the installer side
to make this easier to set up.
Grab sdk folder from
C:\Users[Username]\AppData\Local\Android\android-studio\sdk
and paste it somewhere else like C:\Users[Username]\AppData\Local\Android\android-studio
and start the update.
Then it will ask you to put the path. and its done
I am trying to start developing with Titanium sdk.
I download the IDE and when I give the path of my android sdk (which is running fine in default Eclipse Android Developer suite), it doesn't recognize it.
Please check the video below:
http://screencast.com/t/AQeBORaf
It's weird...
create an empty folder android-7 in $android/platforms...it works after this
EDIT:The above solution doesn't work properly in all cases . He is another alternative which
surely works : if you are using android 2.2 an above( API 8 and above) ,you need to create a symbolic link between adb file which is in platform-tools(from 2.2 and above) and tools folder. This is because the structure of android SDKs have changed from 2.2 on wards and titanium follows the old structure . So you create a symbolic link of that adb file which was previously in tools folder and has now been transferred to platform-tools folder. This solution is for linux.
$ copy $ANDROID_SDK/platform-tools/adb.exe $ANDROID_SDK/tools
I think the path you're specifying might be incomplete. Dont click on the 'android-sdk-windows' folder. Instead try this...right click on the 'add-ons' INSIDE that folder.Go to properties and under the 'General' tab there is a 'Location' specified. Copy and paste this location into where your SDK path is needed. Hope that helps! :)