Search code examples
azure-devops.net-6.0net6.0-android

AzureDevOps Install Android Version from Pipeline


We are building a net6.0-android app using AzureDevOps, we need to use an Android API level that is not installed on the macos-13 agent by default.

Is there a way for us to install the particular android version we need via the pipeline?


Solution

  • Is there a way for us to install the particular android version we need via the pipeline?

    Based on your requirement, you can use the SDKmanager tool to install the particular android version.

    Here is an example:

    Bash Script:

    steps:
    - bash: |
       brew install --cask android-commandlinetools
       
       brew install --cask xamarin-android
       
       
       echo y | sdkmanager 'build-tools;31.0.0' --sdk_root=/Users/runner/Library/Android/sdk
       
       echo y | sdkmanager "platform-tools" "platforms;android-31" --sdk_root=/Users/runner/Library/Android/sdk
       
       
       ...
    

    Note: When you use MacOS-13 in Azure DevOps Pipeline, you need to install the Android SDK in the path:/Users/runner/Library/Android/sdk