2

There's a method ActivityManagerCompat.isLowRamDevice(), and I'm trying to figure out how to test it. I've tried the following to get it to return true, but it's always false:

  • Create a new emulator with 128 MB of RAM (Still returns false)
  • adb shell setprop ro.config.low_ram true (Fails. Doesn't change the property)
  • add shell setprop debug.force_low_ram true (Sets the property, but need a development build of Android)
  • Searching online for a "Low Ram Emulator" to test with

How can I test ActivityManagerCompat.isLowRamDevice() without compiling the OS from scratch?

Jason
  • 13,563
  • 15
  • 74
  • 125

1 Answers1

1

Answer: You need root access on the Emulator

Then you can do: adb shell setprop ro.config.low_ram true

See https://stackoverflow.com/a/45668555 for how to get root access on an emulator.

Jason
  • 13,563
  • 15
  • 74
  • 125