Configuring Graphics Acceleration
Caution: As of SDK Tools Revision 17, the graphics acceleration feature for the emulator is experimental; be alert for incompatibilities and errors when using this feature.
Graphics acceleration for the emulator takes advantage of your development computer's graphics hardware, specifically its graphics processing unit (GPU), to make screen drawing faster. To use the graphics acceleration feature, you must have the following versions of the Android development tools installed:
- Android SDK Tools, Revision 17 or higher
- Android SDK Platform API 15, Revision 3 or higher
Use the Android SDK Manager to install these components:
Note: Not all applications are compatible with graphics hardware acceleration. In particular, the Browser application and applications using theWebView
component are not compatible with graphics acceleration.
To configure an AVD to use graphics acceleration:
- Make sure you have the required SDK components installed (listed above).
- Start the AVD Manager and create a new AVD with the Target value ofAndroid 4.0.3 (API Level 15), revision 3 or higher.
- If you want to have graphics acceleration enabled by default for this AVD, in theHardware section, clickNew, select GPU emulation and set the value toYes.
Note: You can also enable graphics acceleration when you start an emulator using command line options as describe in the next section.
- Name the AVD instance and select any other configuration options.
Caution: Do not select the Snapshot: Enabled option. Snapshots are not supported for emulators with graphics acceleration enabled.
- Click Create AVD to save the emulator configuration.
If you set GPU emulation to Yes for your AVD, then graphics acceleration is automatically enabled when you run it. If you did not enableGPU emulation when you created the AVD, you can still enable it at runtime.
To enable graphics acceleration at runtime for an AVD:
- If you are running the emulator from the command line, just include the
-gpu on
option:emulator -avd <avd_name> -gpu on
Note: You must specify an AVD configuration that uses Android 4.0.3 (API Level 15, revision 3) or higher system image target. Graphics acceleration is not available for earlier system images.
- If you are running the emulator from Eclipse, run your Android application using an AVD with the
-gpu on
option enabled:- In Eclipse, click your Android project folder and then select Run > Run Configurations...
- In the left panel of the Run Configurations dialog, select your Android project run configuration or create a new configuration.
- Click the Target tab.
- Select the AVD you created in the previous procedure.
- In the Additional Emulator Command Line Options field, enter:
-gpu on
- Run your Android project using this run configuration.