Ejemplo n.º 1
0
def get_current_activity():
    entry.delete(0, END)  #清空entry里面的内容
    listbox_filename.delete(1.0, END)

    listbox_filename.insert(
        END, "Activity:" + utils.get_focused_package_and_activity())
    listbox_filename.insert(END, "\n\n")

    package_name = utils.get_current_package_name()

    # print package_name

    # print os.popen("aapt dump badging %s" %(get_match_apk(package_name))).readlines()

    # print get_match_apk(package_name)
    for line in os.popen("aapt dump badging %s" %
                         (get_match_apk(package_name))).readlines():
        print line
        listbox_filename.insert(END, line)
Ejemplo n.º 2
0
def gfx():
    gfx = "dumpsys gfxinfo " + utils.get_focused_package_and_activity(
    ) + "|gawk '/Execute/,/Stats/'|gawk NF'{print $1,$2,$3,$4}'|grep -v '^Draw'|grep -v '^Stats'|sed '$d'"
    return gfx
#!/usr/bin/env python
# -*- coding: utf-8 -*-

'''
Created on 2015年1月26日

@author: xuxu
'''

import os
import sys

from scriptUtils import utils

#获取设备上当前应用的“包名/Activity”,结果存放于当前目录下的CurrentActivity.txt

PATH = lambda p: os.path.abspath(p)

if __name__ == "__main__":
    f = open(PATH("%s/CurrentActivity.txt" %os.getcwd()), "w")
    f.write("Activity: \n%s" %utils.get_focused_package_and_activity())
    f.close()
    print "Completed"
    sys.exit(0)
Ejemplo n.º 4
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 2015年1月26日

@author: xuxu
'''

import os
import sys

from scriptUtils import utils

#获取设备上当前应用的“包名/Activity”,结果存放于当前目录下的CurrentActivity.txt

PATH = lambda p: os.path.abspath(p)

if __name__ == "__main__":
    f = open(PATH("%s/CurrentActivity.txt" % os.getcwd()), "w")
    print "%s/CurrentActivity.txt" % os.getcwd()
    f.write("Activity: \n%s\n" % utils.get_focused_package_and_activity())
    print "Activity: \n%s\n" % utils.get_focused_package_and_activity()
    f.close()
    print "Completed"
    #sys.exit(0)
Ejemplo n.º 5
0
    if not raw_input("Make sure the test Activity, in this process, you should keep in this Activity!\n"
              "Please press Enter continue..."):
        sleep_time = -1
        dump_time = -1
        while not 0 < sleep_time <= 10:
            try:
                sleep_time = float(raw_input("Please input sleep time(0-10s) :"))
            except:
                continue
        while dump_time < 0:
            try:
                dump_time = int(raw_input("Please input dump times: "))
            except:
                continue

        activity_name = utils.get_focused_package_and_activity()
        print "Current Activity: "
        print activity_name
        sf = SurfaceFlinger(activity_name, sleep_time)
        times = ["time"] + [i for i in xrange(1, dump_time+1)]
        jankniess = ["Jankniess"]
        fps = ["fps"]
        for i in xrange(0, dump_time):
            sf.start_dump_latency_data()
            frame= sf.get_frame_rate();
            if frame != -1:
                jankniess.append(sf.get_Vsync_jankiness())
                fps.append(frame)
            sf.stop_dump_latency_data()
        print "jankniess:"
        print jankniess