问题

Unity在安卓版本Target需要升级后,使用内置的SDK无法提供,需要使用运行sdkmanager来更新
此为一个简单的比处理,填写目录后,直接更新

1
2
3
4
5
6
7
8
9
10
11
12
13
set UNITY_VERSION=2021.3.6f1c1

c:
set JAVA_HOME=c:\Program Files\Unity\Hub\Editor\%UNITY_VERSION%\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\
set ANDROID_HOME=c:\Program Files\Unity\Hub\Editor\%UNITY_VERSION%\Editor\Data\PlaybackEngines\AndroidPlayer\
cd %ANDROID_HOME%SDK\tools\bin\
echo.> %USERPROFILE%\.android\repositories.cfg

cmd /C sdkmanager --update
cmd /C sdkmanager "platform-tools" "platforms;android-29"
cmd /C sdkmanager "platform-tools" "platforms;android-30"
cmd /C sdkmanager "platform-tools" "platforms;android-31"
cmd /C sdkmanager "platform-tools" "platforms;android-32"