Skip to content

Instantly share code, notes, and snippets.

@edp1096
Last active September 3, 2022 01:13
Show Gist options
  • Save edp1096/d7cee6948aa91dac236f108cbebba98d to your computer and use it in GitHub Desktop.
Save edp1096/d7cee6948aa91dac236f108cbebba98d to your computer and use it in GitHub Desktop.
Get windows androidsdk
@echo off
set BUILDTOOLS_VERSION=33.0.0
cd jre
set JAVA_HOME=%cd%
set PATH=%cd%;%cd%\bin;%PATH%
cd ..
cd tools
set ANDROID_HOME=%cd%
set PATH=%cd%;%cd%\build-tools\%BUILDTOOLS_VERSION%;%PATH%
cd ..
cmd
@echo off
set BUILDTOOLS_VERSION=33.0.0
if exist .\jre if exist .\cmdline-tools if exist .\tools if exist .\unzip set stop_job=true
if "%stop_job%"=="true" (
echo.
echo Remove existing cmdline-tools, jre, tools, unzip first.
echo Closing..
pause
exit
)
echo * jre
@rem "https://www.azul.com/downloads/?version=java-17-lts&os=windows&architecture=x86-64-bit&package=jre"
@rem curl -Lo jre.zip https://cdn.azul.com/zulu/bin/zulu17.36.17-ca-jre17.0.4.1-win_x64.zip
curl.exe --progress-bar -Lo jre.zip -s -k https://cdn.azul.com/zulu/bin/zulu11.58.23-ca-jre11.0.16.1-win_x64.zip
tar -xf jre.zip
ren zulu11.58.23-ca-jre11.0.16.1-win_x64 jre
set JAVA_HOME=%cd%\jre
set PATH = %cd%\jre\bin;%path%
echo * cmdline-tools
@rem https://developer.android.com/studio/index.html#downloads
curl --progress-bar -Lo cmdline-tools.zip -s -k https://dl.google.com/android/repository/commandlinetools-win-8512546_latest.zip
tar -xf cmdline-tools.zip
del *.zip /q/s
echo * androidsdk
echo y| cmdline-tools\bin\sdkmanager.bat --sdk_root=%cd%\tools "platform-tools" "platforms;android-33" "build-tools;%BUILDTOOLS_VERSION%"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment