loading...

Update the Android SDK for a Visual Studio Build Tools installation

christophweigert profile image Christoph Weigert Originally published at christophweigert.com on ・2 min read

Update the Android SDK for a Visual Studio Build Tools installation

We recently set the Target Framework Version for our mobile app to SDK Version 29. On two of our three build agents, we had no issues because they were regular Visual Studio instances running on developer machines. But one build agent only had the Visual Studio Build Tools installed without any GUI.

After some digging in the Visual Studio and Android SDK folder, I couldn't find the AndroidSdkManager.exe that's provided from the regular Visual Studio Installation.

Update the Android SDK for a Visual Studio Build Tools installation
The AndroidSdkManager.exe is not available for Build Tools only installations.

After searching the Android Developer site, I found an article that explained how to update or install SDKs by the command line:

[

sdkmanager | Android Developers

The sdkmanager is a command line tool that allows you to view, install, update, and uninstall packages for the Android SDK.

Update the Android SDK for a Visual Studio Build Tools installationAndroid Developers

Update the Android SDK for a Visual Studio Build Tools installation
](https://developer.android.com/studio/command-line/sdkmanager)

On the build agent, the path was

C:\Program Files (x86)\Android\android-sdk\tools\bin

Start a PowerShell Session (Shift+Right-click) and type

.\sdkmanager.bat --list

You will see a list of all installed android tools.

Update the Android SDK for a Visual Studio Build Tools installation

The last output of the previous command will be available updates.

Update the Android SDK for a Visual Studio Build Tools installation

Make sure to install those by running

.\sdkmanager.bat --update

But be careful, you have to accept the SDK License Agreement.

Back to our missing build-tools and platform version we have to issue another command

.\sdkmanager.bat "build-tools;29.0.3"

.\sdkmanager.bat "platforms;android-29"

Update the Android SDK for a Visual Studio Build Tools installation

Now you can trigger a build from your CI pipeline and see if everything is working.

Discussion

pic
Editor guide