[root@h5-test-dev014-bjdxt9p bin]# ./sdkmanager --list
Warning: Could not create settings
java.lang.IllegalArgumentException
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.<init>(SdkManagerCliSettings.java:428)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:152)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:134)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:57)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Usage:
sdkmanager [--uninstall] [<common args>] [--package_file=<file>] [<packages>...]
sdkmanager --update [<common args>]
sdkmanager --list [<common args>]
sdkmanager --licenses [<common args>]
sdkmanager --version
不管执行什么命令都报错,搜了很多文章都没解决,最后发现需要加上--sdk_root=/usr/local/androidsdk参数才行,/usr/local/androidsdk是我设置环境变量ANDROID_HOME的值
#安装platform-tools工具
./sdkmanager --install "platform-tools" --sdk_root=/usr/local/androidsdk
https://developer.android.com/studio/command-line/sdkmanager