Example #1
0
 def appLogcat(self):
     #全部在线设备的安装
     commands = []
     for devices in AdbTools().getOnlineDevices():
         cmd = Common().adbLogcat(devices)
         commands.append(cmd)
     return commands
Example #2
0
 def get_apk_activity(self):
     cmd = Common().aaPath() + " | findstr launchable-activity:"
     result = ""
     p = subprocess.Popen(cmd,
                          stdout=subprocess.PIPE,
                          stderr=subprocess.PIPE,
                          stdin=subprocess.PIPE,
                          shell=True)
     (output, err) = p.communicate()
     if output != "":
         result = output.split()[1].decode()[6:-1]
     return result
Example #3
0
 def get_apk_package(self):
     cmd = Common().aaPath() + " | findstr package:"
     result = ""
     p = subprocess.Popen(cmd,
                          stdout=subprocess.PIPE,
                          stderr=subprocess.PIPE,
                          stdin=subprocess.PIPE,
                          shell=True)
     (output, err) = p.communicate()
     output = str(output, encoding='utf8')
     if output != "":
         result = output.split()[1][6:-1]
     return result
Example #4
0
 def get_apk_name(self):
     cmd = Common().aaPath() + " | findstr application-label-zu: "
     result = ""
     p = subprocess.Popen(cmd,
                          stdout=subprocess.PIPE,
                          stderr=subprocess.PIPE,
                          stdin=subprocess.PIPE,
                          shell=True)
     (output, err) = p.communicate()
     output = str(output, encoding='utf8')
     if output != "":
         result = output.split("'")[1]
     return result
Example #5
0
 def get_apk_version(self):
     cmd = Common().aaPath()
     result = ""
     p = subprocess.Popen(cmd,
                          stdout=subprocess.PIPE,
                          stderr=subprocess.PIPE,
                          stdin=subprocess.PIPE,
                          shell=True)
     (output, err) = p.communicate()
     if output != "":
         result = output.split()[3].decode()[12:]
         result = result.split("'")[1]
     return result
Example #6
0
#!/usr/bin/env python
#coding=utf-8

from Utils.adbUtils import AdbTools
from Utils.Common import Common

class UninstallCase:


    def AppUninstall(self):
        commands = []
        for devices in AdbTools().getOnlineDevices():
            cmd = AdbTools(devices).uninstall(packName)
            commands.append(cmd)
        return commands

if __name__ == '__main__':
    path = Common().apkPath()
    packName = AdbTools().dump_apk_name(path)
    UninstallCase().AppUninstall()
Example #7
0
#!/usr/bin/env python
#coding=utf-8

from Utils.adbUtils import AdbTools
from Utils.Common import Common


class Logcat:
    def appLogcat(self):
        #全部在线设备的安装
        commands = []
        for devices in AdbTools().getOnlineDevices():
            cmd = Common().adbLogcat(devices)
            commands.append(cmd)
        return commands


if __name__ == '__main__':
    path = Common().logTag()
    Logcat().appLogcat()
Example #8
0
 def get_apk_size(self):
     size = os.path.getsize(Common().apkPath()) / (1024 * 1000)
     return ('%.2f' % size) + "M"  #保留小数点后两位