Every developer has gone through a long afternoon of making a bunch of tiny changes to their app, rebuilding and running it, then repeating the same steps just to get back to a point where they can test the changes they just made. Forget it, those days are done! Android Studio 2.0 just hit the Canary channel and its headlining feature allows you to push changes from your computer to an app while it's running and see results right away. Also joining the latest release is a brand new GPU Profiler tool that can make OpenGL ES development significantly easier.
The Instant Run feature has been mentioned previously during Google I/O 2015, but it has been under wraps until now. When enabled, Android Studio will package up the changes for each subsequent build of an app and push them to an emulator or attached device to be run immediately. Some code changes can be run in place, but many changes to code or resources will require the Activity (or the whole app) to restart. This means some of your application state can remain intact so it will feel like your changes occur seamlessly.
Instant Run is enabled by default on newly created projects and it can be turned on for existing apps in the project settings at Build, Execution, Deployment -> Instant Run. Build scripts will have to be updated to use v2.0.0-alpha of the Gradle plugin. As always, this is still very new and may not be completely stable. Since the app process remains in memory, which may lead to some complications, it can always be stopped by clicking the Stop button in Android Studio. Further details are available at the Instant Run documentation on the Android Tools Project Site.
Another major addition is a brand new GPU Profiler tool capable of closely examining OpenGL ES execution. This allows developers to record full sessions and jump to any frame or texture. This can be useful for exposing logical mistakes and discovering rendering issues much more easily.
The GPU Profiler is not currently installed automatically, so it must be downloaded separately from the Tools section of the SDK Manager in Android Studio. (It doesn't appear in the classic Standalone SDK Manager.) For more details and a guide on how to use the new GPU Profile, check out the documentation on the Android Tools Project Site.
More To Come
Instant Run and the GPU Profiler are fantastic additions and they will have pretty significant effects on developer workflow. The Tools team notes that there are still many more features coming to Android Studio v2.0, so this is just the beginning. There will be many other changes discussed over the next few weeks, so keep an eye out for all of the great new toys we'll have to work with. Of course, we're going to have a lot less of this...
Source: XKCD - "Compiling"
As always, updating to the latest build is as simple as setting your update channel to follow Canary builds and checking for the latest version. Preview builds of Android Studio may not be entirely reliable, so it's always advised that developers keep a separate copy of the beta or stable releases if they rely on Android Studio for work.
- Android Developers Blog