2
votes

I need to use the command line sdkmanager to update android tools. I must not use Android studio to do this. However, if it works on Linux & Mac, it failed on Windows. I received

"Warning: An error occurred during installation: Failed to move away or delete existing target file: C:\android-sdk\tools"

Why it doesn't work ? Is there a way to perform this ?

1

1 Answers

1
votes

See this other question: Can't update \tools - Android SDK Command Line Tools for Windows


Yeah that's quite funny. A way to do that is to copy the tools folder to another place (let's say C:\temp\). Then direct into the C:\temp\tools\bin\, open the cmd prompt there and run your update commands as such:

sdkmanager.bat --sdk_root=sdkRootPath --command

Where sdkRootPath is path to your original SDK folder (C:\testinstall\sdk\). Once that is done, delete the C:\temp\tools\ copied folder.