List of Android SDK command-line tools releases, version by version

  Kiến thức lập trình

I want to get URLs to download any version of Android Command-Line tools. Is there such a list?

What I know:

  • sdkmanager --list --verbose doesn’t print URLs

  • https://dl.google.com/android/repository returns 404

  • https://developer.android.com/sdk/older_releases.html only contains extremely old releases

  • cat $ANDROID_HOME/cmdline-tools/latest/source.properties prints

    Pkg.Revision=11.0
    Pkg.Path=cmdline-tools;11.0
    Pkg.Desc=Android SDK Command-line Tools
    

    Not very useful.

A comment under this answer has the actual answer – that is, this GitHub gist.

Basically, the repository contents list is available (in XML) at https://dl.google.com/android/repository/repository2-1.xml.

You can use the linked Go program in the gist, or curl it and use e.g. yq to convert from XML to JSON, and from there on, we can use jq to perform more granular selection of packages, for example:

curl -s https://dl.google.com/android/repository/repository2-1.xml 
  | yq -p xml -o json 
  | jq '."sdk-repository" | .remotePackage[] | select(."display-name" | startswith("Android SDK Command-line Tools"))'

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT