问题
The version of commandlinetools downloaded is commandlinetools-win-6200805_latest.zip
. Unzip this I got the directory as following:
.
└── tools
├── NOTICE.txt
├── bin
├── lib
└── source.properties
Then I change the directory name from commandlinetools-win-6200805_latest.zip
to sdk
and copy sdk
to C:\AndroidSdk
, which is a behavior of file management.
I have read the mannual of sdkmanager provided by Android.
When I using the command sdkmanager --list
, the batch file gave me the warning information as following:
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)
I got a workaround from this answer, and my env value ANDROID_HOME
is C:\AndroidSdk\sdk
and I run sdkmanager --sdk_root=%ANDROID_HOME% "platform-tools"
in C:\AndroidSdk\sdk\tools\bin
.
It works fine setting the common argument --sdk_root
, but it's complicated.
I thought there is some wrong with the usage or path of sdkmanager, but I cannot prove that. And I want to know the method to operate sdkmanager
without --sdk_root
in my case.
来源:https://stackoverflow.com/questions/60735616/how-to-configure-android-sdk-correctly-using-commandlinetools-in-windows