6. Speeding up a build (contd.)
• Don’t clean and rebuild unless you absolutely need to
(Stackoverflow question about clean and build vs. rebuild)
• Remove/exclude unnecessary projects, files and resources (esp. drawables)
• Move as much code as possible into PCL so you can isolate builds – PCLs build faster
7. Removing unnecessary programs
• Go to Run and type msconfig
• Hide all Microsoft services
• Uncheck any programs you know you don’t
need unless you need them
• Do the same process in your Task Manager
under the “Startup” tab – disable
unnecessary startup programs
8. Virtualization
• Lets AVD share resources with your host OS
• Execution faster than actual device in many
cases
• Lots of RAM needed – in addition to what the
host OS needs
• Letting it use host GPU boosts performance
further
• Computer should have a minimum 8 GB of RAM
9. First steps
• Uninstall everything: VirtualBox, Genymotion, Xamarin Android Player and your existing AVDs
• Make sure Hyper-V is disabled if you’re on Windows 8 or above
• Delete some or all of your existing AVDs (not needed but to really start afresh)
• Ensure that virtualization (Intel VT-x) is enabled – consult network team if needed
• Remove artifacts from old installations by manually removing registry entries
• Restart your computer
10.
11.
12. • Adjust for best performance or use custom settings
• Affects RAM usage; frees up a bit
• See this (old) and this (new) article about speeding up
your system
13. Intel HAXM
• Get the installer here (if you agree to the T&C)
• Make sure you allot enough RAM during installation – at least 2.5 GB recommended
• Do not run other programs that require virtualization such as Virtual Box or VMWare
• Do not run Xamarin Android Player or Genymotion alongside an HAXM-enabled AVD
• Allow an Intel HAXM—enabled AVD to run in isolation
14. • Choose “set manually” and allot highest possible RAM
• Ensure that the RAM you allot in your AVD is ≤ (less than/equal to) this value
15. Fast-deploying emulators
• Deployment is noticeably faster on some emulators
• E.g. deploying on a Nexus 4 is a lot faster than deploying on a Nexus S
• Use Nexus 4 where you can
• Allot enough resources to your emulator – high RAM, high storage capacity, 80-100 heap size
• Set this attribute in your app’s manifest file
android:largeHeap="true"
16. For faster virtual devices
• Install Intel x86 images for all Android APIs you use
• Prefer using a lower API level in your AVD (KitKat and above are resource-intensive)
(See: this page)
• Prefer using a lower screen resolution in your AVD
• Try disabling resource-intensive Windows features
17. Xamarin Android Player
• Runs quite flawlessly on Windows 8.1 64-bit
• Ensure that other virtualization “consumers”/devices are disabled and turned off
• Ensure that Hyper-V is disabled
• On Windows 7, there’ll probably be a few glitches (forum solutions didn’t work either )
• Bunch of known issues acknowledged by Xamarin
• Install this prior to Genymotion
18. Genymotion
• Uses VirtualBox like Xamarin Android Player
• Make sure instances run separately
• Install this after Xamarin Android Player and HAXM
• Bunch of solutions in FAQs and docs
19. Wrapping up
Unless advised in documentation,
• Never run an emulator inside a VM
• Only run one emulator of any type at a time (esp. HAXM, which powers only one AVD at a time)
• Keep an eye on background processes; kill unnecessary processes
• Keep as few (Explorer) windows open as possible
• Prefer AVD+Intel HAXM > Xamarin Android Player > Genymotion