Unity Android SDK 升级、安装 build-tools、platform-tools

Unity Android SDK 升级、安装 build-tools、platform-tools

通过 Unity Hub 安装的 Android SDK 需要下载 特定版本的 build-tools、platform-tools 如何操作?

以 Unity 2022.3.26f1 为例,打开安装目录,找到如下目录

2022.3.26f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\bin

我电脑上的路径是 D:\A_Unity\2022.3.26f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\bin
在 bin 这个文件夹中打开 cmd 命令
执行命令

D:\A_Unity\2022.3.26f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\bin\sdkmanager.bat --list

等待执行完毕输出所有可用的 build-tools、platform-tools 版本,日志太多,我粘贴部分我们关注的部分

Warning: Errors during XML parse:
Warning: Additionally, the fallback loader failed to parse the XML.
Installed packages:=====================] 100% Computing updates...
  Path                 | Version | Description                   | Location
  -------              | ------- | -------                       | -------
  build-tools;32.0.0   | 32.0.0  | Android SDK Build-Tools 32    | build-tools\32.0.0\
  build-tools;34.0.0   | 34.0.0  | Android SDK Build-Tools 34    | build-tools\34.0.0\
  build-tools;35.0.0   | 35.0.0  | Android SDK Build-Tools 35    | build-tools\35.0.0\
  platform-tools       | 32.0.0  | Android SDK Platform-Tools 32 | platform-tools\
  platforms;android-31 | 1       | Android SDK Platform 31       | platforms\android-31\
  platforms;android-32 | 1       | Android SDK Platform 32       | platforms\android-32\
  platforms;android-34 | 3       | Android SDK Platform 34       | platforms\android-34\
  platforms;android-35 | 2       | Android SDK Platform 35       | platforms\android-35\
  tools                | 26.1.1  | Android SDK Tools 26.1.1      | tools\

Available Packages:
  Path                                                                            | Version           | Description

  -------                                                                         | -------           | -------
  add-ons;addon-google_apis-google-18                                             | 4                 | Google APIs

  add-ons;addon-google_apis-google-19                                             | 20                | Google APIs

  add-ons;addon-google_apis-google-21                                             | 1                 | Google APIs

  add-ons;addon-google_apis-google-22                                             | 1                 | Google APIs

  add-ons;addon-google_apis-google-23                                             | 1                 | Google APIs

  add-ons;addon-google_apis-google-24                                             | 1                 | Google APIs


  build-tools;34.0.0-rc3                                                          | 34.0.0 rc3        | Android SDK Build-Tools 34-rc3

  build-tools;35.0.0                                                              | 35.0.0            | Android SDK Build-Tools 35

  build-tools;35.0.0-rc1                                                          | 35.0.0 rc1        | Android SDK Build-Tools 35-rc1

  build-tools;35.0.1                                                              | 35.0.1            | Android SDK Build-Tools 35.0.1

  build-tools;36.0.0-rc1                                                          | 36.0.0 rc1        | Android SDK Build-Tools 36-rc1


  cmake;3.31.4                                                                    | 3.31.4            | CMake 3.31.4

  cmake;3.31.5                                                                    | 3.31.5            | CMake 3.31.5

  cmake;3.6.4111459                                                               | 3.6.4111459       | CMake 3.6.4111459

  cmdline-tools;16.0-alpha01                                                      | 16.0.0 rc1        | Android SDK Command-line Tools

  cmdline-tools;17.0                                                              | 17.0              | Android SDK Command-line Tools

  cmdline-tools;19.0-alpha01                                                      | 19.0.0 rc1        | Android SDK Command-line Tools

  cmdline-tools;latest                                                            | 19.0.0 rc1        | Android SDK Command-line Tools (latest)

  emulator                                                                        | 35.3.12           | Android Emulator

  ndk;27.1.12297006                                                               | 27.1.12297006     | NDK (Side by side) 27.1.12297006

  ndk;27.2.12479018                                                               | 27.2.12479018     | NDK (Side by side) 27.2.12479018

  ndk;28.0.12433566                                                               | 28.0.12433566 rc1 | NDK (Side by side) 28.0.12433566

  ndk;28.0.12674087                                                               | 28.0.12674087 rc2 | NDK (Side by side) 28.0.12674087

  ndk;28.0.12916984                                                               | 28.0.12916984 rc3 | NDK (Side by side) 28.0.12916984

  ndk;28.0.13004108                                                               | 28.0.13004108     | NDK (Side by side) 28.0.13004108

  platform-tools                                                                  | 35.0.2            | Android SDK Platform-Tools

  platforms;android-31                                                            | 1                 | Android SDK Platform 31

  platforms;android-32                                                            | 1                 | Android SDK Platform 32

  platforms;android-33                                                            | 3                 | Android SDK Platform 33

  platforms;android-34                                                            | 3                 | Android SDK Platform 34

  platforms;android-35                                                            | 2                 | Android SDK Platform 35

  platforms;android-Baklava                                                       | 5                 | Android SDK Platform Baklava

  skiaparser;1                                                                    | 6                 | Layout Inspector image server for API 29-30

  skiaparser;2                                                                    | 3                 | Layout Inspector image server for API S

  skiaparser;3                                                                    | 6                 | Layout Inspector image server for API 31-36

  sources;android-32                                                              | 1                 | Sources for Android 32

  sources;android-33                                                              | 1                 | Sources for Android 33

  sources;android-34                                                              | 2                 | Sources for Android 34

  sources;android-35                                                              | 1                 | Sources for Android 35

 
Available Updates:
  ID             | Installed | Available
  -------        | -------   | -------
  platform-tools | 32.0.0    | 35.0.2

Installed packages: 部分是已经安装的
Available Packages: 是有效可下载的
Available Updates: 是需要更新的

比如我需要下载 build-tools;35.0.0 和 platforms;android-35 在日志中查看有没有需要的版本

可以先到 2022.3.26f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools 路径下看看有没有 35.0.0
在这里插入图片描述
如果没有,则执行命令 sdkmanager.bat "build-tools;30.0.3"
等待安装完成

再到路径 2022.3.26f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms 查看是否已安装 android-35
在这里插入图片描述
如果没有,则执行命令 sdkmanager.bat "platforms;android-35"

猜你喜欢

转载自blog.csdn.net/LIQIANGEASTSUN/article/details/145813923
今日推荐