Skip to content

Most visited

Recently visited

navigation

Analyze OpenGL with Tracer

Tracer is a tool for analyzing your app's OpenGL for Embedded Systems (ES) code. The tool allows you to capture OpenGL ES commands and frame by frame images to help you understand how Android is executing your graphics commands.

Tracer captures OpenGL ES command execution logs and can also capture progressive images of the frames generated by those commands. The tool saves this information to a .gltrace file that you can use to perform logical and visual analysis of your OpenGL ES code.

To capture an OpenGL ES trace, proceed as follows:

  1. From Android Studio, start Android Device Monitor by selecting Tools > Android > Android Device Monitor from the menu bar.
  2. In the Android Device Monitor, activate the perspective for Tracer by selecting Window > Open Perspective from the menu bar.
  3. Select Tracer for OpenGL ES and click OK.
  4. Connect a device running Android 4.1 (API Level 16) or higher. If you're using a physical device, make sure it's enabled for debugging.
  5. Click the trace capture button from the toolbar. This opens the OpenGL ES Trace Options dialog, as shown in figure 1.

    Figure 1. OpenGL ES Trace Options dialog box.

  6. Configure your trace as follows:
    • Select your device from the Device dropdown menu.
    • In the Application Package field, enter the full app package name containing the activity you want to trace.
    • In the Activity to launch field, enter the class name of the activity you want to trace. If you are tracing the default activity for your app, you can leave this field blank.
    • Enable the Data Collection Options you want by checking the appropriate checkboxes. If you want to capture progressive frame images for each drawing call, select the Read back currently bound framebuffer on glDraw*() checkbox. Be aware that using this option can result in large trace files.
    • Enter a path and filename for the trace output in the field next to Destination File.
  7. Click Trace to start the trace capture.
  8. Interact with your app while the tool captures tracing information.
  9. In the dialog box, click Stop Tracing to end the tracing session.

After you have generated a trace, you can load it for review and analysis by clicking Open Trace File . After that, select a frame and review the OpenGL ES calls. Drawing commands are highlighted in blue.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)