From 3398f34697fad9cdc458787243856e586d410d15 Mon Sep 17 00:00:00 2001 From: Michael McGeagh Date: Tue, 11 Apr 2017 16:27:22 +0100 Subject: [PATCH] system.py: gfxinfo_get uses target.execute Redirection to host is unneccessary. Write to file via python instead --- libs/utils/android/system.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) mode change 100644 => 100755 libs/utils/android/system.py diff --git a/libs/utils/android/system.py b/libs/utils/android/system.py old mode 100644 new mode 100755 index 42e8c4dec..de09b5acb --- a/libs/utils/android/system.py +++ b/libs/utils/android/system.py @@ -17,13 +17,10 @@ import logging -from devlib.utils.android import adb_command from devlib import TargetError import os import pexpect as pe -GET_FRAMESTATS_CMD = 'shell dumpsys gfxinfo {} > {}' - class System(object): """ Collection of Android related services @@ -281,8 +278,9 @@ class System(object): :param out_file: output file name :type out_file: str """ - adb_command(target.adb_name, - GET_FRAMESTATS_CMD.format(apk_name, out_file)) + output = target.execute('dumpsys gfxinfo {}'.format(apk_name)) + with open(out_file, 'w') as ofile: + ofile.write(output) @staticmethod def monkey(target, apk_name, event_count=1): -- GitLab