從文檔:
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
它將安裝所有當前安裝的軟件包的更新。
當您在命令'(build-tools; 25.0.0)中傳遞版本'時,它會隱式地安裝包含該編號的包並且不會更新它。您將需要運行'update'命令來更新它們。 –
同意。我對哪些軟件包會發生什麼情況感興趣,它們在其標識符中不包括版本,例如平臺工具,演員。 – Ben