Provide AndroidSDK path to mdtool on mac

159 Views Asked by At

I am building Xamarin.Adnroid project with an mdtool from rakefile as a step in TeamCity build configuration.

The call is:

/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool build "--configuration:Debug" -p:"Project.Droid" -t:Build "Project.sln"

This (and even if I set -p:AndroidSdkDirectory=/Users/user/AndroidSDK) gives an error:

error: The Android SDK could not be found, please set the path to it in the Xamarin.Android SDKs settings panel.

I can use xbuild to build the project and specify the AndroidSDKPath via:

/usr/local/bin/xbuild Droid/Project.Droid.csproj /p:Configuration=Debug /t:SignAndroidPackage /p:AndroidSdkDirectory=/Users/user/AndroidSDK

but sine my solution hots both, Android and iOS projects, I'd like to be able to build both with mdtool.

Note that this question is unrelated to this one since the later of deals with the UI builds which work great in my case.

1

There are 1 best solutions below

0
On

I suggest to open Xamarin Studio on the build host and configure the SDK path under Preferences > SDK Locations > Android. That should fix your problem.