title: Xamarin.Android builds/deployments are very slow. How to speed them up?
body: <p>We have a large Xamarin.Android project with two depending projects and a bunch of third party dll's. Doing a debug deployment (without any changes) onto a Hax-x86 Emulator or a Nexus 5 device is painfully slow (> 80 seconds). For comparison the Xamarin.iOS version of the App deploys in under seven seconds onto a real device.</p>
  
  <p>To test the deployment times I've also created a fresh Xamarin.Android project which deploys in about four seconds. When I add a depending project, the deploy time goes up to seven seconds. When I add a layout file to the depending project the deployment time increases to about ten seconds.</p>
  
  <p>Is it possible to speed the Android build and deployment up with Xamarin Studio? A big Eclipse Android Projects is deployed rather quick in comparison.</p>
  
  <h2>Update:</h2>
  
  <p>Just running the installation build step takes about 40 seconds:</p>
  
  <pre><code>time xbuild /t:Install BigApp.csproj
  ...
  ...
  ...
  Time Elapsed 00:00:42.8526970
  </code></pre>
  
  <p>about half the time is spend where the above command prints to console:</p>
  
  <pre><code>Target _CompileDex:
        JavaSourceFiles:
        JavaLibraries:
        ExternalJavaLibraries:
  Tool /usr//bin/java execution started with arguments: -Xmx512M -jar 
  /Users/myname/Library/Developer/Xamarin/android-sdk-mac_x86/build-tools/17.0.0//lib/dx.jar 
  --no-strict --dex --output=obj/Debug/android/bin/classes.dex obj/Debug/android/bin/classes
  /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mandroid/platforms/android-15/mono.android.jar
  /Users/myname/Projects/BigApp/obj/Debug/__library_projects__/TestFlightBindings.Jars.TestFlightLib_1_2.jar
  /Users/myname/Projects/BigApp/obj/Debug/__library_projects__/android-support-v4.jar
  /Users/myname/Projects/BigApp/obj/Debug/__library_projects__/classes.jar
  /Users/myname/Library/Developer/Xamarin/android-sdk-mac_x86/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar
  </code></pre>
  
  <p>When I run the solution from Xamarin Studio this step happens twice. Once for the depending project and once for the main project. I tried to reproduce this behavior on the console with </p>
  
  <pre><code>"/Applications/Xamarin Studio.app/Contents/MacOS/mdtool" -v build "--configuration:Debug -t Install" "BigApp.sln"
  </code></pre>
  
  <p>but that only builds the main project.</p>
  
  <h2>Update:</h2>
  
  <p>I created a small demo project with very slow deployment time:
  <a href="https://github.com/perpetual-mobile/SlowAndroidDeploymentWithXamarin">https://github.com/perpetual-mobile/SlowAndroidDeploymentWithXamarin</a></p>