def Appinstall(self): #全部在线设备的安装 commands = [] for devices in AdbTools().getOnlineDevices(): cmd = AdbTools(devices).install(path) commands.append(cmd) return commands
def AppKill(self): appName = AdbTools().dump_apk_name(path) # pid = AdbTools().get_pid(appName) commands = [] for devices in AdbTools().getOnlineDevices(): cmd = AdbTools(devices).kill_process(appName) commands.append(cmd) return commands
def appLogcat(self): #全部在线设备的安装 commands = [] for devices in AdbTools().getOnlineDevices(): cmd = Common().adbLogcat(devices) commands.append(cmd) return commands
def tvInstall(self): #只安装列表里的TV设备 commands = [] for devices in otherDevices().get_tvDevices(): cmd = AdbTools(devices).install(path) commands.append(cmd) return commands
def mobileInstall(self): #只安装列表里的手机设备 commands = [] for devices in otherDevices().get_mobileDevices(): cmd = AdbTools(devices).install(path) commands.append(cmd) return commands
def AppUninstall(self): commands = [] for devices in AdbTools().getOnlineDevices(): cmd = AdbTools(devices).uninstall(packName) commands.append(cmd) return commands
#!/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()
def AppQuit(self): commands = [] for devices in AdbTools().getOnlineDevices(): cmd = AdbTools(devices).quit_app(packName) commands.append(cmd) return commands
def tvClear(self): commands = [] for devices in otherDevices().get_tvDevices(): cmd = AdbTools(devices).clear_app_data(packName) commands.append(cmd) return commands
def appClear(self): commands = [] for devices in AdbTools().getOnlineDevices(): cmd = AdbTools(devices).clear_app_data(packName) commands.append(cmd) return commands
def AppRun(self): commands = [] for devices in AdbTools().getOnlineDevices(): cmd = AdbTools(devices).start_application(packName) commands.append(cmd) return commands
#!/usr/bin/env python #coding=utf-8 from Utils.adbUtils import AdbTools from Utils.Common import Common class InstallCase: def AppRun(self): commands = [] for devices in AdbTools().getOnlineDevices(): cmd = AdbTools(devices).start_application(packName) commands.append(cmd) return commands if __name__ == '__main__': path = Common().apkPath() packName = AdbTools().dump_apk_name( path) + '/' + AdbTools().dump_apk_launch(path) InstallCase().AppRun()