安装包 install 是否也会更新已安装的包
Does installing a package install also update an installed package
我有一个 shell 脚本,定期 运行 使我的 CI 服务器上的 Android SDK 保持最新。我正在从:android update sdk --filter <foopackage>
迁移到:sdkmanager <foopackage>
。
对于标识符中没有 major.minor.patch
的包(例如 platform-tools
、tools
、extras;*
)——这些包以前会根据以前的方法隐式更新。阅读文档 (https://developer.android.com/studio/command-line/sdkmanager.html) 不清楚 sdkmanager <foopackage>
是否会在已安装包的情况下更新包,或者仅在缺少包时安装包? (在这种情况下,还需要 sdkmanager --update <foopackage>
)
来自文档:
The packages argument is an SDK-style path as shown with the --list command, wrapped in quotes (for example, "build-tools;25.0.0" or "platforms;android-25")
--list
的输出类似于:
Available Packages:
Path | Version | Description
------- | ------- | -------
add-ons;addon-g..._apis-google-23 | 1 | Google APIs
add-ons;addon-g..._apis-google-24 | 1 | Google APIs
add-ons;addon-g...e_gdk-google-19 | 11 | Glass Development Kit Preview
build-tools;25.0.0 | 25.0.0 | Android SDK Build-Tools 25
build-tools;25.0.1 | 25.0.1 | Android SDK Build-Tools 25.0.1
build-tools;25.0.2 | 25.0.2 | Android SDK Build-Tools 25.0.2
cmake;3.6.3155560 | 3.6.3155560 | CMake 3.6.3155560
docs | 1 | Documentation for Android SDK
extras;android;gapid;3 | 3.1.0 | GPU Debugging tools
extras;android;m2repository | 43.0.0 | Android Support Repository
extras;google;auto | 1.1 | Android Auto Desktop Head Unit...
extras;google;play_billing | 5 | Google Play Billing Library
extras;google;simulators | 1 | Android Auto API Simulators
extras;google;webdriver | 2 | Google Web Driver
extras;m2reposi...ut;1.0.0-alpha9 | 1 | ConstraintLayout for Android 1...
extras;m2reposi...out;1.0.0-beta5 | 1 | ConstraintLayout for Android 1...
lldb;2.2 | 2.2.3271982 | LLDB 2.2
ndk-bundle | 13.1.3345770 | NDK
patcher;v4 | 1 | SDK Patch Applier v4
platform-tools | 25.0.3 | Android SDK Platform-Tools
platforms;android-24 | 2 | Android SDK Platform 24
platforms;android-25 | 3 | Android SDK Platform 25
sources;android-25 | 1 | Sources for Android 25
system-images;a...google_apis;x86 | 5 | Google APIs Intel x86 Atom Sys...
system-images;a...ult;armeabi-v7a | 5 | ARM EABI v7a System Image
system-images;a...google_apis;x86 | 3 | Google APIs Intel x86 Atom Sys...
system-images;a...gle_apis;x86_64 | 3 | Google APIs Intel x86 Atom_64 ...
tools | 25.2.5 | Android SDK Tools 25.2.5
Available Updates:
ID | Installed | Available
------- | ------- | -------
extras;google;m2repository | 42 | 43
因此,要更新包,您需要在 Path
列下传递完整的值。例如,以下命令 sdkmanager "platform-tools"
将更新平台工具,因为 Path
列中没有它的版本。
但是命令sdkmanager "build-tools"
会抛出错误
Error: Failed to find package build-tools
因此您需要使用命令 sdkmanager <foopackage>
.
将完整的值传递给 install/update 包
但是,如果您使用 sdkmanager --update
,它将为当前安装的所有软件包安装更新。
我有一个 shell 脚本,定期 运行 使我的 CI 服务器上的 Android SDK 保持最新。我正在从:android update sdk --filter <foopackage>
迁移到:sdkmanager <foopackage>
。
对于标识符中没有 major.minor.patch
的包(例如 platform-tools
、tools
、extras;*
)——这些包以前会根据以前的方法隐式更新。阅读文档 (https://developer.android.com/studio/command-line/sdkmanager.html) 不清楚 sdkmanager <foopackage>
是否会在已安装包的情况下更新包,或者仅在缺少包时安装包? (在这种情况下,还需要 sdkmanager --update <foopackage>
)
来自文档:
The packages argument is an SDK-style path as shown with the --list command, wrapped in quotes (for example, "build-tools;25.0.0" or "platforms;android-25")
--list
的输出类似于:
Available Packages:
Path | Version | Description
------- | ------- | -------
add-ons;addon-g..._apis-google-23 | 1 | Google APIs
add-ons;addon-g..._apis-google-24 | 1 | Google APIs
add-ons;addon-g...e_gdk-google-19 | 11 | Glass Development Kit Preview
build-tools;25.0.0 | 25.0.0 | Android SDK Build-Tools 25
build-tools;25.0.1 | 25.0.1 | Android SDK Build-Tools 25.0.1
build-tools;25.0.2 | 25.0.2 | Android SDK Build-Tools 25.0.2
cmake;3.6.3155560 | 3.6.3155560 | CMake 3.6.3155560
docs | 1 | Documentation for Android SDK
extras;android;gapid;3 | 3.1.0 | GPU Debugging tools
extras;android;m2repository | 43.0.0 | Android Support Repository
extras;google;auto | 1.1 | Android Auto Desktop Head Unit...
extras;google;play_billing | 5 | Google Play Billing Library
extras;google;simulators | 1 | Android Auto API Simulators
extras;google;webdriver | 2 | Google Web Driver
extras;m2reposi...ut;1.0.0-alpha9 | 1 | ConstraintLayout for Android 1...
extras;m2reposi...out;1.0.0-beta5 | 1 | ConstraintLayout for Android 1...
lldb;2.2 | 2.2.3271982 | LLDB 2.2
ndk-bundle | 13.1.3345770 | NDK
patcher;v4 | 1 | SDK Patch Applier v4
platform-tools | 25.0.3 | Android SDK Platform-Tools
platforms;android-24 | 2 | Android SDK Platform 24
platforms;android-25 | 3 | Android SDK Platform 25
sources;android-25 | 1 | Sources for Android 25
system-images;a...google_apis;x86 | 5 | Google APIs Intel x86 Atom Sys...
system-images;a...ult;armeabi-v7a | 5 | ARM EABI v7a System Image
system-images;a...google_apis;x86 | 3 | Google APIs Intel x86 Atom Sys...
system-images;a...gle_apis;x86_64 | 3 | Google APIs Intel x86 Atom_64 ...
tools | 25.2.5 | Android SDK Tools 25.2.5
Available Updates:
ID | Installed | Available
------- | ------- | -------
extras;google;m2repository | 42 | 43
因此,要更新包,您需要在 Path
列下传递完整的值。例如,以下命令 sdkmanager "platform-tools"
将更新平台工具,因为 Path
列中没有它的版本。
但是命令sdkmanager "build-tools"
会抛出错误
Error: Failed to find package build-tools
因此您需要使用命令 sdkmanager <foopackage>
.
但是,如果您使用 sdkmanager --update
,它将为当前安装的所有软件包安装更新。