Android Emulator Snapshots

Want to make any mobile developer flinch?  All you have to do is mention the Android Emulator.  Even with Google’s recent updates this is still a pain point for many developers.

It looks like some relief is here.  Last night on twitter Tony Lukasavage posted a tip on using snapshots.

The Android emulator snapshot enables the ability to save and restore its state to a ‘snapshot’ file in each AVD – so you can usually avoid booting when you start the emulator.  You can read more about this on the Android Tools site here.

In my testing, this is literally a “Go Faster” button and has reduced my load times from 5 minutes to about 1 minute.

Great how do I enable it?

Here is a quick walk through on how I enabled this feature. Before you start make sure you close the Android emulator.

Open the AVD Manager

The first thing you want to do is open the AVD manager.  The easiest way to do this is by going to your <Android SDK Folder>/tools  directory and issuing the terminal command  ./Android AVD as shown below.

AVD Terminal Command

This will open the AVD Manager and show you all of the AVD images you’ve created. The below shows what the AVD Manager looks like on my machine.

AVD Manager

You can see that all of my AVD images have been generated by the Titanium build process.

Enable Snapshot in your AVD image

After you’ve opened the AVD Manager you want to select an AVD Image to enable snapshots. Select your AVD Name and select the Edit button on the right side of the AVD Manager menu.

This will open the AVD Editor screen.  If you have Android Tools r9 or higher you should see a section called Snapshot ( circled below ).  Update the checkbox to enable this feature.

Enable Snapshot

After enabling the snapshot feature press the Edit AVD button.  You will receive a confirmation message similar to the below.

AVD Edit Confirmation

Repeat

You will want to repeat this process with all of your AVD files.

Launch

The next time you launch the emulator for your updated AVD images you’ll see a dramatic improvement in launch speed.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s