GAPID supports tracing all OpenGL ES and Vulkan calls made by an Android application. This works whether the application is pure Java, native or hybrid.

Dependencies and prerequisites

  • A device running Android Lollipop 5.0 (or more recent).
  • Either a debuggable application, or a device running a ‘rooted’ user-debug build.
  • Android SDK installed on the host machine.
  • Android hardware device connected through USB.
  • The device must have USB debugging enabled and the host machine must be authorized for debugging.

Taking a capture

Click the Capture Trace... text in the welcome screen, or click the FileCapture Trace toolbar item to open the trace dialog.

1
2
3
4
5
6
7
8
9
  1. From the API drop-down, select the graphics API you want to trace.

  2. From the Device drop-down, select the Android device.

  3. Using the ... button, select the Android Activity you want to trace.

  4. Select an output directory.

  5. Select an output file name.

  6. If you wish to automatically stop tracing after N frames, then use a non-zero number for Stop After.

  7. If you wish to start tracing as soon as the application is launched, enable the Trace From Beginning option. If option is set, then in the tracing dialog, you must press Start to start the capture. Tracing OpenGL ES calls currently requires recording form the very start of the application. If the part of the application you want to debug is takes significant time to reach from application startup, consider creating a separate Activity that launches straight into the part of the application you care about.

  8. If you would like to erase the package cache before taking the trace, enable the Clear package cache option.

  9. If tracing an OpenGL ES application you likely want to keep the Disable pre-compiled shaders option enabled. This option fakes no driver support for pre-compiled shaders, usually forcing the application to use glShaderSource(). GAPID is currently unable to replay captures that uses pre-compiled shaders.

Click OK to begin the trace.

Known issues

Please close any running instances of Android Studio before attempting to take a trace. #911