0

Ive started my first a xamarin forms project. I have given up all simulators a while ago because of slow ...everything

The app performance itself is another thing, but Im talking about slow build and deploy times. This, in combination with that the app just crashes or gets a timeout when fetching the actual error is just gut-wrenching and I spend half my days waiting... ´nuff ranting right?

Are there specific project structure, for example so you can do most of your code through unit test for example? sadly the most trial and error I do has to do with gui-stuff.

I have trued Gorilla player, but it was harder that I thought to get it running, I have an open case at Gorilla-team..

Any tips to avoiding build->deploy to device is veeeee...extremely welcome.

Cowborg
  • 2,645
  • 3
  • 34
  • 51
  • Disable anti-virus for your source code folders. Other than that, I don't know of any tricks. I use visual studio for mac on a macbook pro i5 and don't find the load/build times to be very slow. I use simulators the vast majority of the time without issue, in fact the iOS simulators are faster than loading to a device. I used to use windows without much issue as well. Do you have a slow machine? – Ben Reierson Dec 03 '18 at 21:05

2 Answers2

0

Since I don't know your hardware setup I am going to propose different solutions. Maybe one of them might help.

  • Pick the platform that runs the fastest. When developing on a Windows machine, then probably the UWP project builds the fastest (since you cut out the Mac in the daisy build chain).
  • When using an Android simulator make sure to fully use hardware acceleration Making the Android emulator run faster
  • Visual studio for Mac beats its Windows counterpart hands down when it come to build times in my experience. I gave up on developing XF Apps on Windows since I was having countless build issues and some builds took forever. The situation improved dramatically when moving to a Mac.
  • Maybe you could also try using the Live Player which should give you immediate feedback when it comes to you UI https://learn.microsoft.com/en-us/xamarin/tools/live-player/
  • Adding unit tests might also speed up things considerably. NUnit is a pretty popular framework.
Mouse On Mars
  • 1,086
  • 9
  • 28
  • I can confirm building an iOS app using VS for Mac is significantly faster than using a VS on Windows. As a result, I've been doing most of my development targeting iOS, and then tweaking for Android/UWP optimisation. – Tom Dec 04 '18 at 09:35
0

Another answer mentions that building to UWP is fastest, but I don't target UWP ever so I wouldn't know about that. I just do iOS and Android. Android is faster. We also have the question of simulator/emulator vs real devices. Of the full gamut of options out there to run the app, I've found that building to a physical Android device is the fastest way to build/run.

You could also check the project properties to make sure you have all optimizations set up for that, such as (for Android in particular):

  1. Use Shared Runtime
  2. Use Fast Deployment
  3. Linking: None
  4. DISABLE ProGuard

Aside from building all the way to a phone every time to test things, setting up your project for unit testing that incorporates mocks can also get you going faster. That would typically involve dependency injection and a unit testing framework. I have a Xamarin.Forms app that does just that on Github if you want to see how to do that.

KRA2008
  • 121
  • 1
  • 11