Created
January 25, 2018 04:35
-
-
Save dtmilano/e4485dd7285b5f6fcff63a69ec3449c8 to your computer and use it in GitHub Desktop.
Plots the dumpsys output using AndroidViewClient/culebra
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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