在Windows上使用sdkmanager安装android命令行工具

时间:2017-09-19 06:11:53

标签: android cmd android-sdk-tools android-sdk-manager

我正在尝试使用Windows上的sdkmanager安装android命令行工具,以便在SAP Web IDE中进行混合Android应用程序开发。此外,我在代理网络下,当我尝试使用cmd通过命令设置代理时:

sdkmanager --list --verbose --no_https --proxy=http --proxy_host=10.60.11.11 --proxy_port=8080

显示错误:

Info: Parsing C:\Users\10002001\Downloads\sdk-tools-windows-
3859397\tools\package.xml
Info: Parsing C:\Users\10002001\Downloads\sdk-tools-windows-
3859397\tools\package.xml
Info: Failed to validate the XML for the repository at URL 
'http://dl.google.com
/android/repository/repository2-1.xml/repository-12.xml'
 Warning: Errors during XML parse:
Warning: javax.xml.bind.UnmarshalException
- with linked exception:
[java.net.ConnectException: Connection refused: connect]
Warning: Additionally, the fallback loader failed to parse the XML.
Warning: Failed to parse source list at 
https://dl.google.com/android/repository/addons_list-3.xml
Warning: File C:\Users\10002001\.android\repositories.cfg could not be 
loaded.
Installed packages:
 --------------------------------------
tools
Description:        Android SDK Tools 26.0.1
Version:            26.0.1
Installed Location: C:\Users\10002001\Downloads\sdk-tools-windows-3859397\to
ols

done

当我发出此命令来安装平台工具时:

sdkmanager platform-tools

它给出了这个结果:

   Warning: java.net.ConnectException: Connection refused: connect
   Warning: File C:\Users\10002001\.android\repositories.cfg could not be 
   loaded.
   Warning: Failed to download any source lists!
   Warning: Failed to find package platform-tools

请帮助!!

1 个答案:

答案 0 :(得分:0)

使用sdkmanager,您应始终使用代理交换机。我还没有找到办法让它成为系统或用户设置。

sdkmanager platform-tools --no_https --proxy=http --proxy_host=10.60.11.11 --proxy_port=8080

对于文件警告,只需在C:\Users\10002001\.android\repositories.cfg

创建一个空文件

对于连接例外,请确保用户可以访问互联网并尝试在浏览器或wget / curl中打开链接https://dl.google.com/android/repository/addons_list-3.xml