Last active
October 16, 2025 20:00
-
-
Save oliverspryn/e4f4fc055def312274c2cf2d14278817 to your computer and use it in GitHub Desktop.
Download and extract the Android Command Line tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
#!/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
#!/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