android sdk sdkmanger无界面使用方法(命令行更新SDK)

刚刚部署安装sdk最新版本发现已经没有GUI界面了,只能使用命令去下载更新,版本号26.0.2(MAC)


主要使用的更新命令:

sdkmanager --update

sdkmanager "platform-tools" "platforms;android-26"



全部的下载内容可以使用sdkmanager -list查看

还可以通过“sdkmanager --package_file=下载清单文件路径”进行批量下载

下载清单只需要放置-list中的名称,每个换行


详细使用方式可以参考官方文档,链接如下,不能翻墙的同学可以参考下面的黏贴:

https://developer.android.com/studio/command-line/sdkmanager.html



The sdkmanager is a command line tool that allows you to view, install, update, and uninstall packages for the Android SDK. If you're using Android Studio, then you do not need to use this tool and you can instead manage your SDK packages from the IDE.

The sdkmanager tool is provided in the Android SDK Tools package (25.2.3 and higher) and is located inandroid_sdk/tools/bin/.

Usage


You can use the sdkmanager to perform the following tasks.

List installed and available packages

sdkmanager --list [options]

Install packages

sdkmanager packages [options]

The packages argument is an SDK-style path as shown with the --list command, wrapped in quotes (for example, "build-tools;26.0.2" or"platforms;android-26"). You can pass multiple package paths, separated with a space, but they must each be wrapped in their own set of quotes.

For example, here's how to install the latest platform tools (which includes adb and fastbootand the SDK tools for API level 26:

sdkmanager "platform-tools" "platforms;android-26"

Alternatively, you can pass a text file that specifies all packages:

sdkmanager --package_file=package_file [options]

The package_file argument is the location of a text file in which each line is an SDK-style path of a package to install (without quotes).

To uninstall, simply add the --uninstall flag:

sdkmanager --uninstall packages [options]
sdkmanager --uninstall --package_file=package_file [options]

Update all installed packages

sdkmanager --update [options]

Options


The following table lists the available options for the above commands.

Option Description
--sdk_root=path Use the specified SDK path instead of the SDK containing this tool
--channel=channel_id Include packages in channels up to channel_id. Available channels are:

0 (Stable), 1 (Beta), 2 (Dev), and 3 (Canary).

--include_obsolete Include obsolete packages in the package listing or package updates. For use with --list and --updateonly.
--no_https Force all connections to use HTTP rather than HTTPS.
--verbose Verbose output mode. Errors, warnings and informational messages are printed.
--proxy={http | socks} Connect via a proxy of the given type: either http for high level protocols such as HTTP or FTP, or socks for a SOCKS (V4 or V5) proxy.
--proxy_host={IP_address |DNS_address} IP or DNS address of the proxy to use.
--proxy_port=port_number Proxy port number to connect to.
Note: If you want to install packages for an operating system different from the current machine, set the  REPO_OS_OVERRIDE environment variable to either "windows", "macosx", or "linux".
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值