Skip to content

Instantly share code, notes, and snippets.

@dtmilano
Created January 25, 2018 04:35
Show Gist options
  • Save dtmilano/e4485dd7285b5f6fcff63a69ec3449c8 to your computer and use it in GitHub Desktop.
Save dtmilano/e4485dd7285b5f6fcff63a69ec3449c8 to your computer and use it in GitHub Desktop.
Plots the dumpsys output using AndroidViewClient/culebra
def __plot_dumpsys_meminfo(self, pkg, activity, method=None):
self.device.shell("am force-stop %s" % pkg)
for n in range(20):
if n % 5 == 0:
self.device.shell(
"run-as %s pgrep -L 10 %s" % (pkg, pkg))
self.device.startActivity("%s/%s" % (pkg, activity))
time.sleep(2)
if method:
method()
self.plot.append(Dumpsys(self.device, Dumpsys.MEMINFO, pkg))
self.device.press('BACK')
time.sleep(0.5)
self.device.press('BACK')
time.sleep(0.5)
self.device.press('HOME')
time.sleep(0.5)
self.plot.plot()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment