2017-05-29 27 views
2

了Android sdkmanager工具有辦法幾乎列表中可用的軟件包,像這樣:如何讀取android sdkmanager輸出以便安裝包?

$ sdkmanager --list 

    system-images;a...ult;armeabi-v7a | 4   | ARM EABI v7a System Image 
    system-images;a...-10;default;x86 | 4   | Intel x86 Atom System Image 
    system-images;a...pis;armeabi-v7a | 5   | Google APIs ARM EABI v7a Syste... 
    system-images;a...google_apis;x86 | 5   | Google APIs Intel x86 Atom Sys... 
    system-images;a...ult;armeabi-v7a | 2   | ARM EABI v7a System Image 
    system-images;a...ult;armeabi-v7a | 4   | ARM EABI v7a System Image 
    system-images;a...15;default;mips | 1   | MIPS System Image 
    system-images;a...-15;default;x86 | 4   | Intel x86 Atom System Image 
    system-images;a...pis;armeabi-v7a | 5   | Google APIs ARM EABI v7a Syste... 
    system-images;a...google_apis;x86 | 5   | Google APIs Intel x86 Atom Sys... 
    system-images;a...ult;armeabi-v7a | 4   | ARM EABI v7a System Image 
    system-images;a...16;default;mips | 1   | MIPS System Image 
    system-images;a...-16;default;x86 | 5   | Intel x86 Atom System Image 
    system-images;a...pis;armeabi-v7a | 5   | Google APIs ARM EABI v7a Syste... 
    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...17;default;mips | 1   | MIPS System Image 
    system-images;a...-17;default;x86 | 3   | Intel x86 Atom System Image 
    system-images;a...pis;armeabi-v7a | 5   | Google APIs ARM EABI v7a Syste... 
    system-images;a...google_apis;x86 | 5   | Google APIs Intel x86 Atom Sys... 
    system-images;a...ult;armeabi-v7a | 4   | ARM EABI v7a System Image 
    system-images;a...-18;default;x86 | 3   | Intel x86 Atom System Image 
    system-images;a...pis;armeabi-v7a | 5   | Google APIs ARM EABI v7a Syste... 
    system-images;a...google_apis;x86 | 5   | Google APIs Intel x86 Atom Sys... 

我想知道我怎麼能真正讀取輸出,所以我可以安裝在這些軟件包命令行。

回答

0

您需要使用--verbose標誌得到全包名稱:

sdkmanager --list --verbose 

輸出將看起來像這樣:

system-images;android-25;android-wear;armeabi-v7a 
    Description:  Android Wear ARM EABI v7a System Image 
    Version:   3 
    Dependencies: 
     patcher;v4 

system-images;android-25;android-wear;x86 
    Description:  Android Wear Intel x86 Atom System Image 
    Version:   3 
    Dependencies: 
     patcher;v4 

system-images;android-25;google_apis;arm64-v8a 
    Description:  Google APIs ARM 64 v8a System Image 
    Version:   4 

system-images;android-25;google_apis;armeabi-v7a 
    Description:  Google APIs ARM EABI v7a System Image 
    Version:   4 

system-images;android-25;google_apis;x86 
    Description:  Google APIs Intel x86 Atom System Image 
    Version:   4 

system-images;android-25;google_apis;x86_64 
    Description:  Google APIs Intel x86 Atom_64 System Image 
    Version:   4 
相關問題