How to setup Travis CI for an Xamarin Android Project

mishtyNaikmishtyNaik INMember ✭✭

I am trying to build and deploy Xamarin project using Travis. I have a android, ios, 1 shared project and 2 PCL projects. I would to build and deploy .APK and .IPA file using travis continuous integrations.
No luck in finding any helpful post.

Here is my .travis.yml file:

os:
- osx

env:
global:
- ANDROID_COMPONENTS=build-tools-25.0.1,android-24,extra-android-support,extra-google-google_play_services,extra-google-m2repository,extra-android-m2repository
- ANDROID_LICENSES=android-sdk-license-c81a61d9
- MONO_VERSION=4.6.2
- MONO_ANDROID_VERSION=7.0.2-42

before_install:
- yes | sdkmanager "platforms;android-27"

install:
- curl -L https://raw.github.com/embarkmobile/android-sdk-installer/version-2/android-sdk-installer | bash /dev/stdin --install=$ANDROID_COMPONENTS --accept=$ANDROID_LICENSES
- source ~/.android-sdk-installer/env
- wget "http://download.mono-project.com/archive/${MONO_VERSION}/macos-10-universal/MonoFramework-MDK-${MONO_VERSION}.macos10.xamarin.universal.pkg"
- sudo installer -pkg "MonoFramework-MDK-${MONO_VERSION}.macos10.xamarin.universal.pkg" -target /
- wget "https://dl.xamarin.com/MonoforAndroid/Mac/xamarin.android-${MONO_ANDROID_VERSION}.pkg"
- sudo installer -pkg "xamarin.android-${MONO_ANDROID_VERSION}.pkg" -target /
- /Library/Frameworks/Mono.framework/Commands/nuget restore projName.Mobile.sln

script:
- /Library/Frameworks/Mono.framework/Commands/msbuild /t:SignAndroidPackage /p:Configuration=Release projName.Mobile.Android.csproj

Any help would be appreciated.

Sign In or Register to comment.