Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xamarin Android Visual Studio Slow debugging

Tags:

xamarin

Have just started trial of Xamarin using the supplied Task solution (android). Stepping through code is slow. Is this because of the emulator or Xamarin in general? Do people debug using real devices?

Many Thanks

Neil

like image 393
Neil Avatar asked Mar 14 '13 10:03

Neil


4 Answers

The emulator is very slow in general.

For a better experience, do try using the Intel Emulators - http://docs.xamarin.com/guides/android/deployment,_testing,_and_metrics/configuring_the_x86_emulator - but these are still not as good as a real device.

like image 62
Stuart Avatar answered Nov 16 '22 22:11

Stuart


As of May 2015, debugging Xamarin Android applications on an emulator is no longer slow - in fact it is very comparable to a real device if using the right tool and configuring it properly.

  • The Xamarin Android Player provides a virtual machine image to run in VirtualBox that is super-fast.
  • Intel is providing special images to run the emulator with special images and when turning on "Use host GPU" it runs pretty fast.

Xamarin Android Player in action (left). Correctly configured Android Virtual Device that uses Intel Image and host GPU (right).

The only difference that I realized is that the Xamarin Android Player is slightly faster, especially when deploying the app and attaching debugger (which makes is superior to the standard Emulator, which otherwise works fine too).

And by the way: you should definitely enable Fast Deployment in Visual Studio:

enter image description here

like image 32
Alexander Pacha Avatar answered Nov 16 '22 22:11

Alexander Pacha


Speed is dependent on your development device performance. Debugging through real android device can provide you much faster steps through. Although if problem which I am solving isnt in UI layer (my projects often consists from two projects - UI and Work layer), I am using simple console application with reference on dll with work layer and simply unload project with UI.

Iam using Visual Studio 12 which screams that referenced .dll isnt fully supported but it works perfectly and super fast like in normal console application.

like image 40
Jaroslav Kadlec Avatar answered Nov 16 '22 22:11

Jaroslav Kadlec


I'm currently using Xamarin Studio. In project settings you can find a way to build and deploy faster then you deploy to device, but ONLY FOR DEBUG MODE.

In Xamarin Studio, right-click you Android project and go to Options. There, inside Build group, go to Android Build. In Packaging tab, make sure you have both "Use shared mono runtime" and "Fast assembly deployment" checked. It builds for me in less than 8 seconds!!

It also works in Visual Studio: right-click your Android project and go to Properties. In Android Options section, make sure you have "Use shared mono runtime" and "Fast assembly deployment (debug mode only)" checked. I've just tested my Solution and it seems to run as fast as in Xamarin studio.

As I mentioned, I actually use only Xamarin Studio and it's very fast. Obviously it will take much more time if it's you first deploy to a AVD (Android Virtual Device = emulator) since the shared mono runtime will also be deployed, but the consecutive ones will be lightning speed! :)

Remember also to use this fast deployment only for debugging, never for Release mode. I've tested with an AVD running Android 2.3 and one running Android 4.0.3 and then both works as expected. This deployment configuration to AVD is faster than any device I've tested, but it only seems to work in emulator, not in my test devices. In my devices the app stops responding as soon as it opens.

Do not forget to comment here if it works fine for you.

like image 41
Rafael Brasil Avatar answered Nov 16 '22 23:11

Rafael Brasil