2

Since I've read this I've been trying to create an emulator where I can use the "Show GPU Overdraw".

I followed the tips here and there, but in the new tools, when creating a new AVD, I find no way of enabling the GPU emulation. That's probably why I don't see the GPU Overdraw in the emulator, despite having the "Show GPU Overdraw" in the emulator's Developer Settings (note: I am running the emulator via eclipse with the "-gpu on" option)

So has anyone been able to have an emulator to display the GPU Overdraw?

pandre
  • 6,685
  • 7
  • 42
  • 50

2 Answers2

5

It's working just fine with the emulator as well.

Make sure you've got "Use host GPU" enabled when setting up the AVD, and you need to be running Android 4.2. Previous versions of Android don't include the feature.

Other than that, it's just a matter of enabling the "Show GPU Overdraw" setting in Developer options, and then restart the application you want to analyze.

You need to make sure that the application has hardware acceleration enabled, otherwise it won't be drawn by the GPU, and thus you can't show the GPU overdraw. Alternatively, use the "Force GPU rendering" option in developer settings on the Android device.

Here's a screenshot of an emulator running Android 4.2 with the option enabled:

enter image description here

And here's my AVD setup, in case you want to have a look at that:

enter image description here

Michell Bak
  • 13,182
  • 11
  • 64
  • 121
  • I guess I must have to use the intel atom (x86) CPU in order for this to work, right? However, I need the Google APIs and when I select them, I don't have the option to select the CPU (ARM-armeabi-v7a is selected and the field is disabled) – pandre Mar 15 '13 at 14:50
  • I'm not sure if that matters, you can try it out. It simply makes Android faster ecause it can run on the x86 architecture rather than an emulated CPU, so I highly doubt that it changes anything. – Michell Bak Mar 15 '13 at 14:54
  • Thanks for the tips; I guess it doesn't matter the emulator CPU that is shown; however, although I see that gpu overdraw is shown in some emulator apps (ex: messaging, browser), I don't see it in my app. Any idea why? – pandre Mar 15 '13 at 15:17
  • I guess the displaying of GPU overdraw also depends on the target/min version declared in manifest. I had to increase the target/min version in order for this to work in my app – pandre Mar 15 '13 at 16:26
  • @NeTeInStEiN helped out on this: App needs to target at least API 14 in order for GPU Overdraw to be shown – pandre Mar 15 '13 at 16:52
  • Really? That's weird. API level 14 is Android 4.0 - 4.2 is 17, and it isn't available in versions prior to 4.2. Anyway, you should always target the latest version of Android (which is currently 17), unless you've got a *really* good reason not to. – Michell Bak Mar 15 '13 at 16:53
1

You have to compile to have at least a minVersion=4 on the AndroidManifest and compile to target=14

neteinstein
  • 17,529
  • 11
  • 93
  • 123
  • Any particular reason for this? I'm just wondering since it wasn't added until Android 4.2. – Michell Bak Mar 16 '13 at 19:03
  • Don't really know... empiric knowledge. – neteinstein Mar 18 '13 at 12:35
  • 1
    I'm fairly sure it'll work on all applications that are hardware accelerated. That's enabled by default when targeting API level 14, so that might be what's triggering it. Targeting API level 11 and enabling hardware acceleration might also do the trick. – Michell Bak Mar 18 '13 at 12:41