4

It takes very long to build and deploy the iOS solution to a device using the Xamarin Mac agent. It is taking me around 5-5.5 minutes to build. The Xamarin.Android solution only takes 2 minutes to build. I’ve tried deleting the bin and object folders, as well as restarting/resetting various things:

  • Disconnecting and re-connecting the PC to the iMac
  • restarting Visual Studio
  • restarting PC
  • restarting iMac
Juan
  • 95
  • 2
  • 5
  • 1
    iOS build times are highly dependent upon your Mac hardware (cpu/ram/disk) and the type of network connection you are using from your PC to your Mac. – SushiHangover Sep 12 '17 at 04:41
  • @SushiHangover The iMac that I'm using has decent specs and the network connection seems to be stable, so I think my issue is more software-related. – Juan Oct 03 '17 at 21:56

1 Answers1

9

As @SushiHangover mentioned, to update your hardware is the effective way to reduce the build and deploy time.

Also, there're some software-level methods to speed up your build and deploy time.

  1. Enable incremental builds. When this option is enabled, IDE only deals with the parts which you changed. Refer to Xamarin.iOS Build Improvements.

    this is a compilation mode where each assembly is compiled into a separate shared library. When this is enabled, a change in one assembly will only require the native code for that assembly to be uploaded, which will significantly reduce the amount of data that has to be deployed to a device for each build.

    Also, you need to update the Linker Behavior, for device Link all is the fastest and for simulator Don't link is the fastest. More details you can refer to How to speed up MonoTouch compilation time? .

  2. Enable device-specific builds. When this is enabled, Xamarin will only build for the particular device you selected. Otherwise, it will build for all architectures. This feature can save much time when you debug on particular device.

These settings locates at Properties->iOS Build. enter image description here

Kevin Li
  • 2,258
  • 1
  • 9
  • 18
  • 1
    Thanks. I enabled incremental builds and device-specific builds. This decreased the build time from around 5 mins to 2.5 mins on a clean build. I had issues with changing the Link Behaviour though. I didn't update the Link Behaviour since when I changed it to to "Link Framework SDKs Only" or "Link All", the app crashed. – Juan Oct 03 '17 at 21:51
  • Device specific builds also uses a lot of disk space just FYI. as it will generate a build for each device under a specific folder – Emil Jun 05 '23 at 15:45