Skip to content

Instantly share code, notes, and snippets.

@oliverspryn
Last active October 16, 2025 20:00
Show Gist options
  • Select an option

  • Save oliverspryn/e4f4fc055def312274c2cf2d14278817 to your computer and use it in GitHub Desktop.

Select an option

Save oliverspryn/e4f4fc055def312274c2cf2d14278817 to your computer and use it in GitHub Desktop.
Download and extract the Android Command Line tools
#!/bin/bash
# Example Definitions, for Mac Setups
destination="$HOME/android/"
toolsDownloadUrl=$(curl https://developer.android.com/studio | grep -o "https:\/\/dl.google.com\/android\/repository\/commandlinetools\-mac\-[0-9]*_latest\.zip")
# Download and extract the contents
curl --location -o android.zip $toolsDownloadUrl
unzip -q android.zip -d ./android-temp
mkdir -p "$destination/cmdline-tools/latest"
mv ./android-temp/tools/* "$destination/cmdline-tools/latest"
rm -rf ./android-temp
rm android.zip
@erfanmtt
Copy link

goodddddddd

@amirhosseinporrang
Copy link

Good

@dkdkjdbekxocjsn-eng
Copy link

خوی

@abwmahmmadalwjeeh
Copy link

#!/bin/bash

Example Definitions, for Mac Setups

destination="$HOME/android/"
toolsDownloadUrl=$(curl https://developer.android.com/studio | grep -o "https://dl.google.com/android/repository/commandlinetools-mac-[0-9]*_latest.zip")

Download and extract the contents

curl --location -o android.zip $toolsDownloadUrl
unzip -q android.zip -d ./android-temp

mkdir -p "$destination/cmdline-tools/latest"
mv ./android-temp/tools/* "$destination/cmdline-tools/latest"
rm -rf ./android-temp
rm android.zip

@abwmahmmadalwjeeh
Copy link

#!/bin/bash

Example Definitions, for Mac Setups

destination="$HOME/android/"
toolsDownloadUrl=$(curl https://developer.android.com/studio | grep -o "https://dl.google.com/android/repository/commandlinetools-mac-[0-9]*_latest.zip")

Download and extract the contents

curl --location -o android.zip $toolsDownloadUrl
unzip -q android.zip -d ./android-temp

mkdir -p "$destination/cmdline-tools/latest"
mv ./android-temp/tools/* "$destination/cmdline-tools/latest"
rm -rf ./android-temp
rm android.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment