List installed sdk package via command line

偶尔善良 提交于 2019-12-03 02:17:57

With Android SDK Tools 25.2.3 (and higher):

$ANDROID_HOME/tools/bin/sdkmanager --list

See: https://developer.android.com/studio/command-line/sdkmanager.html#usage

As described in $ANDROID_HOME/tools/android list --help

  • list : Lists existing targets or virtual devices.
  • list avd : Lists existing Android Virtual Devices.
  • list target : Lists existing targets.
  • list device : Lists existing devices.
  • list sdk : Lists remote SDK repository.

I guess you are looking for this:

$ANDROID_HOME/tools/android list target

You can learn more on the android tool in the Command Line Reference.

Good luck!

On my mac just sdkmanager --list was not working, path needed to be specified.

Using android studio default SDK location the path is ~/Library/Android/sdk/tools/bin/sdkmanager --list

As mentioned by @tnissi this is for Android SDK Tools 25.2.3 (and higher).

Or add the path by: export PATH=$PATH:~/Library/Android/sdk/tools/bin

It's not quite a listing, but the source.properties files give details of the provenance. I'm using this to compare SDKs on different machines:

for i in $(find -name source.properties); do
  if [ -e ../other.sdk/$i ] ; then
    echo ========================= $i
    diff -wu $i ../other.sdk/$i | grep -v Pkg.License
  fi
done

I strip Pkg.License because it's hyoooj.

A bit old topic but I had similar problem, And noticed that avdmanager lists installed platforms as targets

"%ANDROID_SDK_ROOT%\tools\bin\avdmanager" list target

Available Android targets:==============] 100% Fetch remote repository...
----------
id: 1 or "android-25"
     Name: Android API 25
     Type: Platform
     API level: 25
     Revision: 3
----------
id: 2 or "android-28"
     Name: Android API 28
     Type: Platform
     API level: 28
     Revision: 6
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!