Introduction

When developing an Android* application, you usually need to test, optimize, and debug on many different platforms. While basically every hardware and chip manufacturer provides a set of custom tools for this, developers can find it cumbersome to install and learn how to use all of them. With the latest releases (2014 R2 as of now), Intel® Graphics Performance Analyzers (Intel® GPA), Intel® Frame Debugger, and Intel® VTune™ Amplifier are able to support most mainstream Android 4.x devices regardless of their architecture (ARM* or x86).

We have tested these Intel tools and successfully used them on the ARM Android devices listed below, but basically any Android 4.x device is probably compatible. (Note: ARM*-based devices not shown in the following list are unsupported but may still work with the Intel GPA toolset.):

Model

GPU

Android* Version

Samsung* Galaxy Nexus
(GT-i9250)

Imagination Technologies*
PowerVR SGX540

Android 4.3

Samsung* Galaxy S4
(GT-I9500ZNASER)

Imagination Technologies*
PowerVR SGX544

Android 4.4

Samsung* Galaxy S III
(GT-i9300)

ARM* Mali 400MP

Android 4.3

Google* Nexus 4

Qualcomm* Adreno 320

Android 4.4

Google* Nexus 5

Qualcomm* Adreno 330

Android 4.4

LG* G2 D802

Qualcomm* Adreno 330

Android 4.4

Amazon* Kindle Fire HD

Imagination Technologies*
PowerVR SGX544

Amazon* Fire OS 3.0

Intel® GPA System Analyzer ‒ High-Level View of App Performance

Intel GPA System Analyzer can run on Windows* 7/8.x, Mac* OS X*, and Linux* and can be used to analyze apps running on almost any Android 4.x device connected over ADB. It’s a free tool, part of the Intel GPA suite you can get with dedicated tools for graphics analysis and optimization. If your device is rooted, this tool can analyze any application installed on the device. Otherwise, it can only analyze apps with Internet permission and the debuggable flag set to “true”.

Setting the debuggable flag to “true” in the AndroidManifest is done automatically when you’re doing a debug build with gradle or ant / Android Studio or Eclipse*. But when it comes to analyzing the real performance of an application, you want to run a version that has been optimized for release.

You can manually set this flag to “true” in your manifest, but lint will complain about it and cause your build to abort. You can easily overcome that.

Now, when running, you first get a list of applications running on the device you’ve chosen:

Selecting one will trigger its launch on the device, along with its real-time analysis:

From there, you can drag-and-drop any metric from the left side to see its value evolve in real time. You may not get hardware-specific metrics on every device as their support varies, but you’ll have at least: Target App CPU Load, RAM usage, Device and Network IOs, OpenGL* metrics (draw calls, vertex count, frame time).

In addition to these real-time values, you have the ability to trigger “state overrides” from the bottom left of the window. This will help you determine the current bottleneck in your application:

Normal scene:

With all the textures set to a simple 2x2 one:

With disabled alpha-blending:

Showing wireframe:

You can also disable all the Draw calls. Then, no graphics will be rendered, but if the FPS improves, the bottleneck isn’t on the OpenGL* side.

This will show you a list of applications that you may, or may not, have the right to analyze. Just like with Intel GPA System Analyzer, you may analyze any application on a rooted device. Otherwise, you can analyze only the ones with Internet permission and the debuggable flags set to “true”:

Double-click to launch one and click on “capture” to get a frame. Once it’s done, go back to the previous view and select the captured frame:

You can see all the draw calls that have been made on the left side and the associated simulated OpenGL ES frame buffer on the right side.

A double click on one of these draw calls will allow you to inspect all steps of the OpenGL ES pipeline associated with the draw call, among these:

The primitives and the associated Vertex Buffer Objects

The vertex and fragment shaders:

You can see and modify these shaders and even modify the values they’re receiving. This will modify the simulated frame as well as the rendered frame on your device if it’s still connected!

On supported x86 Android Devices (Intel® reference designs and Dell Venue* 8 with developer image), VTune Amplifier can be used to analyze Java* workloads, get CPU and GPU metrics, and do power analysis. You can find more details at the following links: