有没有一种方法来自动Android SDK的安装? [英] Is there a way to automate the android sdk installation?

查看:217
本文介绍了有没有一种方法来自动Android SDK的安装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我已经通过用户界面下载并安装Android SDK ABD AVD管理器,然后安装这些API,工具。有没有一种方法来自动完成这个过程?

Now I have to download and install the Android SDK abd AVD Manager, and then install the the APIs, tools through the UI. Is there a way to automate this process?

推荐答案

您可以到自动化的接近可能是:

The closer you can get to automation probably is:

$ android update sdk --no-ui

Android的提供这些选项自动更新:

android provide these options for automatic updates:

Action "update sdk":
  Updates the SDK by suggesting new platforms to install if available.
Options:
  -f --force    Forces replacement of a package or its parts, even if something has been modified
  -u --no-ui    Updates from command-line (does not display the GUI)
  -o --obsolete Installs obsolete packages
  -t --filter   A filter that limits the update to the specified types of packages in the form of
                a comma-separated list of [platform, tool, platform-tool, doc, sample, extra]
  -s --no-https Uses HTTP instead of HTTPS (the default) for downloads
  -n --dry-mode Simulates the update but does not download or install anything

如果要列出可用的包进行安装,你可以使用

If you want to list which packages are available for installation you can use

$ android list sdk

,你会得到包的顺序列表,例如:

and you'll obtain an ordered list of packages, for example

Packages available for installation or update: 9
   1- ARM EABI v7a System Image, Android API 15, revision 2
   2- Intel x86 Atom System Image, Android API 15, revision 1
   3- Android Support, revision 8
   4- Google AdMob Ads SDK, revision 6
   5- Google Analytics SDK, revision 2
   6- Google Play APK Expansion Library, revision 1
   7- Google Play Billing Library, revision 2
   8- Google Play Licensing Library, revision 2
   9- Google Web Driver, revision 2

你也可以,如果你使用限制只更新到所需的组件 - 过滤器选项

$ android update sdk --filter <component> --no-ui

,其中组分是一种或多种

where component is one or more of

  • Android的名单SDK返回的数字(即 1 ,也知道作为的包指数的)
  • 附加
  • 文档
  • 额外
  • 平台
  • 平台工具
  • 样品
  • 系统映像
  • 工具
  • the numbers returned by android list sdk (i.e. 1, also know as package index)
  • add-on
  • doc
  • extra
  • platform
  • platform-tool
  • sample
  • source
  • system-image
  • tool

,或者可以是一个或多个特定标识符。举例来说,如果你只是想下载一个小的一套具体的包,你可以这样做:

or can be one or more specific identifiers. For instance, if you just want to download a small set of specific packages, you could do this:

$ android update sdk -u --filter platform-tools,android-16,extra-android-support

和你刚刚得到的平台工具,API级别16和支持jar包。这是非常方便的,如果你正在构建一个版本的机器仅将不得不支付下载所有多余的东西,你永远也不会使用。

and you'll just get the platform tools, api level 16 and support package jar. This is really handy if you're building a build machine only and would have to pay for downloading all the extra stuff that you'll never use.

要见你可以使用--help可用选项,例如:

To see the available options you can use --help, for example

$ android --help list sdk

       Usage:
       android [global options] list sdk [action options]
       Global options:
  -h --help       : Help on a specific command.
  -v --verbose    : Verbose mode, shows errors, warnings and all messages.
     --clear-cache: Clear the SDK Manager repository manifest cache.
  -s --silent     : Silent mode, shows errors only.

                   Action "list sdk":
  Lists remote SDK repository.
Options:
  -o --obsolete  : Deprecated. Please use --all instead.
  -a --all       : Lists all available packages (including obsolete and
                   installed ones)
     --proxy-host: HTTP/HTTPS proxy host (overrides settings if defined)
     --proxy-port: HTTP/HTTPS proxy port (overrides settings if defined)
  -s --no-https  : Uses HTTP instead of HTTPS (the default) for downloads.
  -e --extended  : Displays extended details on each package
  -u --no-ui     : Displays list result on console (no GUI) [Default: true]

这篇关于有没有一种方法来自动Android SDK的安装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆