A guide to getting Xamarin.Android ready to use on your distro of choice!
This guide has been tested successfully:
- Arch Linux as of Feb 3, 2018
Note that this is officially unsupported, but it can be used as a loose guide to help in setting this up on your system.
Xamarin has stated that there are no plans to officially support Linux. However, since Xamarin was open sourced, the developers have made it possible to manually install Xamarin.Android, and with some tweaking we can get full debugging support in Rider!
- Latest
mono
packages for your platform
The latest successful artifacts from automated builds for Linux are available here: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android-linux/lastSuccessfulBuild/Azure/
Download the xamarin.android-oss_*.orig.tar.bz2
package to your system and extract it.
See their instructions on building from source.
Install the Android SDK and NDK, then set environment variables:
(You may have to adjust the paths; these are the default for Android Studio)
export ANDROID_SDK_PATH=$HOME/Android/Sdk
export ANDROID_NDK_PATH=$HOME/Android/Sdk/ndk-bundle
Build a test project (there's one in the source repository) for Xamarin.Android.
/path/to/xamarin.android-oss*/bin/Debug/bin/xabuild /path/to/samples/HelloWorld/HelloWorld.csproj
The build should complete successfully.
If you have problems, try adding /verbosity:d
to get detailed output from the build process.
You may have a minor error about libzip.so.4
not being found, just create a symlink to your libzip:
sudo ln -s /usr/lib/libzip.so /usr/lib/libzip.so.4
Next, try building a signed package:
/path/to/xamarin.android-oss*/bin/Debug/bin/xabuild /path/to/samples/HelloWorld/HelloWorld.csproj /t:SignAndroidPackage
This will invoke keytool
and generate a keystore and use it to sign an .apk
file, which
will go to your output directory with a name like YourTestProject-Signed.apk
.
This will enable building Xamarin.Android projects directly from msbuild
.
Please refer to rider-setup.md.