Forum Xamarin.iOS

Xamarin.iOS Build for Devices is taking too long

raveroravero USMember ✭✭

Hi fellows,
I'm having several issues with build time for iOS devices (not for the simulator). A build is taking about 5 minutes or more!

I'm using the latest version of Xamarin Studio (6.1.3 Build 19) and the latest version of the Apple SDK's. This is happening on a MBPr 15' i7 16 GB 512 SSD, so It's definitely not an hardware issue (specially because I've never had that kind of issue before on the same machine).

Does anyone facing the same kind of issue?
Regards.

Best Answer

Answers

  • SiddharthMishra.4597SiddharthMishra.4597 USUniversity ✭✭

    Yes I am having the same issue. Don't know why.

  • MarcinKruszynskiMarcinKruszynski USMember ✭✭

    I also have the same issue. Any solution?

  • AlanClarkAlanClark USMember ✭✭✭

    Hi guys! We actually have a pretty cool guide for timing apps with some handy hints for speeding up build times:

    https://developer.xamarin.com/guides/ios/advanced_topics/ios-build-mechanics/

    I'd suggest taking a look at that. However, if this is because you think you've noticed a slow-down since a recent Xamarin update where your project hasn't changed a whole deal, then it might be worthwhile dropping down to a previous version of Xamarin:

    https://kb.xamarin.com/customer/portal/articles/1699777-downgrading

    If you drop back and you're seeing quicker build times than the later release then our engineers are probably going to be eager to take a look. In this case I'd suggest filing a bug:

    https://developer.xamarin.com/guides/cross-platform/troubleshooting/questions/howto-file-bug/

    It'd be great to get people's feedback there!

    Cheers,
    Al

  • ChrisColeTechChrisColeTech USMember ✭✭✭

    @AlanClark said:
    However, if this is because you think you've noticed a slow-down since a recent Xamarin update where your project hasn't changed a whole deal, then it might be worthwhile dropping down to a previous version of Xamarin:

    https://kb.xamarin.com/customer/portal/articles/1699777-downgrading

    one step forward, two steps backwards.

    why even bother releasing updates if each update is worse than the last?

  • AlanClarkAlanClark USMember ✭✭✭

    @KingChrisCole You're paraphrasing me here - that wasn't the tone of my message. We're here to help and to assist with any issues you may come across. My message went on to suggest why you would want to do that and how to make us aware of issues so that we can work with you to address them.

  • sudhir.9350sudhir.9350 INUniversity ✭✭

    Same problem here.. anyone found any suitable workaround or resolutions?

  • AlanClarkAlanClark USMember ✭✭✭

    @sudhir.9350 Please see my message above relating to improving build times and comparing your build times to a previous release of Xamarin to see if things improve and a bug needs to be filed.

  • MarcoTronconeMarcoTroncone GBUniversity ✭✭✭

    It's almost impossible to debug an app on an actual iOS device.

    I've followed the guide but the process is still incredibly slow.

    Honestly it has never been so slow and I think that now Xamarin must do something to improve the performances here.

    I'm still thinking that it is a bug...it's not possible that it is taking so long on a device and it's so fast on a simulator.

    Please let us know something.

  • MichelMoorlagMichelMoorlag USMember ✭✭

    Facing the same issues here. Simulator is decent fast but real device is painfully slow to build. I am testing notifications which can only be done on a real device but testing is horrible.

  • FelipeZunigaFelipeZuniga AUMember

    +1 same issue

  • ChrisColeTechChrisColeTech USMember ✭✭✭
    edited September 2017

    Just checking in...

    Session build time: 00h 14m 09s 927ms

    after latest update

    Microsoft should be ashamed of this performance.

  • ChrisColeTechChrisColeTech USMember ✭✭✭

    3>Done building target "Rebuild" in project "MyProject.iOS.csproj".
    3>
    3>Build succeeded.
    3>
    3>Time Elapsed 00h 09m 44s 54ms

  • jNormenjNormen SEMember ✭✭

    Yes, this is a reason why I and lots of others are now looking into react native...
    The build takes ages just to take a look at some minor fixes...
    And there are many warnings, assembly conflicts messages all the time. Even if the app starts and seems to work fine, it's not ok to have all these errors messages within the build... Hard to guarantee quality to customers...

    It's sad because Xamarin was so promising.

    I can't explain to my customers that I spent 2 days to delivered two small features that had an implementation time of 4h.
    And the rest are just hours of build problems.

    I really hope this gets fixed soon...

  • JohnHJohnH GBMember ✭✭✭✭✭

    @JNormen I am not seeing any of the issues you mentioned, my builds all work correctly for all my apps.
    Also, recompile time for small iterative dev build changes take seconds to build and deploy to my iPhones. Release builds can take a minute however as it does a full rebuild with 2 slices. I am using a 2016 Macbook PRO, however.

  • jNormenjNormen SEMember ✭✭

    @JohnHair said:
    @JNormen I am not seeing any of the issues you mentioned, my builds all work correctly for all my apps.
    Also, recompile time for small iterative dev build changes take seconds to build and deploy to my iPhones. Release builds can take a minute however as it does a full rebuild with 2 slices. I am using a 2016 Macbook PRO, however.

    We have two different Macbook i7 Pro. The problem started when we updated to latest Xamarin version. It was much faster before. We did a migration to .Net Standard 2.0 to see if that could help us but still 5-9 min.

    I put up a UWP version it builds really fast, Android is as slow as it always is. Just iOS that are slow.
    And It does not matter if I build Ipad or set it to iPhone. Also using latest xcode version on our Mac computers.

  • JohnHJohnH GBMember ✭✭✭✭✭

    @JNormen you have checked the usual, right? Only building a single slice for debug builds etc etc?
    You building directly on the mac? Or via Visual Studio on windows?

    You could try creating a new debug configuration, see if that helps.

  • jNormenjNormen SEMember ✭✭

    @JohnHair said:
    @JNormen you have checked the usual, right? Only building a single slice for debug builds etc etc?
    You building directly on the mac? Or via Visual Studio on windows?

    You could try creating a new debug configuration, see if that helps.

    Windows VS .Net with a mac connection. So using Mac as a build machine. Is there any way to see what step it builds?
    What the build process really do? So I can see if it takes time in certain build-action? Like nuget downloading or anything?

    All I can see on VS is just "building" and the slow progress bar :D

  • MigueldeIcazaMigueldeIcaza USXamarin Team Xamurai

    Hello team,

    Would it be possible to get the full build logs for these projects that are taking so long to build?

    http://msbuildlog.com/

    The above wen site shows how to generate a full and detailed build log, this will help us pinpoint exactly why this is taking so long, it should never be taking 30 minutes to build, a slow build for meidum sized project should be 2-3 minutes.

    MIguel

  • diegoxleondiegoxleon ESMember ✭✭
    edited April 2018

    I was having the same issue today, until I changed some build properties, reducing the build time to about 3 minutes!
    This is my setup:

  • JohnHJohnH GBMember ✭✭✭✭✭

    @diegoxleon said:
    I was having the same issue today, until I changed some build properties, reducing the build time to about 3 minutes!
    This is my setup:

    Don't build for multiple architectures in debug builds, just build for the architecture for the device you are about to debug on.

  • diegoxleondiegoxleon ESMember ✭✭
    edited April 2018

    Setting a single architecture:

    • First time (cleaning project): 3:30
    • Afterwards: 1:00

    Awesome!

  • JohnHJohnH GBMember ✭✭✭✭✭

    @diegoxleon said:
    Setting a single architecture:

    • First time (cleaning project): 3:30
    • Afterwards: 1:00

    Awesome!

    Glad you like it! :smile:
    Feel free to Like my post so that it might help others too.

  • Calico_JackCalico_Jack Member ✭✭

    It's 2020, and I am running on a 16GB ram mac with Windows 10 Parallels debugging with iOS and each build takes about 12 minutes. Sometimes I wait 10 minutes and get an error that the Visual Studio lost connection to the mac host or a "Ditto" exited with Code 1. Is there any way to speed up this process?

  • JGoldbergerJGoldberger USMember, Forum Administrator, Xamarin Team, University Xamurai

    @Calico_Jack

    That sounds like it may be a network issue, which would be strange with a VM to Host network connection.

    Hard to be certain though. It would help to get some logs. Can you open a free Xamarin support case so myself or another Xamarin support engineer can assist you in speeding up your iOS builds?
    You can open a free Xamarin support case here: https://support.microsoft.com/en-us/supportforbusiness/productselection?sapId=211dd84f-3474-c3c5-79bf-66db630c92a6

  • BobWhittenBobWhitten USMember ✭✭

    I agree with @JGoldberger that it sounds like an network issue.

    But I believe I have discovered something -- I was getting painfully long build times, to the point of it being unusable (disclosure -- I'm connected to a late 2014 MacMini with 8GB). And I was trying to use the designer for XAML, and it getting stuck.

    I decided to quit using the designer, and do a fresh boot of the Mac at the beginning of each day -- since then, it seems like everything is MUCH improved.

    Hopefully unrelated, I also added verbose logging, because I was having another issue (error report or freeze of Visual Studio), and wanted to submit the logs as part of a bug report. Since I added that, THAT issue seems to have gone away as well.

  • Calico_JackCalico_Jack Member ✭✭
    edited February 17

    @JGoldberger I sent a ticket and even spoke on the phone with a MS support rep about my situation. They asked me to give them my setup:

    16GB Mac book Pro Catalina
    Parallels Windows 10 VM on the macbook
    Visual Studio 2019 on both mac and VM
    Latest Xcode

    I said I would use Visual Studio on Mac, however any time I open the projects I have on there it updates my project files with unnecessary things which makes me MS build host throw exceptions. Even when opened on VS mac it wont run so I need to run via Windows 10 environment.

    At first they thought maybe it was due to me running a Windows VM via parallels on my mac as it might be against mac policy, but after consideration it was found it is not against the policy. They said there have been a rise in complaints like this since Catalina update. They dont know what is the reason why my iOS builds to simulator are slow or why builds to a plugged in iOS device are basically undoable. When I asked what do others do and what do you recommend, they said to get a windows machine and build to my mac host on there instead. They said using Github with testflight seems common, but I guess there is no way to debug with iOS in local environment?

    I feel like this all has something to do with the Visual Studio iOS connection to the mac host for some reason. It hangs during builds and loses connection a lot of the time.

  • JohnHJohnH GBMember ✭✭✭✭✭

    @Calico_Jack you absolutely should be able to build for iOS simulators, I do this all day every day.
    Something you said raised an eyebrow though, I would definitely make sure the mac itself can build using VS4Mac. Identify the issues why it doesn't work and resolve them. Once that is working the builds will be much, MUCH quicker.
    Once the mac builds are working, go back to getting the builds for VS4Win working. I do this at home using Parallels on my mac, although at work I have a separate Windows laptop. Both scenarios work for me, and work well.

Sign In or Register to comment.