Tips and tricks on how to speed up the time it takes to compile a Xamarin app
Sometimes Xamarin Build times can take a long time, adding delays to our development timeline. Below are tips to reduce the compilation time for Debug Configuration builds.
The screenshots below were created on 10 June 2017 using Visual Studio for Mac v7.0.1 and UITestSampleApp.
These recommendations are only meant for Debug Configuration builds. They will reduce the time for each compilation, but may increase the size of the app and decrease the performance and load-time of the app.
I highly recommend utilizing the Linker for Release Configuration builds; Link SDKs and Frameworks
is my recommended minimum setting. I also highly recommend heavily testing the Release Configuration build of the app because the app may behave differently when the Linker is utilized.
Linker behavior: Don’t Link for Simulator Builds, Link on Devices Builds
Enable incremental builds
Enable device-specific builds
This encourages the compiler to only compile for the targeted device
This allows you to select many supported architectures
Selecting multiple architectures without enabling device-specific builds will cause compilation to take longer
- X86_64 Architecture works for iPhone Simulators 5s and newer
- i386 Architecture works for iPhone Simulators earlier than the iPhone 5s
Optimize PNG Images
CSPROJ
NOTE: This is an experimental setting!
AndroidExplicitCrunch
to the Droid csproj
file
AndroidExplicitCrunch
property to true
in the csproj
file.Thank you to all who have helped contribute to this doc!