Can't update \\tools - Android SDK Command Line Tools for Windows

断了今生、忘了曾经 提交于 2019-11-27 20:00:53

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.

You could temporarily rename to tools.old, run it to install new version in tools and then remove the old one.

cd YOUR-ANDROID-SDK-LOCATION
ren tools tools.old
tools.old\bin\sdkmanager.bat "tools"
dir tools*
del tools.old /q /s
tools\bin\sdkmanager.bat --list

it might be permission issue.Can you try doing sudo or if you on windows try to run terminal as administrator.

I have seen issues where the program is not able to delete the folder either due to lock or some weird reason.

Run cmd in root c:.

c:\>testinstall\sdk\tools\bin\sdkmanager --package_file=c:\testinstall\packx.txt

It may not be the answer to your question but now, i can't exactly remeber the version, you can't update SDK tools directly or using Eclipse, sdk Manager, sdk.bat or android.bat, only way is to update them using Android Studio. It's Google's new policy, i read it somewhere, if i find the link i will share it

My solution was as following:

  1. Delete the Android SDK Tools via Android Studio (although it might complain it failed).
  2. Close Android Studio
  3. Manually delete tools folder from C:\Users\<MyUsername>\AppData\Local\Android\sdk folder
  4. Start Android Studio and then do the install of the Android SDK Tools via Android Studio.

I've had the same issue on windows, I couldn't even rename the directory that is causing the issue.

I found out that adb was still running and ended the process and update/install worked fine without workarounds.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!