Android Studio 2.0 Introduces Hot Code Swapping

by Abel Avram on Nov 24, 2015 |

Android Studio 2.0 has hit the canary channel, and the focus of the improvements in this release is to make the development as streamlined as possible, including hot code swapping, faster builds, faster emulator, GPU Profiler and Debugger, and running multiple types of tests in the same time.

Perhaps the most significant enhancement coming in Android Studio 2.0 is Instant Run. A code change is immediately (1-2 sec) deployed on a connected physical device or emulator and executed without going through a full or incremental build and APK deployment. The feature was demonstrated during Android Dev Summit 2015 (video). It will be made available on “virtually every emulator on use today” and “every current physical device” that runs Android ICS or later.

Currently, Instant Run supports instance or static method implementation changes and adding/removing a class. It can also handle changes to a string resource but it requires to restart the related activity. A number of changes – editing annotations, fields, method signatures, etc. - are not supported yet, but Google is working on supporting them in the following months.

Android Studio 2.0 comes with a number of other improvements:

  • The initial build time is 2-2.5 times faster
  • Incremental builds are in the “single digits seconds”
  • The emulators are “massively faster than they were before”. A graphic showed the ADB push speed of the emulator being over 15x faster than on Android Studio Emulator 1.0 and over 5 times faster than on a physical device (Nexus 6) due to better I/O. Also, the emulator now uses SMP to take advantage of multicores existing on the development machine.
  • The emulator‘s UI has been rewritten to support drag and drop and resizing
  • The IDE supports other forms of emulation: GPS (including multiple points simulating a route), calls and text messages, battery states
  • It is built on the recently released IntelliJ 15
  • Both Android and Unit Tests can be run in the same time
  • It adds support for deep linking including verification if Google Search can index the application correctly

Last but not least, Android Studio 2.0 has a GPU Profiler and Debugger that can replay a scene frame by frame. This tool is appealing to developers working with OpenGL ES in maps, videos and games.

Rate this Article


Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

For truly "Instant Run" by Neeme Praks

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

1 Discuss
General Feedback
Marketing and all content copyright © 2006-2016 C4Media Inc. hosted at Contegix, the best ISP we've ever worked with.
Privacy policy

We notice you're using an ad blocker

We understand why you use ad blockers. However to keep InfoQ free we need your support. InfoQ will not provide your data to third parties without individual opt-in consent. We only work with advertisers relevant to our readers. Please consider whitelisting us.