简体   繁体   中英

Uninstall old Android SDK versions

I installed Android SDK and it's taking almost 7 GB on my (relatively small) SSD.

When I open Android SDK Manager I can see that everything is installed even older API versions.

在此处输入图片说明

Same thing for the Extras :

在此处输入图片说明

Can I safely un-install all the versions and only keep the latest one (API 17 in my case) ?

I use Andoid SDK Tools to develop Android Apps with eclipse.

Thank you.

Just delete the packages you want to uninstall.

You may still want to retain some of the older SDK's so as to try your apps on lower platform. I personally keep GB(API 10), ICS(API 14) and JB(API 17).

Also what you can try is just move the whole android SDK folder to a new location with relatively large storage, and then specify the new path in preferences in eclipse. Will save you some bandwidth, in case you later need those API's. My friend just copies from mine. Data here is very costly :(

You can deploy it, but you would have to mention it(that you want to run on lower APIs) on your manifest file. Also any API above the targeted device will not run and will interfere with your app design. Search for android TargetSDK version and MinimunSDK version.

Select the packages that you want to uninstall在此处输入图片说明and click delete packages button.

As for the current version (Feb 2019) here is way that works from within Android Studio:

  1. Open the SDK Manager (Tools -> SDK Manager).

  2. There you see all available platforms and in "Name" a box which shows Installed [✓], Update available [–] and Not installed [ ] platforms.

在此处输入图片说明

  1. If you klick on that box you can change the status. Click until it is empty and a red x shows up. Then press Apply. The platform will be uninstalled then.

在此处输入图片说明

If you want to use the android command line tool sdkmanager to do this instead of the UI, this is the way to do it.

Prepare

Make sure that sdkmanager doesn't complain about repositories.cfg missing:

mkdir -p ~/.android && touch ~/.android/repositories.cfg

Also make sure that you are using Java 8 by calling java -version , otherwise sdkmanager won't work (as of time of writing). Using Java 8 can be solved in many different ways, eg:

  • Linux: sudo update-alternatives --config java
  • macOS using SDKMAN!: sdk use java <VERSION>
  • Other way

Use

For help with all the commands run sdkmanager --help

For listing available components:

sdkmanager --list

For installing a component:

sdkmanager --install "build-tools;28.0.3"

For uninstalling a component:

sdkmanager --uninstall "build-tools;26.0.2"

Uninstalling Android SDK from Visual Studio Installer and then installing it again did resolve my problem and made the Android SDK options enable for me.

Goto VS Installer, go down to the SDK portion and uncheck Java SE Development Kit (version) and Android SDK setup (API level 25) from the individual component options and click on modify.

When they're gone, install them again following the same steps.

获取提示的图片

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM